@@ -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+
9185void 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