Closed kasunvinod closed 3 months ago
There was a issue with the main.c where i create the publisher. After correcting that I was able to establish the connection with the STM board. But when I execute the ros2 topic list
and ros2 node list
, the publisher node and topic is not coming up.
I'm experiencing the same issue with RaspberryPi pico as well. I have reported that in here.
I was using cyclone dds earlier and I revert it back to fastDDS as per @pablogs9's advice.
SOLVED after changing the ROS_DOMAIN_ID to 0 as per @pablogs9. More info can be found in the above mentioned issue.
I'm a beginner in STM32 development, and I would really appreciate it if someone could help me with this. I've been trying to set up micro-ROS in an STM32 board for a couple of weeks now. Still, I'm unable to get it to work. I did the following things during the setup process. But I'm unable to establish a connection with the STM32 board using the PC.
I've tried the mentioned steps with both NUCLEO-F446RE & NUCLEO-F767ZI multiple times but still no luck.
Important Observations
Main Computer - Ubuntu 22.04 with ROS2 Humble STM Board - NUCLEO-F446RE & NUCLEO-F767ZI
Installing micro-ROS Build System All the steps available in this micro-ROS Tutorial related to installing the micro-ROS build system were followed by executing the following commands.
mkdir microros_ws'
cd microros_ws
git clone -b $ROS_DISTRO https://github.com/micro-ROS/micro_ros_setup.git src/micro_ros_setup
sudo apt update && rosdep update
rosdep install --from-paths src --ignore-src -y
ros2 run micro_ros_setup create_firmware_ws.sh host
ros2 run micro_ros_setup build_firmware.sh
ros2 run micro_ros_setup create_agent_ws.sh
ros2 run micro_ros_setup build_agent.sh
Setting up the STM Board The following steps were followed to setup the STM32 board with micro-ROS using CubeIDE as per the instructions on micro_ros_stm32cubemx_utils page.
Core -> RCC -> High Speed Clock (HSE)
selectCrystal/Ceramic Resonator
System Core -> SYS -> Timebase Source
selectTIM1
Middleware -> FREERTOS -> Interface
selectCMSIS_V2
Middleware -> FREERTOS -> Configuration -> Task and Queues
double click thedefaultTask
and set a stack size of3000
.Connectivity
choose theUSART2
.USART
configuration, go to DMA Settings. Click on the Add button. Click on the Select dropdown and choose bothRX
andTX
.Rx DMA
choose Circular as mode.Very High
for both Rx and Tx.NVIC Settings
of the UART and activate theUSART2 global interrupt
.Project -> Properties -> C/C++ Build -> Settings -> Build Steps
Tab and inPre-build steps
add:docker pull microros/micro_ros_static_library_builder:humble && docker run --rm -v ${workspace_loc:/${ProjName}}:/project --env MICROROS_LIBRARY_FOLDER=micro_ros_stm32cubemx_utils/microros_static_library_ide microros/micro_ros_static_library_builder:humble
Project -> Settings -> C/C++ Build -> Settings -> Tool Settings Tab -> MCU GCC Compiler -> Include paths
addmicro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros/include
Project -> Settings -> C/C++ Build -> Settings -> MCU GCC Linker -> Libraries
../micro_ros_stm32cubemx_utils/microros_static_library_ide/libmicroros
inLibrary search path (-L)
microros
inLibraries (-l)
microros_time.c, microros_allocators.c, custom_memory_manager.c, dma_transport.c
) fromextra_sources
folder.ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0