unitreerobotics / unitree_ros_to_real

103 stars 93 forks source link

Missing documentation about low_cmd.head #61

Open SmnGdn opened 1 year ago

SmnGdn commented 1 year ago

Hello, I'm trying to control the robot using ROS, but when sending a message I don't find any documentation on what values can the low_cmd.head take. Any information on what is this field doing, and what values it can take?

Thank you

xyq1223 commented 1 year ago

Hello, I am sorry that we do not support sending udp directly to the motor for the time being. It is recommended that you switch the unitreearm class to lowcmd to send control commands to the motor by using our SDK.

SmnGdn commented 1 year ago

Just to clarify, I am using the SDK, and I am sending low_cmd messages. For anyone having the same question, these are the values you should use: lowCmd_message.head[0] = 0xFE; lowCmd_message.head[1] = 0xEF; low_cmd_ros.levelFlag = LOWLEVEL;

xyq1223 commented 1 year ago

Hello,you can click the link below for reference. In line 20 of this code, udp.InitCmdData(cmd); This can automatically set the frame header.

https://github.com/unitreerobotics/unitree_legged_sdk/blob/go1/example/example_position.cpp