User Tools

Site Tools


Writing /var/lib/dokuwiki/data/meta/tutorials/ros_sony_cam.meta failed
tutorials:ros_sony_cam

This is an old revision of the document!


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.

Setup pysony

To setup pysony module, get the pysony repo with:

$ git clone git@github.com:Bloodevil/sony_camera_api.git

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

export PYTHONPATH="${PYTHONPATH}:/<download>/<path>/sony_camera_api/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 git@github.com:arcoslab/ros_sony_cam.git
$ cd ros_sony_cam/
$ catkin_make

Then 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.

$ 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.

tutorials/ros_sony_cam.1573080159.txt.gz · Last modified: 2022/09/20 00:08 (external edit)