unitreerobotics / unitree_ros

BSD 3-Clause "New" or "Revised" License
463 stars 224 forks source link

Problem with LCM server #20

Closed AlaricLcrs closed 2 years ago

AlaricLcrs commented 2 years ago

Hello ! I have an a1 robot and have successfully setup my workspace. But form times to times, I get the following error when I run the robot in high level mode for example (roslaunch mbs_unitree_ros high_level_mode.launch) :

[node_lcm_server-2] process has died [pid 6969, exit code 255, cmd /home/amin/catkin_ws/devel/lib/unitree_legged_real/lcm_server_3_2 a1 highlevel name:=node_lcm_server log:=/root/.ros/log/37556312-1b72-11ec-a5c3-000c296e3085/node_lcm_server-2.log]. log file: /root/.ros/log/37556312-1b72-11ec-a5c3-000c296e3085/node_lcm_server-2*.log

It occurs very randomly but often enough to become a problem. It usually works for a few minutes if I'm lucky and then I get the error, it doesn't occur right after I run the command. And I've tried to check the log file (_/root/.ros/log/37556312-1b72-11ec-a5c3-000c296e3085/node_lcmserver-2*.log) but it doesn't exist though the folder does (and contains other log files). Any idea on how to solve it ?

PS : Here's the whole return message that I get. log.txt

yiyuc commented 2 years ago

Hi,

You need to kill the gzserver process cuz sometimes gazebo doesn’t kill the process itself when exiting the simulator.

Best, Yiyu

On Wed, Sep 22, 2021 at 00:40 AlaricLcrs @.***> wrote:

Hello ! I have an a1 robot and have successfully setup my workspace. But form times to times, I get the following error when I run the robot in high level mode for example (roslaunch mbs_unitree_ros high_level_mode.launch) :

[node_lcm_server-2] process has died [pid 6969, exit code 255, cmd /home/amin/catkin_ws/devel/lib/unitree_legged_real/lcm_server_3_2 a1 highlevel name:=node_lcm_server log:=/root/.ros/log/37556312-1b72-11ec-a5c3-000c296e3085/node_lcm_server-2.log]. log file: /root/.ros/log/37556312-1b72-11ec-a5c3-000c296e3085/node_lcm_server-2*.log

It occurs very randomly but often enough to become a problem. It usually works for a few minutes if I'm lucky and then I get the error, it doesn't occur right after I run the command. And I've tried to check the log file ( /root/.ros/log/37556312-1b72-11ec-a5c3-000c296e3085/node_lcm_server-2.log*) but it doesn't exist though the folder does (and contains other log files). Any idea on how to solve it ?

PS : Here's the whole return message that I get. log.txt https://urldefense.com/v3/__https://github.com/unitreerobotics/unitree_ros/files/7208700/log.txt__;!!LIr3w8kk_Xxm!7Nuv3FFsj-wVBLnZJUmPb5QJkutEILTCb4m6HOowDnKM_2yfkugW5F6wdpE5_A$

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/unitreerobotics/unitree_ros/issues/20__;!!LIr3w8kk_Xxm!7Nuv3FFsj-wVBLnZJUmPb5QJkutEILTCb4m6HOowDnKM_2yfkugW5F4oXkCBRg$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AF22HWZQG55S6NFWEET4TETUDGCADANCNFSM5EQUSNYQ__;!!LIr3w8kk_Xxm!7Nuv3FFsj-wVBLnZJUmPb5QJkutEILTCb4m6HOowDnKM_2yfkugW5F4gFqeKig$ . Triage notifications on the go with GitHub Mobile for iOS https://urldefense.com/v3/__https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!LIr3w8kk_Xxm!7Nuv3FFsj-wVBLnZJUmPb5QJkutEILTCb4m6HOowDnKM_2yfkugW5F4V1qYmXQ$ or Android https://urldefense.com/v3/__https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!LIr3w8kk_Xxm!7Nuv3FFsj-wVBLnZJUmPb5QJkutEILTCb4m6HOowDnKM_2yfkugW5F6n-_-yWQ$.

AlaricLcrs commented 2 years ago

Thank you for this answer ! However, I'm not running gazebo, I'm using the real life robot so naturally i can't find a gzserver process to kill :') Is there another process that I should kill that'd be related to the use of the real robot ? Best, Alaric

yiyuc commented 2 years ago

Oh, I see, sorry I didn’t answer your question. This is the LCM timeout error. It’s related to the lcm server when sending and receiving messages. Are you running a real-time Ubuntu system? When you run code with robot, I would suggest you using the sdk instead of ROS because ROS is not running in real time and may cause the LCM timeout error. If you patch your OS with the RT kernel, it should solve the issue but still, you may run into this error some times.

