Visualizing real life arm movement in IsaacSim - #169
Open
RamyWahib wants to merge 4 commits into
Open
Conversation
Comment on lines
+1
to
+38
| """Real-time Isaac Sim visualization of the physical bimanual test stand (Isaac Lab | ||
| counterpart to live_arm_mjviser.py, same directory). | ||
|
|
||
| Drives one of BIMANUAL_ARM_CFG's two joint chains directly from live | ||
| /interfacing/motorFeedback data, same --arm-side/--urdf-side split as | ||
| live_arm_mjviser.py: --arm-side picks which hardware_mapping.yaml section / real motors | ||
| to read (only "left" is wired/calibrated today); --urdf-side picks which URDF chain to | ||
| animate with that feedback. Defaults to --urdf-side right (the unsuffixed joint1..joint6 | ||
| chain), matching live_arm_mjviser.py's own validated default invocation in | ||
| ARM_BRINGUP.md (--arm-side left --urdf-side right) -- confirmed by direct observation | ||
| against the real test stand that the suffixed joint1L..joint6l chain is NOT the visually | ||
| correct one here, despite bimanual_arm_cfg.py's docstring claiming otherwise. Read-only: | ||
| never calls set_joint_position_target or publishes MotorCmd -- each tick it force-writes | ||
| joint state via write_joint_state_to_sim(), the same direct-overwrite semantics | ||
| live_arm_mjviser.py uses on data.qpos (no PD lag/interpolation, exact live mirror). It | ||
| cannot move the real arm. | ||
|
|
||
| Zero position matches live_arm_mjviser.py: both compute | ||
| zero_offset + direction*motor_deg + display_offset from hardware_mapping.yaml's | ||
| calibrated zero_offset per joint. This also matches BIMANUAL_ARM_CFG's default/rest pose | ||
| for BOTH chains (see bimanual_arm_cfg.py's _load_zero_offsets_deg()), so joints with no | ||
| live feedback yet (e.g. wrist_pitch, not wired today) sit at the calibrated zero instead | ||
| of a stale Physics Inspector snapshot. task_space_real.py's own sim-zero is matched the | ||
| same way, on the OTHER chain (RIGHT_ARM_JOINTS, which it always drives for real hardware | ||
| output regardless of which chain looks right in this viewer). | ||
|
|
||
| rclpy can't be imported inside env_isaaclab (its compiled extension targets the system | ||
| ROS Python, not conda's -- see udp_to_ros_bridge.py for the same constraint in the | ||
| opposite direction). So this script never imports rclpy: it reads motor feedback from a | ||
| UDP socket instead, fed by feedback_to_udp_bridge.py running under system ROS Python. | ||
|
|
||
| Terminal 1 (system python, ROS sourced): | ||
| source /opt/ros/jazzy/setup.bash | ||
| source /home/rwahib/wato/humanoid/autonomy/install/setup.bash | ||
| /usr/bin/python3 autonomy/behaviour/joint_command/scripts/feedback_to_udp_bridge.py | ||
|
|
||
| Terminal 2 (env_isaaclab): | ||
| conda activate env_isaaclab |
Collaborator
There was a problem hiding this comment.
Is these description AI generated? Maybe can make it much more concise
Applies to all comments in this and future pr too
Collaborator
|
Can address comments and rebase for the clang ci issue t naturally resolve |
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces a script that reads joint angles currently on the motors that are sent through the CAN bus, and then updates the position of the arm in IsaacSim to match those joint angles.
The purpose of this script is to make sure the zero positions in both IsaacSim and in real life are the same.