kevinzakka / mink

Python inverse kinematics based on MuJoCo
https://kevinzakka.github.io/mink/
Apache License 2.0
278 stars 10 forks source link

interactive viewer to control the arm motion #35

Closed vidhiJain closed 1 hour ago

vidhiJain commented 2 hours ago

I am curious if it is possible to have interactive mujoco viewer to move the end effector and have the IK solved for it.

kevinzakka commented 2 hours ago

Hi @vidhiJain, the examples in the examples dir all use the interactive viewer with mocap bodies that you can move around to specify targets. Try them and let me know if that solves your problem.

vidhiJain commented 2 hours ago

I'm running on macOS mjpython arm_aloha.py, mjpython arm_ur5e.py. It displays the end-effector highlighted but it seems I can't control it (with laptop trackpad). For mjpython mobile_stretch.py, the window opens with the robot rotating to reach hand and base end-effectors. Can we move the red box interactively on the viewer? If yes, how? I suspected it won't because the viewer is launched as passive.

kevinzakka commented 2 hours ago

@vidhiJain Double click the mocap body to highlight it. Then hit ctrl + left to rotate and ctrl + right to translate.

jonzamora commented 1 hour ago

^ This is also in the MuJoCo documentation, see here.

"Interaction is done with the mouse; built-in help with a summary of available commands is available by pressing the F1 key. Briefly, an object is selected by left-double-click. The user can then apply forces and torques on the selected object by holding Ctrl and dragging the mouse. Dragging the mouse alone (without Ctrl) moves the camera."

vidhiJain commented 1 hour ago

Thank you for the prompt response~!

kevinzakka commented 1 hour ago

Thank you @jonzamora !!