unitreerobotics / unitree_ros

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

More detailed examples about how to use the "joint_controller.cpp" in "unitree_legged_control" folder #18

Closed edward9503 closed 2 years ago

edward9503 commented 2 years ago

Hi there,

I saw in the unitree_ros github description, it says that the "joint_controller.cpp" in folder "unitree_legged_control" contains the joints controllers for simulation, where we can control joints with position, velocity and torque. But the detailed examples about how to use it are lacking. So I was wondering if there are some tutorials about this controller.

Thanks a lot!

Zhaiweiwei0 commented 2 years ago

Hi, The "joint_controller.cpp" is just a declaration, you can refer to "unitree_ros/unitree_controller/src/servo.cpp" for joint control in different modes.

edward9503 commented 2 years ago

Hi, The "joint_controller.cpp" is just a declaration, you can refer to "unitree_ros/unitree_controller/src/servo.cpp" for joint control in different modes.

Hi Thanks for the reply. And can I also run the controller to control the real robot while runing the simulation at the same time?

Zhaiweiwei0 commented 2 years ago

yeah, you can, but that's moot. They can only run different ROS nodes using different controllers.

edward9503 commented 2 years ago

yeah, you can, but that's moot. They can only run different ROS nodes using different controllers.

I was thinking maybe after publishing the lowState to the ros topic for simulation, we can also send the lowState to robot by using the "udp.SetSend(cmd);". Maybe it'll work.

edward9503 commented 2 years ago

yeah, you can, but that's moot. They can only run different ROS nodes using different controllers.

Hi I suddenly have another question: is it possible to achieve high-level control in simulation as we can in the real robot? If yes, how?

Zhaiweiwei0 commented 2 years ago

Sorry, the simulation cannot do high-level control, we've explained this in the introduction section of the README.md file.

chitianqilin commented 2 years ago

That will be very useful if Unitree can provide a high-level example running in Gazebo simulation.