Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Consideration of using LCM? #12

Closed
edward9503 opened this issue May 27, 2022 · 3 comments
Closed

Consideration of using LCM? #12

edward9503 opened this issue May 27, 2022 · 3 comments

Comments

@edward9503
Copy link

Hi there,

first of all, thanks for open-sourcing the codes. It really helps the community.

I have a question about the conversion between ROS message and UDP: as described in A1 Software Developer Guide, sending UDP instructions in ROS nodes may cause communication abnormalities. To ensure real-time performance, it is recommended to use LCM server to transfer the data between ROS and UDP. But after I checked the whole code, I found that you are converting the ROS message directly to UDP and vice versa. I concern that the real-time performance cannot be ensured in this case. So I was wondering if you skip the LCM server intentionally, and if yes, why?

Many thanks.
Shengzhi Wang

@ShuoYangRobotics
Copy link
Owner

Hi Shengzhi,

Thanks for your question. On hardware, ROS is not involved in critical communication. ROS only publish debug messages. The robot and the controller directly talk via unitree SDK's UDP class. This is the most direct communication channel. You cannot do any better. The LCM is a wrapping layer over the UDP class so theoretically it introduces a small delay. Using UDP communication the control frequency can reach around 400Hz-500Hz, which is enough to achieve torque control with reasonable performance. The controller is not running real time but I think if your robot does not run at 5m/s, this won't affect performance.

In Gazebo simulation, yes, gazebo and the controller talk via ROS. But we can slow down the simulation speed to make sure everything is still synchronized.

@edward9503
Copy link
Author

edward9503 commented May 31, 2022

Hi Shuo,

thanks for your reply. I've attached the A1 software guide, and I would like to quote the section 4.4.1 in page 15.
A1 Software Guide v2.0-en.pdf

In my understanding, one ROS node acts like one process in pc. It is commonly known that ROS is not real-time guaranteed. Although you are using ROS not for the critical communication, your controller runs as a non-real-time Ros node and the UDP instructions are set directly inside this node, which thus cannot ensure the real-time performance on controlling the robot. As mentioned in the software guide, by using LCM, the non-real-time ROS nodes won't affect the real-time process of controlling robot. Therefore, it seems that using LCM could help to achieve the real-time.

How do you think?

Best

@edward9503
Copy link
Author

Hi @ShuoYangRobotics ,

any feedback on this? I've also asked the technical support from Unitree. They also recommend using the LCM instead of direct UDP. So maybe this could help to improve the real-time performance. How do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants