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

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

Open
erwincoumans opened this issue May 27, 2024 · 6 comments
Open

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

erwincoumans opened this issue May 27, 2024 · 6 comments

Comments

@erwincoumans
Copy link

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
Copy link

RayYoh commented May 28, 2024

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
Copy link
Author

erwincoumans commented May 28, 2024

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
Copy link

RayYoh commented May 29, 2024

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
Copy link
Collaborator

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:

  • sensor data (IMU, joint position, joint velocity).
  • wireless controller (Simulate using an Xbox controller).
  • motor control.

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
Copy link

kongbaige-szw commented Jul 11, 2024

我注意到提交添加了 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
Copy link

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

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

5 participants