wip: testing

This commit is contained in:
2025-08-22 11:37:20 +02:00
parent 98ac20f729
commit ef5035b92b
2 changed files with 29 additions and 20 deletions

View File

@@ -1,25 +1,32 @@
#include <zephyr/kernel.h>
#include <zephyr/device.h>
#include <zephyr/sys/printk.h>
#include <zephyr/devicetree.h>
#include <zephyr/drivers/gpio.h>
#include <rcl/rcl.h>
#include <rclc/rclc.h>
#include <uxr/client/config.h>
#include <uxr/client/client.h>
#include <zephyr/kernel.h>
#if defined(CONFIG_BOARD_NATIVE_SIM)
#include "gpio_visualizer.hpp"
#endif
// IP and port of the PC running XRCE-DDS agent
#define AGENT_IP "192.168.1.100"
#define AGENT_PORT 8888
int main(void)
{
#if defined(CONFIG_BOARD_NATIVE_SIM)
spawn_gpio_visualizer_thread();
#endif
{
// Initialize micro-ROS support for Zephyr UDP transport
rmw_uros_set_custom_transport(
true, // enable
NULL, // user data (none)
zephyr_transport_open,
zephyr_transport_close,
zephyr_transport_write,
zephyr_transport_read);
while (1) {
printk("Hello World! %s\n", CONFIG_BOARD_TARGET);
k_sleep(K_SECONDS(2));
}
// Initialize rcl context, node, publisher, subscriber, etc...
return 0;
// Your app code here
while (1) {
// Spin or sleep
k_sleep(K_MSEC(100));
}
return 0;
}