Best, Yiyu

On Wed, Sep 22, 2021 at 23:31 AlaricLcrs @.***> wrote:

Thank you for this answer ! However, I'm not running gazebo, I'm using the real life robot so naturally i can't find a gzserver process to kill :') Is there another process that I should kill that'd be related to the use of the real robot ?

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/unitreerobotics/unitree_ros/issues/20*issuecomment-925538876__;Iw!!LIr3w8kk_Xxm!6fDaU8D8aL2Dt5KH5WuL77fvm3p3P_B_gyfeDtrw5VZHDViuaqwK10NlpdhpWw$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AF22HW2O43AKKJZRHRMCTA3UDLCVTANCNFSM5EQUSNYQ__;!!LIr3w8kk_Xxm!6fDaU8D8aL2Dt5KH5WuL77fvm3p3P_B_gyfeDtrw5VZHDViuaqwK10MQjCGLZg$ . Triage notifications on the go with GitHub Mobile for iOS https://urldefense.com/v3/__https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!LIr3w8kk_Xxm!6fDaU8D8aL2Dt5KH5WuL77fvm3p3P_B_gyfeDtrw5VZHDViuaqwK10O61gUXOw$ or Android https://urldefense.com/v3/__https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!LIr3w8kk_Xxm!6fDaU8D8aL2Dt5KH5WuL77fvm3p3P_B_gyfeDtrw5VZHDViuaqwK10NumnBO9g$.

AlaricLcrs commented 2 years ago

Thanks for your quick reply !

I'm running Ubuntu on a virtual machine on a MacBook 😅 How would I use the sdk without ROS ? I thought I needed to use both of them to get the robot running

Best, Alaric

yiyuc commented 2 years ago

I suggest you run it on a computer with Ubuntu. There is a separate sdk repo you can find in the Unitree github and there are instructions there On Thu, Sep 23, 2021 at 00:12 AlaricLcrs @.***> wrote:

Thanks for your quick reply !

I'm running Ubuntu on a virtual machine on a MacBook 😅 How would I use the sdk without ROS ? I thought I needed to use both of them to get the robot running

Best, Alaric

— You are receiving this because you commented.

Reply to this email directly, view it on GitHub https://urldefense.com/v3/__https://github.com/unitreerobotics/unitree_ros/issues/20*issuecomment-925558110__;Iw!!LIr3w8kk_Xxm!7Mni0NLiTqgOLOCgrns9_FWB1i3WP05XmpxxjJHe1tbyVKAcG0mx0pCO2whgGg$, or unsubscribe https://urldefense.com/v3/__https://github.com/notifications/unsubscribe-auth/AF22HW2NEQVN25B6SKXUA53UDLHNXANCNFSM5EQUSNYQ__;!!LIr3w8kk_Xxm!7Mni0NLiTqgOLOCgrns9_FWB1i3WP05XmpxxjJHe1tbyVKAcG0mx0pCcZW3wiA$ . Triage notifications on the go with GitHub Mobile for iOS https://urldefense.com/v3/__https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675__;!!LIr3w8kk_Xxm!7Mni0NLiTqgOLOCgrns9_FWB1i3WP05XmpxxjJHe1tbyVKAcG0mx0pB5KtUM5w$ or Android https://urldefense.com/v3/__https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign*3Dnotification-email*26utm_medium*3Demail*26utm_source*3Dgithub__;JSUlJSU!!LIr3w8kk_Xxm!7Mni0NLiTqgOLOCgrns9_FWB1i3WP05XmpxxjJHe1tbyVKAcG0mx0pDimXlReA$.

AlaricLcrs commented 2 years ago

Yes, the SDK is already installed on my workspace and I can start the lcm server but to communicate with the robot I still have to use ROS, no ? I didn't find instructions related to that there

yiyuc commented 2 years ago

Check this repo, https://github.com/unitreerobotics/unitree_legged_sdk although the Aliengo robot uses version 32, but the build instruction is the same. You can run the example files by sudo ./example

AlaricLcrs commented 2 years ago

Okay thanks, it works now ! And last question I have : I've seen videos of the A1 dancing or doing backflips, is there an existing code that I could get or should I write the code myself ? And also is it possible to implement a few of my programs directly on the remote controller ? For instance I have a python code that makes the robot make a U-turn, could I put in on the remote so that just by pressing a button it would execute the program ? I haven't found anything about that on the Internet Thanks !

Best, Alaric

yiyuc commented 2 years ago

There is no existing code for the dancing/backflips in the repo, but you can always develop it with the low level control mode. For dancing, it's some development in the controller, and for backflip, you would need trajectory optimization. There is one header file in the SDK (joystick.h) that translates the remote control command so you can program your custom key bindings for your case