dvrk_virtual_camera provides a ROS 2 virtual camera for dVRK models. The
node renders an offscreen Ogre/RViz scene from robot descriptions and TF, then
publishes a sensor_msgs/Image and matching sensor_msgs/CameraInfo.
The package assumes ROS 2 only.
The virtual camera node runs independently of RViz. It uses the same Ogre/RViz rendering infrastructure, but it does not capture an existing RViz window.
Expected inputs:
- TF for the dVRK model links
- robot descriptions on topics such as:
/SUJ/robot_description/ECM/robot_description/PSM1/robot_description/PSM2/robot_description/PSM3/robot_description
Published outputs:
/ECM/virtual_camera/image_raw/ECM/virtual_camera/camera_info
The launch file mounts a virtual camera frame to the ECM tip by publishing a
static transform from parent_frame to camera_frame. By default:
parent_frame:ECM_end_linkcamera_frame:ECM_virtual_camera- virtual camera view direction:
+Zofcamera_frame
From the workspace root:
colcon build --packages-select dvrk_virtual_cameraThen source the workspace:
source install/setup.bashIf the dVRK system, robot state publishers, TF, and robot description topics are already running:
ros2 launch dvrk_virtual_camera ecm_virtual_camera.launch.pyThis starts the virtual camera node and image_view. To start only the node:
ros2 launch dvrk_virtual_camera ecm_virtual_camera.launch.py start_image_view:=falseTo view the image manually:
ros2 run image_view image_view --ros-args -r image:=/ECM/virtual_camera/image_rawwidth: image width in pixels, default1280height: image height in pixels, default720rate: image publication rate in Hz, default15.0fov_y: vertical field of view in radians, default0.9fixed_frame: fixed render frame, defaultworldparent_frame: frame the virtual camera is mounted to, defaultECM_end_linkcamera_frame: published virtual camera frame, defaultECM_virtual_cameraimage_topic: image output topic, default/ECM/virtual_camera/image_rawcamera_info_topic: camera info output topic, default/ECM/virtual_camera/camera_infocamera_x,camera_y,camera_z: camera offset fromparent_frame, in meterscamera_roll,camera_pitch,camera_yaw: camera orientation fromparent_frame, in radiansstart_image_view: startimage_view, defaulttrue
The renderer needs a working OpenGL/display context, even though RViz itself does not need to be running.
At the moment, the node renders geometry loaded from the configured robot description topics. It does not render arbitrary RViz displays such as markers, point clouds, or overlays from another RViz session.