Ask Your Question
0

How to use micro_ros on OpenCR

asked 2021-07-29 11:05:55 -0500

Sarwan gravatar image

updated 2021-08-04 06:17:23 -0500

Using ros foxy and trying to get the data from OpenCR. I have followed the instructions in the documentation and installed the micro_ros setup as well as micro_ros_arduino. The micro_ros_publisher code is uploaded and the micro_ros_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 | send_message | [* <<ser>> *] | client_key: 0x5CC77904, len: 13, data: 0000: 81 00 00 00 0A 01 05 00 55 00 00 00 80

[1628074355.331928] debug | SerialAgentLinux.cpp | recv_message | [==>> SER <<==] | client_key: 0x5CC77904, len: 13, data: 0000: 81 00 00 00 0B 01 05 00 54 00 54 00 80

[1628074355.332154] debug | SerialAgentLinux.cpp | send_message | [* <<ser>> *] | client_key: 0x5CC77904, len: 13, data: 0000: 81 00 00 00 0A 01 05 00 55 00 00 00 80

[1628074356.351128] debug | SerialAgentLinux.cpp | recv_message | [==>> SER <<==] | client_key: 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 | [* <<dds>> *] | client_key: 0x00000000, len: 4, data: 0000: 51 00 00 00

I tried the docker method and getting the same results.

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-08-02 04:48:37 -0500

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

edit flag offensive delete link more

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 | [* <<ser>> ] | client_key: 0x5CC77904, len: 13, data: 0000: 81 00 00 00 0A 01 05 00 54 00 00 00 80 [1628074354.307933] debug | SerialAgentLinux.cpp | recv_message | [==>> SER <<==] | client_key: 0x5CC77904, len: 13, data: 0000: 81 00 00 00 0B 01 05 00 53 00 53 00 80 [1628074354.307995] debug | SerialAgentLinux.cpp | send_message | [ <<ser>> *] | client_key: 0x5CC77904, len: 13, data: 0000: 81 00 00 00 0A 01 05 00 54 00 00 00 80 [1628074355.331320] debug | SerialAgentLinux.cpp | recv_message | [==>> SER <<==] | client_key: 0x5CC77904, len: 16, data: 0000: 81 80 54 00 07 01 08 00 00 5E 00 05 50 00 00 00 [1628074355.331500] debug | DataWriter.cpp | write | [*

Sarwan gravatar image Sarwan  ( 2021-08-04 06:10:58 -0500 )edit

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

AntonioCuadros gravatar image AntonioCuadros  ( 2021-08-05 06:26:54 -0500 )edit

Changing the ROS_DOMAIN_ID=0 made it work. Thanks a lot for the information

Sarwan gravatar image Sarwan  ( 2021-08-06 00:35:20 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2021-07-29 11:05:55 -0500

Seen: 220 times

Last updated: Aug 04 '21