A working installation of ROS must be installed, before building and running this package.

Install ROS, see:

Then set up the ROS environment, see:

You may also need to install:


to visualize images. You can verify the installation with dpkg –get-selections | grep image-view and dpkg –get-selections | grep image-transport-plugins

Setup pysony

To setup pysony module, get the pysony repo with:

$ git clone

Now install pysony with:

pip install pysony

Then add the path of the module to the PYTHONPATH variable, with:

export PYTHONPATH="${PYTHONPATH}:/<download>/<path>/temporary-sony-cam/src"

Append this to the .bashrc file. You can find this file on /home/<your-user>

Note: pysony release 0.1.11, will not work with this program.

Download and build sony_cam package

Use the following commands to get and build the ROS node:

$ git clone

If you use all your packages inside the catkin_ws directory (recommended), use the following command inside catkin_ws:

$ catkin_make

If not:

$ cd ros_sony_cam/
$ catkin_make

If you have not done it in the pass, append the following command to .bashrc file:

source /<full>/<path>/devel/setup.bash

Remember you can find the full path moving to the location of the file and using the command pwd


Connect to camera's wireless access point with the password given on the camera's battery lid and then we may run the launch file, pic_liveview_test, to see the camera's output, liveview (low quality images) and high quality photos. The password must be:



$ roslaunch sony_cam pic_liveview_test.launch


When running with the roslaunch program it is hard to find errors in the setup. We recommend using this method, specially if the Run section didn't worked. You may perform the roslaunch tasks manually.

First, launch roscore:

$ roscore

Then in another terminal, launch main node:

$ rosrun sony_cam

Open another terminal and run the following command to visualize low quality images with the image_view package:

$ rosrun image_view image_view image:=/liveview _image_transport:=compressed

The HD pictures are taken on request basis, so you need to launch the node, which instructs the main node to take HD pictures.

$ rosrun sony_cam

Then launch another image_view instance, to visualize the HD pictures:

$ rosrun image_view image_view image:=/hdpicture _image_transport:=compressed

API Reference:


The camera sends repeatedly, jpeg pictures of low quality, these are published in liveview/compressed topic, as CompressedImage type messages. Take photo

To obtain a high quality picture, make a request to service sony_cam/request_image, with a service of the type GetPolledImage, then the image will be published in hdpicture/compressed topic, as CompressedImage type messages. One service request must be made for every picture. Timeouts

Modify the following constants in to set time limit for specific tasks:



See to learn how to use the service image request.


Alexander Marin Drobinoga

  • tutorials/ros_sony_cam.txt
  • Last modified: 2019/12/11 11:48
  • by lrodriguezp