Repository navigation
RSDSO-21561: Add D421 URDF model and mesh to realsense2_description - #3534
Conversation
Gilaadb
left a comment
There was a problem hiding this comment.
The URDF followed D455/D435 family of cameras too stricktly. It describes sizes that don't physically exist in this module. For example, there is no bottom screw. it makes no sense to expect a user to use a non existing bottom screw as the attachment point of the camera's URDF to their rig/robot design. My suggestion is to rewrite this file as a stand-alone and not copy unrelated terms from other cased cameras.
To me, it makes most sense to define the origin as the center of the back plate, on he back surface of it. A user can easily derive it from where they attach the camera to their rig/robot.
|
Rewrote As suggested, the model origin is now the centre of the back panel ( Validated on a Linux box with ROS 2 Humble: |
| <xacro:if value="$(arg add_plug)"> | ||
| <!-- USB-C connector on the bottom edge, board-centred --> | ||
| <xacro:usb_plug parent="${name}_link" name="${name}_usb_plug"> | ||
| <origin xyz="${-d421_cam_depth/2} ${-d421_baseline/2} ${-d421_cam_height/2}" rpy="${M_PI/2} 0 0"/> |
There was a problem hiding this comment.
Don't know if anyone cares, but this is not the location of the usb connector. it is not in the middle of the camera.
There was a problem hiding this comment.
Good catch. The plug was board-centred as a placeholder and only rendered when add_plug:=true (off by default). Rather than ship a wrong location, I removed the usb_plug block entirely (also dropped the now-unused add_plug arg and _usb_plug include).
✅ Fixed in 66f4938.
🤖 Generated by AI
| <!-- camera_link at the depth origin (left imager, front face): forward from | ||
| the back-panel centre by the board thickness, and left by half the baseline --> | ||
| <joint name="${name}_link_joint" type="fixed"> | ||
| <origin xyz="${d421_cam_depth} ${d421_baseline/2} 0" rpy="0 0 0"/> |
There was a problem hiding this comment.
Agreed — camera_link should sit at the imager plane, not the front face, so x = d421_cam_depth - z'. Right now it uses the full board thickness (front face). Once you have z' for this module I will update the ${name}_link_joint origin (and the mesh offset if needed) to match. Ping me with the value.
⏸ Deferred — waiting on the module-specific z' offset.
🤖 Generated by AI
There was a problem hiding this comment.
What i've been told is that since D421 module doesn't have a stiffener then z' = 0.
It means the current calculation is accurate.

Overview: Adds a URDF model and visual mesh for the RealSense Depth Module D421 to
realsense2_description, so the D421 can be visualized/simulated in ROS 2 like the other D4xx devices.Jira: RSDSO-21561
Changes
urdf/_d421.urdf.xacro— stand-alonesensor_d421macro. The D421 is a bare single-board module (no enclosure, no cover glass, no tripod/bottom screw), so it does not reuse the cased-camera terms. Dual IR imagers + IR projector, no RGB/IMU; 50 mm baseline; dimensions 95 × 32 × 10.18 mm; mass 0.0375 kg.urdf/test_d421_camera.urdf.xacro— standalone test wrapper (auto-discovered byview_model.launch.py).meshes/d421.stl— visual mesh of the flat board (two imagers + projector).No
CMakeLists.txt/launch changes needed —urdf/andmeshes/are glob-installed and the view launcher auto-lists anytest_*.urdf.xacro.Frames
camera_mount_frame— model origin, the centre of the back panel (back surface). A module is fastened flat against the user's rig, so this is the natural, physically-locatable attachment point.camera_link—camera_link/depth origin at the centre of the left (infra1) imager on the front face, derived from the mount frame (forward by the board thickness, left by half the baseline). The ROS driver anchors its TF tree here, so it must stay on the left imager.infra2sits one 50 mm baseline to the right.Data source: D421 Datasheet v1.1 + Leopard LI-DS5-OV9281 mechanical drawing.
Validation (ROS 2 Humble)
xacroprocesses the model cleanly (exit 0), and it loads and renders in rviz2 withcamera_mount_frameas the fixed frame. Frame tree confirmed:camera_mount_frame → camera_link [0.01018, 0.025, 0] → {depth, infra1 @ 0, infra2 @ -0.050}.Render (rviz2)
D421 model in rviz2 — grey board with the two IR imagers and USB-C plug, TF axes with the origin at the back-panel centre:
🤖 Generated by AI