How to use micro_ros on OpenCR
Using ros foxy and trying to get the data from OpenCR. I have followed the instructions in the documentation and installed the microros setup as well as microrosarduino. The microrospublisher code is uploaded and the microros_agent is also initiated successfully. It displays topic, publisher,data writer created.
But the topics are not listed or working when I use the ros2 topic list.
am I missing any steps? Kindly inform me what needs to be done.
The node is also not working - when I use ros2 node list , there is no running node
I have tried the debug method and I got something like this:
[1628074355.331673] debug | SerialAgentLinux.cpp | sendmessage | [** <
[1628074355.331928] debug | SerialAgentLinux.cpp | recvmessage | [==>> SER <<==] | clientkey: 0x5CC77904, len: 13, data: 0000: 81 00 00 00 0B 01 05 00 54 00 54 00 80
[1628074355.332154] debug | SerialAgentLinux.cpp | sendmessage | [** <
[1628074356.351128] debug | SerialAgentLinux.cpp | recvmessage | [==>> SER <<==] | clientkey: 0x5CC77904, len: 16, data: 0000: 81 80 55 00 07 01 08 00 00 5F 00 05 51 00 00 00
[1628074356.351352] debug | DataWriter.cpp | write | [** <
I tried the docker method and getting the same results.
Thanks
Asked by Sarwan on 2021-07-29 11:05:55 UTC
Answers
Hello, a few questions:
- Can you see the created node with
ros2 node list
? How are you starting the Agent? If you are using ros2 run, increase the debug level and check that the board is publishing each second to discard communication issues:
ros2 run micro_ros_agent micro_ros_agent serial --dev [YOUR BOARD PORT] -v6
You can also try with the dockerized agent:
docker run -it --rm -v /dev:/dev --privileged --net=host -v /dev/shm:/dev/shm microros/micro-ros-agent:foxy serial --dev [YOUR BOARD PORT] -v6
If you are already using the dockerized agent, make sure you got the latest version:
docker pull microros/micro-ros-agent:foxy
Asked by AntonioCuadros on 2021-08-02 04:48:37 UTC
Comments
Hi, Thanks for your reply. I cannot see the node list as well. I tried the debug option and I getting the result like the one listed below:
[1628074354.306192] debug | SerialAgentLinux.cpp | send_message | [** <
Asked by Sarwan on 2021-08-04 06:10:58 UTC
Communication looks fine, as the message is reaching ROS2 fastdds middleware:
[1628074356.351352] debug | DataWriter.cpp | write | [* <<dds>> *] | client_key: 0x00000000, len: 4, data: 0000: 51 00 00 00
I just tested the example using the dockerized agent and it worked fine. Did you modify your ROS2 installation? Make sure you are using FastDDS with export RMW_IMPLEMENTATION=rmw_fastrtps_cpp
on the same terminal you will call ros2 topic list
.
And just to check, make sure are on ROS2 default domain id 0: export ROS_DOMAIN_ID=0
.
Also and just to point it out, check that you are using the foxy
branch of micro_ros_arduino
Asked by AntonioCuadros on 2021-08-05 06:26:54 UTC
Changing the ROS_DOMAIN_ID=0 made it work. Thanks a lot for the information
Asked by Sarwan on 2021-08-06 00:35:20 UTC
Comments