Skip to content

Commit 97a164c

Browse files
authored
Update custom transport example (#46)
1 parent dac6f80 commit 97a164c

2 files changed

Lines changed: 4 additions & 12 deletions

File tree

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ Is possible to use a micro-ROS Agent just with this docker command:
8686

8787
```bash
8888
# Serial micro-ROS Agent
89-
docker run -it --rm -d /dev:/dev --privileged --net=host microros/micro-ros-agent:foxy serial --dev [YOUR BOARD PORT] -v6
89+
docker run -it --rm -v /dev:/dev --privileged --net=host microros/micro-ros-agent:foxy serial --dev [YOUR BOARD PORT] -v6
9090
```
9191

9292
## Purpose of the Project

examples/int32_publisher_custom_transport/main/main.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,16 +38,8 @@ void micro_ros_task(void * arg)
3838
rcl_allocator_t allocator = rcl_get_default_allocator();
3939
rclc_support_t support;
4040

41-
rcl_init_options_t init_options = rcl_get_zero_initialized_init_options();
42-
RCCHECK(rcl_init_options_init(&init_options, allocator));
43-
rmw_init_options_t* rmw_options = rcl_init_options_get_rmw_init_options(&init_options);
44-
45-
// Static Agent IP and port can be used instead of autodisvery.
46-
RCCHECK(rmw_uros_options_set_udp_address(CONFIG_MICRO_ROS_AGENT_IP, CONFIG_MICRO_ROS_AGENT_PORT, rmw_options));
47-
//RCCHECK(rmw_uros_discover_agent(rmw_options));
48-
4941
// create init_options
50-
RCCHECK(rclc_support_init_with_options(&support, 0, NULL, &init_options, &allocator));
42+
RCCHECK(rclc_support_init(&support, 0, NULL, &allocator));
5143

5244
// create node
5345
rcl_node_t node;
@@ -88,10 +80,11 @@ void micro_ros_task(void * arg)
8880
vTaskDelete(NULL);
8981
}
9082

83+
static size_t uart_port = UART_NUM_0;
84+
9185
void app_main(void)
9286
{
9387
#if defined(RMW_UXRCE_TRANSPORT_CUSTOM)
94-
size_t uart_port = UART_NUM_1;
9588
rmw_uros_set_custom_transport(
9689
true,
9790
(void *) &uart_port,
@@ -104,7 +97,6 @@ void app_main(void)
10497
#error micro-ROS transports misconfigured
10598
#endif // RMW_UXRCE_TRANSPORT_CUSTOM
10699

107-
//pin micro-ros task in APP_CPU to make PRO_CPU to deal with wifi:
108100
xTaskCreate(micro_ros_task,
109101
"uros_task",
110102
CONFIG_MICRO_ROS_APP_STACK,

0 commit comments

Comments
 (0)