ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can also use a normal USB camera along with a ROS Driver like cv_camera
. To install it, run this in your terminal:
sudo apt update
sudo apt install ros-[YOUR-ROS-DISTRO]-cv-camera
Once you have this installed in your TurtleBot3, you can plug it in a USB port and test it running this node:
source /opt/ros/[YOUR-ROS-DISTRO]/setup.bash
rosrun cv_camera cv_camera_node
If it works, then create a launch file for the node and also a static transform publisher from base_link
to camera_link
, indicating the approximate distance to where you end up placing your camera. The file would look something like this:
<launch>
<node pkg="cv_camera" type="cv_camera_node" name="cv_camera" output="screen"/>
<node pkg="tf" type="static_transform_publisher" name="camera_frames_pub" args="0.05 0.0 0.1 0 0 0 /base_link /camera 35"/>
</launch>
If you want a step-by-step walk through of the instructions above, you can check out this video I made: https://www.youtube.com/watch?v=hH6ov9Ep134&ab_channel=TheConstruct