Skip to content

Visualizing real life arm movement in IsaacSim - #169

Open
RamyWahib wants to merge 4 commits into
mainfrom
real2sim-visualization
Open

Visualizing real life arm movement in IsaacSim#169
RamyWahib wants to merge 4 commits into
mainfrom
real2sim-visualization

Conversation

@RamyWahib

@RamyWahib RamyWahib commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

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.

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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is these description AI generated? Maybe can make it much more concise

Applies to all comments in this and future pr too

@wilsonchenghy

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

Successfully merging this pull request may close these issues.

3 participants