# Installation

## ROS

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

Install ROS, see: http://wiki.ros.org/indigo/Installation/Ubuntu

Then set up the ROS environment, see: http://wiki.ros.org/ROS/Tutorials/InstallingandConfiguringROSEnvironment

You may also need to install:

ros-<distro>-image-transport-plugins
ros-<distro>-image-view

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 https://gitlab.com/lrodriguez17/temporary-sony-cam.git 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.

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

$git clone https://gitlab.com/arcoslab/ros_sony_cam.git 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

### Run

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:

upYSP36a

Or:

VuUU17dp
$roslaunch sony_cam pic_liveview_test.launch ### Debugging* 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 sony_cam_node.py 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 client_test.py node, which instructs the main node to take HD pictures.

$rosrun sony_cam client_test.py Then launch another image_view instance, to visualize the HD pictures: $ rosrun image_view image_view image:=/hdpicture _image_transport:=compressed

#### API Reference: sony_cam_node.py

Liveview

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 sony_cam_node.py to set time limit for specific tasks:

  TIMEOUT_TAKEPIC
TIMEOUT_FINDCAM
TIMEOUT_GETLIVEVIEW

Examples

See client_test.py to learn how to use the service image request.

##### Contact

Alexander Marin Drobinoga alexanderm2230@gmail.com

• tutorials/ros_sony_cam.txt