unitreerobotics / unitree_mujoco

BSD 3-Clause "New" or "Revised" License
161 stars 42 forks source link

joystick control in sim (c++, Python)? #10

Open erwincoumans opened 4 months ago

erwincoumans commented 4 months ago

I noticed the commit add joystick support of python simulation and tried various joysticks, but couldn't make the robot walk around github.com/unitreerobotics/unitree_mujoco/commit/0fe8b7038bab27b71cc136ddb370d685d7c98c66

Could you provide instructions how to run the simulation and use a joystick to walk around? What joysticks are supported? Thank you

RayYoh commented 4 months ago

I noticed the commit add joystick support of python simulation and tried various joysticks, but couldn't make the robot walk around github.com/unitreerobotics/unitree_mujoco/commit/0fe8b7038bab27b71cc136ddb370d685d7c98c66

Could you provide instructions how to run the simulation and use a joystick to walk around? What joysticks are supported? Thank you

Hi, have you achieved using this example here to control the robot in simulation?

erwincoumans commented 4 months ago

When I run that example, there is some error below. How does the client example connect to the simulator? Do I need to do anything else than running the ''' unitree/unitree_mujoco/simulate/build]$ ./unitree_mujoco ''' and then in another terminal

python sportmode_test.py 
Start test !!!
[ClientStub] send request error. id: 18477423849317

Screenshot from 2024-05-28 12-51-23

Only the python stand_go2.py makes the robot simulation get up and go down again, but no joystick control. The simulator is in "lo" low-level mode. How do you set the simulator in high-level mode?

RayYoh commented 4 months ago

Oh, actually I have the same error as you. I just simply change the connection here to ChannelFactoryInitialize(1, "lo"). It works for high state reading here, but the control is not successful. I guess current mujoco simulation doesn't support high-level control and just support low-level.

wuyangning commented 4 months ago

I noticed the commit add joystick support of python simulation and tried various joysticks, but couldn't make the robot walk around github.com/unitreerobotics/unitree_mujoco/commit/0fe8b7038bab27b71cc136ddb370d685d7c98c66

Could you provide instructions how to run the simulation and use a joystick to walk around? What joysticks are supported? Thank you

Sportclient is not supported by current version unitree mujoco. Current version only provides basic support of:

Unitree mujoco is mainly provided to users for sim to real verification of their control algorithms. Joystick is mainly used to simulate the wireless controller of real machines, so that users can implement their control algorithms without modifying the code.

kongbaige-szw commented 2 months ago

我注意到提交添加了 python 模拟的操纵杆支持,并尝试了各种操纵杆,但无法让机器人走动 github.com/unitreerobotics/unitree_mujoco/commit/0fe8b7038bab27b71cc136ddb370d685d7c98c66

您能否提供如何运行模拟并使用操纵杆四处走动的说明?支持哪些操纵杆? 谢谢

Hello, I would like to ask whether this Python emulator can run on Windows, and whether you have any errors during use: image

shengzewen commented 2 months ago

@wuyangning 按照unitree_mujoco文档的操作,所有程序均已运行,但是最终无法用操纵杆来控制go2的运动,这是为什么。您能否提供如何使用操纵杆进行模拟的详细说明。