Repository navigation
Closed
Description
Goal
Work with a camera in the simulation (object detection #40, visual SLAM #20, student applications) before the real robot has one. The camera is temporary and simulation-only: the model of the real robot does not change.
Current state
camera.xacroexists:camera_linkon the front of the body, the optical framecamera_rgb_frame, a Gazebocamerasensor (1920×1080, 30 Hz, Gaussian noise) publishingcamera/image_rawandcamera/camera_info.- It is not used: the include in
robot.urdf.xacrois commented out. gz_bridge.yamlbridges onlyclock,scanand the IMU, no camera topics.
What to do
- Switchable camera. A xacro argument
camera(defaultfalse) includescamera.xacro.sim.launch.pygets a launch argumentcamera(defaulttrue) and passes it to xacro.robot.launch.py/hw.launch.pydo not enable it, sorobot_descriptionand TF of the real robot stay as they are. A separate argument, notsim_mode: when a real camera is mounted, it is enabled on the robot the same way. - Sensor settings. 1920×1080 at 30 Hz is heavy for the simulation and for DDS (see the latency in Resolve camera image transmission latency #32). Defaults like 640×480 at 15–30 Hz, with resolution and rate as xacro properties. Keep the noise.
- Mount pose as parameters. The position is now
${base_x_size/2} 0 ${base_z_size}, andbase_z_sizeis not the body height (see Review the URDF dimensions against the real robot #55). Make x/y/z/pitch xacro properties next to the other dimensions, with a comment that it is a temporary mount until the real camera is chosen. - Bridge. Image through
ros_gz_image(image_bridge, givesimage_transport, e.g. compressed images),camera_infothrough the parameter bridge. Topics/camera/image_raw,/camera/camera_info,frame_id= the optical frame (REP 103: z forward, x right, y down). - RViz. An Image display of
/camera/image_rawin the RViz config of the simulation (may be disabled by default). - Docs. README: the camera topics and
camera:=falsein Simulation on a PC.
Done when
ros2 launch kpi_rover_bringup sim.launch.pypublishes/camera/image_rawand/camera/camera_infoat the configured rate (ros2 topic hz), the image is upright and looks forward in RViz, the TF of the optical frame is correct (an object in front of the robot is in the centre of the image).sim.launch.py camera:=falsegives the model without the camera.robot_descriptionofrobot.launch.pydoes not containcamera_link(check withxacro ... | grep camera).- The real time factor in
warehousewith the camera stays close to the one without it (state both numbers in the PR).
Related
#40 Object detection, #20 Visual SLAM, #55 URDF dimensions, #32 camera image latency.
Metadata
Metadata
Assignees
Labels
No labels
Activity
feat(sim): add a temporary camera to the simulated robot
feat(sim): add a temporary camera to the simulated robot