Show EOL distros: 

axis_camera

Package Summary

Contains basic Python drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.

axis_camera

Package Summary

Python ROS drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.

Package Summary

Python ROS drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.

Package Summary

Python ROS drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.

Package Summary

Python ROS drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.

Package Summary

Python ROS drivers for accessing an Axis camera's MJPG stream. Also provides control for PTZ cameras.

ROS camera driver for Axis network cameras.

This driver is under active development. Its interfaces are relatively stable, but may still change.

Report a Bug

https://github.com/clearpathrobotics/axis_camera/issues

ROS API

Parameters are resolved starting with the driver's private namespace. If desired, they may be defined in some containing namespace. That is useful for sharing parameters with the axis_ptz node.

Examples

The roscore must already be running before any of these example commands.

While you can run the driver in the ROS root namespace, the image pipeline prefers running each camera in its own subordinate namespace. These examples use the axis namespace. With multiple cameras, use something unique to the device, like the camera name.

Running the Driver

Pass the network host name and password of the camera on the command line, assuming the default username ("root"). This example uses the zeroconf local mDNS address, alternatively one could provide the static IP address for which the camera is configured.

 $ export ROS_NAMESPACE=axis
 $ rosrun axis_camera axis.py _hostname:=axis-00408c8ae301.local _password:=xxxxxxxx

This publishes two topics: /axis/camera_info and /axis/image_raw/compressed.

Viewing the Raw Image

To see the raw image, run image_view in another terminal this way:

 $ rosrun image_view image_view image:=/axis/image_raw _image_transport:=compressed

The _image_transport parameter is necessary, because the camera is actually publishing a motion JPEG stream, via the ROS sensor_msgs/CompressedImage message.

Rectifying the Image

Wide-angle network camera lenses generally exhibit significant intrinsic distortion. For robotics work, it is very helpful to calibrate each camera and use image_proc to provide rectified output.

Since the driver produces compressed motion JPEG, and image_proc expects raw sensor_msgs/Image data, an extra step is needed to convert the data stream:

 $ export ROS_NAMESPACE=axis
 $ rosrun image_transport republish compressed in:=image_raw raw out:=image_raw

After that, open another terminal and run image_proc in the usual way:

 $ ROS_NAMESPACE=axis rosrun image_proc image_proc

If you know how to run image_proc directly on the compressed image stream, please open a defect ticket with the driver to correct this documentation.

Viewing Rectified Images

To see the rectified color image, run image_view in another terminal this way:

 $ rosrun image_view image_view image:=/axis/image_rect_color

The _image_transport parameter is not needed in this case, because image_proc publishes its output using image_transport.

Calibrating the Camera

To calibrate an Axis network camera, run the driver as shown above:

 $ export ROS_NAMESPACE=axis
 $ rosrun axis_camera axis.py _hostname:=axis-00408c8ae301.local _password:=xxxxxxxx

In another terminal, republish the images compressed images in raw format:

 $ export ROS_NAMESPACE=axis
 $ rosrun image_transport republish compressed in:=image_raw raw out:=image_raw

Then, in a third terminal, run camera_calibration:

 $ rosrun camera_calibration cameracalibrator.py --size 8x6 --square 0.108 \
          image:=/axis/image_raw camera:=/axis

Then, follow the instructions in the Monocular Camera Calibration tutorial.

The resulting calibration parameters will be stored in file://${ROS_HOME}/camera_info/${NAME}.yaml, which resolves to ~/.ros/camera_info/axis_00408c8ae301_local.yaml in this example (assuming $ROS_HOME points to the default ~/.ros directory). The next time the driver runs on the same machine it should automatically pick up the existing calibration information in that same location.

You can store the calibration elsewhere by setting ~camera_info_url appropriately for the driver. For example, to store it in a package named my_calibrations, append this to the driver's argument list:

_camera_info_url:=package://my_calibrations/info/${NAME}.yaml

See camera_info_manager_py for details.

Using the PTZ node

In order to use the PTZ node you need to enable anonymous PTZ control login in

http://IP_ADDRESS_OF_YOUR_CAMERA -> Setup -> Basic Setup -> Users

After that run

rosrun axis_camera axis_ptz.py _hostname:=IP_ADDRESS_OF_YOUR_CAMERA

Wiki: axis_camera (last edited 2018-05-25 14:22:23 by TonyBaltovski)