This Robotis emanual page describes how to setup the Raspberry Pi camera to be used with Turtlebot3.
Here is a streamlined guide to quickly get a raspi camera working with a TB3. This entire process may take a few minutes - worst case, if you have to fix apt-get errors, upwards of 30 minutes.
sudo raspi-config
in the TB3's terminal. Navigate to option 3: Interfacing options. The first option in the sub-menu is camera - select it, then select yes when prompet to enable camera interfacing. Then, navigate to finish and reboot the robot for the change to take effect.
do a sudo apt-get update
and sudo apt-get upgrade
to make sure there are no errors. If update throws a missing pubkey error, then record the pubkey and use this command: sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <PUBKEY>
where is the pubkey that you recorded. once the pubkey is added, update & upgrade. If there are no errors, continue.
run the following two commands to add Ubiquity Robotic's repos to apt
update & upgrade again.
sudo apt-get install ros-kinetic-raspicam-node
catkin make
if catkin_make fails due to missing diagnostics, install this: sudo apt-get install ros-kinetic-diagnostic-updater
roslaunch turtlebot3_bringup turtlebot3_rpicamera.launch
will launch the camera alone at a resolution of 640x480. Alternatively, you can also use roslaunch raspicam_node camerav1_1280x720.launch
to launch at a higher resolution. To include in a custom launch file, consider using a command like this:
The following parameters can be edited in a launch file that launches the Raspi cam to alter its performance:
enable_raw
: allows the camera to publish a topic ~/image
, of topic type sensor_msgs/Image
if set to true
. If not true, only ~/image/compressed
will publish (which publishes a topic type sensor_msgs/CompressedImage
).
height
and width
: change the resolution of the image.
framerate
: changes the rate at which the camera publishes images (maximum 90 fps). Max FPS is also affected by the resolution (higher resolution -> lower max fps)
rqt_image_view
: opens a gui where you can select an image topic currently being published and view it from your remote PC.
rosrun rqt_reconfigure rqt_reconfigure
: opens a gui which can edit various raspi settings, such as vertical/ horizontal flipping, image stabilization, and other sliders for various settings