All Classes Namespaces Files Functions Variables Typedefs Defines
Public Member Functions | Private Member Functions | Private Attributes
virtual_camera::VirtualCameraNodelet Class Reference

#include <VirtualCameraNodelet.hpp>

List of all members.

Public Member Functions

void loop (const ros::TimerEvent &event)
void newCameraCallback (AddRealCameraConstPtr cam)
virtual void onInit ()

Private Member Functions

void addRealCamerasFromParams ()
std::string getNameFromTopic (const std::string &topic)
void handleNewCameraParams (const VirtualCameraParametersPtr &params)
VirtualCameraParametersPtr handleStartupParameters ()
void registerCamerasFromWaitList ()

Private Attributes

ros::Subscriber addCameraSubscriber
std::list< RealCameraPtraddWaitList
VirtualCameraPtr camera
ros::Publisher cameraInfoPublisher
MutexPtr imageSyncMutex
boost::shared_ptr
< image_transport::ImageTransport > 
it
std::string name
ros::NodeHandle nh
std::vector< ros::Subscriber > realCamInfoSubs
RealCameraSynchronizerPtr synchronizer
ros::Timer timer
boost::shared_ptr
< tf::TransformListener > 
transformListener
ros::Subscriber virtCamParamsSubscriber

Detailed Description

The main class of this package. it needs to have the following parameters on the Parameter server available when the nodelet is initialized: name - name of the camera. Used in the topics it produces and frames it creates approxDistance - distance of lookat points of this camera viewportWidth - number of horizontal points viewportHeight - number of vertical points parentFrameId - id of the frame the frame of this camera is placed in posX - x position of the camera in the parent frame posY - y position of the camera in the parent frame posZ - z position of the camera in the parent frame pan - pan of the camera in degrees. Positive corresponds to looking left. tilt - tilt of the camera in degrees. Positive corresponds to looking up. horizontalFov - Field of view in horizontal direction in degrees. verticalFov - Field of view in vertical direction in degrees. frameRate - interval for updating the images in seconds. encoding - encoding of the resulting image (bgr8, mono8). model - Camera model. Possible values: pinhole, cylindric, spherical. If the value is invalid then the pinhole camera model is used. synchronize - whether to compose images only when the source timestamps are the same

Via the next parameters you initialize the virtual camera with its sources (real cameras, but can be anything that has camera like interface). The parameters are ordered in the ascending order. Index starts from 1. If the next index is not found no other sources are loaded. realCameraTopic1 - path to the topic the source publishes on. Path is relative to the nodelet manager. This name is just a mask. It can be sourceTopic1, sourceTopic2 etc.. realCameraFrame1 - (optional) Name of the corresponding tf frame to the source specified in the previous parameter. If not specified the same rules as in AddRealCamera.msg are applied.

Author:
Jan Brabec

Definition at line 67 of file VirtualCameraNodelet.hpp.


Member Function Documentation

Loads needed information for real cameras from parameter server.

Definition at line 38 of file VirtualCameraNodelet.cpp.

std::string virtual_camera::VirtualCameraNodelet::getNameFromTopic ( const std::string &  topic) [private]

Gets the camera name from the topic string.

Parameters:
std::stringtopic
Returns:
std::string

Definition at line 70 of file VirtualCameraNodelet.cpp.

Basically a hook before new virtual camera parameters arrive. Most of the job is delegated to the VirtualCamera object but there may be some work that needs to be done at this level.

Definition at line 31 of file VirtualCameraNodelet.cpp.

Creates the parameters object which is passed to the VirtualCamera. Data are obtained from the parameter server.

Returns:
VirtualCameraParametersPtr

Definition at line 5 of file VirtualCameraNodelet.cpp.

void virtual_camera::VirtualCameraNodelet::loop ( const ros::TimerEvent &  event)

Message loop of this nodelet

Parameters:
constros::TimerEvent& event

Definition at line 79 of file VirtualCameraNodelet.cpp.

Callback for adding new camera via the message. Creates new RealCamera instance and registers it everywhere it is needed.

Parameters:
AddRealCameraConstPtrcam

Definition at line 94 of file VirtualCameraNodelet.cpp.

The startup point of this nodelet

Definition at line 113 of file VirtualCameraNodelet.cpp.

Takes cameras from the addWaitList and tries to register them to the virtual camera.

Definition at line 53 of file VirtualCameraNodelet.cpp.


Member Data Documentation

Definition at line 76 of file VirtualCameraNodelet.hpp.

Cameras need some time to generate their tf trees and also receive camera info before they are added to the virtual camera.

Definition at line 86 of file VirtualCameraNodelet.hpp.

Definition at line 72 of file VirtualCameraNodelet.hpp.

Definition at line 73 of file VirtualCameraNodelet.hpp.

Definition at line 79 of file VirtualCameraNodelet.hpp.

boost::shared_ptr<image_transport::ImageTransport> virtual_camera::VirtualCameraNodelet::it [private]

Definition at line 70 of file VirtualCameraNodelet.hpp.

Definition at line 71 of file VirtualCameraNodelet.hpp.

ros::NodeHandle virtual_camera::VirtualCameraNodelet::nh [private]

Definition at line 69 of file VirtualCameraNodelet.hpp.

std::vector<ros::Subscriber> virtual_camera::VirtualCameraNodelet::realCamInfoSubs [private]

Definition at line 77 of file VirtualCameraNodelet.hpp.

Definition at line 78 of file VirtualCameraNodelet.hpp.

Definition at line 74 of file VirtualCameraNodelet.hpp.

boost::shared_ptr<tf::TransformListener> virtual_camera::VirtualCameraNodelet::transformListener [private]

Definition at line 80 of file VirtualCameraNodelet.hpp.

Definition at line 75 of file VirtualCameraNodelet.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Defines


virtual_camera
Author(s): Jan Brabec; maintained by Tomas Petricek / petrito1@cmp.felk.cvut
autogenerated on Tue Dec 10 2013 14:58:12