InFeeo
Language

Tag Chaser v2 — world-frame trajectory in RViz2, jitter and all(reddit.com)

×
Link preview Tag Chaser v2 — world-frame trajectory in RViz2, jitter and all v1 post here if you want the background. Where v2 is now The big addition in v2 is a world-frame coordinate system and live trajectory visualization in RViz2. The robot now runs two AprilTags simultaneously: tag0 is the chase target, tag1 is physically fixed to the wall and acts as the world anchor. A ROS2 node on Ubuntu (tf_bridge) connects to the Pi over WebSocket, ingests raw camera-frame poses, and computes a floor-anchored world frame on first tag1 detection. World origin is the floor point directly below the camera. From there it publishes /trajectory/car and /trajectory/tag0 as LINE_STRIP markers to RViz2, and writes per-cycle PLY point clouds for inspection in MeshLab. The URDF visualization is also live — a picar_description ROS2 package provides a tracking URDF anchored to the camera TF frame, so the robot mesh follows its world-frame position in RViz2 in real time. Manual Track mode lets me drive with WASD while tag detection and TF publishing run in the background, which is what the video shows. What the video shows Split view: dashboard on the right, RViz2 on the left. I'm driving forward with keyboard controls. You can see the trajectory building in RViz2 as the robot moves — and you can also clearly see the problem: the path is a zig-zag even when the motion is roughly straight. That's not wheel slip or steering noise. That's measurement noise from the AprilTag pose solver, visualized honestly. The jitter problem The zig-zags are real and understood. Root cause is AprilTag PnP pose ambiguity — the solver has two valid solutions for a planar tag and flips between them frame to frame. One axis swings ±15cm per frame while the robot is stationary. On top of that, a small angular error in the tag1 pose gets amplified into position noise in world frame: at ~74cm tag distance, a 5° rotation error becomes ~6.5cm of position error. Every raw frame goes straight to TF with no filtering, so one bad frame is a spike on the trajectory. What's next Two things need fixing before the trajectory is useful: Fix the world frame geometry. The current floor-anchoring logic and world frame initialization are approximate. Tag1 needs to be treated more carefully — its pose relative to the world origin needs to be stable across the session, not just initialized once and held. Add a noise filter. An EWMA filter with a velocity gate in _process_frame would reject the frame-to-frame pose flips without introducing lag on real motion. This was prototyped and tested during the v2 session but pulled out to keep the debrief clean — it's the next thing going in. Once those two are solid the trajectory should be smooth enough to actually reason about where the robot has been. Stack: Raspberry Pi 4B · PiCar-X v2.0 · Picamera2 · pupil-apriltags · FastAPI · ROS2 Humble · Python 3.13 References Post history v1 tag chaser PiCar-X introduction Hardware / code PiCar-X on Amazon Git repo submitted by /u/okineedaplan [link] [Kommentare] reddit.com · reddit.com
v1 post here if you want the background. Where v2 is now The big addition in v2 is a world-frame coordinate system and live trajectory visualization in RViz2. The robot now runs two AprilTags simultaneously: tag0 is the chase target, tag1 is physically fixed to the wall and acts as the world anchor. A ROS2 node on Ubuntu (tf_bridge) connects to the Pi over WebSocket, ingests raw camera-frame poses, and computes a floor-anchored world frame on first tag1 detection. World origin is the floor point directly below the camera. From there it publishes /trajectory/car and /trajectory/tag0 as LINE_STRIP markers to RViz2, and writes per-cycle PLY point clouds for inspection in MeshLab. The URDF visualization is also live — a picar_description ROS2 package provides a tracking URDF anchored to the camera TF frame, so the robot mesh follows its world-frame position in RViz2 in real time. Manual Track mode lets me drive with WASD while tag detection and TF publishing run in the background, which is what the video shows. What the video shows Split view: dashboard on the right, RViz2 on the left. I'm driving forward with keyboard controls. You can see the trajectory building in RViz2 as the robot moves — and you can also clearly see the problem: the path is a zig-zag even when the motion is roughly straight. That's not wheel slip or steering noise. That's measurement noise from the AprilTag pose solver, visualized honestly. The jitter problem The zig-zags are real and understood. Root cause is AprilTag PnP pose ambiguity — the solver has two valid solutions for a planar tag and flips between them frame to frame. One axis swings ±15cm per frame while the robot is stationary. On top of that, a small angular error in the tag1 pose gets amplified into position noise in world frame: at ~74cm tag distance, a 5° rotation error becomes ~6.5cm of position error. Every raw frame goes straight to TF with no filtering, so one bad frame is a spike on the trajectory. What's next Two things need fixing before the trajectory is useful: Fix the world frame geometry. The current floor-anchoring logic and world frame initialization are approximate. Tag1 needs to be treated more carefully — its pose relative to the world origin needs to be stable across the session, not just initialized once and held. Add a noise filter. An EWMA filter with a velocity gate in _process_frame would reject the frame-to-frame pose flips without introducing lag on real motion. This was prototyped and tested during the v2 session but pulled out to keep the debrief clean — it's the next thing going in. Once those two are solid the trajectory should be smooth enough to actually reason about where the robot has been. Stack: Raspberry Pi 4B · PiCar-X v2.0 · Picamera2 · pupil-apriltags · FastAPI · ROS2 Humble · Python 3.13 References Post history v1 tag chaser PiCar-X introduction Hardware / code PiCar-X on Amazon Git repo submitted by /u/okineedaplan [link] [Kommentare]

Log in Log in to comment.

No comments yet.