41 #ifndef INCLUDE_OKVIS_SUBSCRIBER_HPP_
42 #define INCLUDE_OKVIS_SUBSCRIBER_HPP_
47 #include <boost/shared_ptr.hpp>
48 #pragma GCC diagnostic push
49 #pragma GCC diagnostic ignored "-Wnon-virtual-dtor"
51 #include <image_geometry/pinhole_camera_model.h>
52 #include <dynamic_reconfigure/server.h>
53 #include <okvis_ros/CameraConfig.h>
54 #pragma GCC diagnostic pop
55 #include <image_transport/image_transport.h>
56 #include "sensor_msgs/Imu.h"
57 #pragma GCC diagnostic push
58 #pragma GCC diagnostic ignored "-Woverloaded-virtual"
59 #include <opencv2/opencv.hpp>
60 #pragma GCC diagnostic pop
63 #ifdef HAVE_LIBVISENSOR
64 #include <visensor/visensor_api.hpp>
85 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
109 unsigned int cameraIndex);
114 OKVIS_THROW(Exception,
"Subscriber::depthImageCallback() is not implemented.");
118 void imuCallback(
const sensor_msgs::ImuConstPtr& msg);
124 #ifdef HAVE_LIBVISENSOR
129 void startSensors(
const std::vector<unsigned int>& camRate,
130 const unsigned int imuRate);
133 visensor::ViErrorCode error);
136 visensor::ViErrorCode error);
140 visensor::ViCorner::Ptr corners_ptr);
142 void configCallback(okvis_ros::CameraConfig &config, uint32_t level);
156 #ifdef HAVE_LIBVISENSOR
157 std::shared_ptr<visensor::ViSensorDriver>
sensor_;
Header file for the NCameraSystem class.
Subscriber(ros::NodeHandle &nh, okvis::VioInterface *vioInterfacePtr, const okvis::VioParametersReader ¶m_reader)
Constructor. This will either subscribe to the relevant ROS topics or start up the sensor and registe...
Definition: Subscriber.cpp:56
void imageCallback(const sensor_msgs::ImageConstPtr &msg, unsigned int cameraIndex)
The image callback.
Definition: Subscriber.cpp:105
image_transport::ImageTransport * imgTransport_
The image transporter.
Definition: Subscriber.hpp:150
void directImuCallback(boost::shared_ptr< visensor::ViImuMsg > imu_ptr, visensor::ViErrorCode error)
The IMU callback.
Definition: Subscriber.cpp:198
Header file for the ThreadedKFVio class.
Header file for the Publisher class.
ros::Subscriber subImu_
The IMU message subscriber.
Definition: Subscriber.hpp:152
Header file for the TimeBase, Time and WallTime class.
void imuCallback(const sensor_msgs::ImuConstPtr &msg)
The IMU callback.
Definition: Subscriber.cpp:129
EIGEN_MAKE_ALIGNED_OPERATOR_NEW ~Subscriber()
Definition: Subscriber.cpp:50
void depthImageCallback(const sensor_msgs::ImageConstPtr &, unsigned int)
The depth image callback.
Definition: Subscriber.hpp:112
#define OKVIS_THROW(exceptionType, message)
Definition: assert_macros.hpp:98
void initialiseDriverCallbacks()
Initialise callbacks. Called in constructor.
Definition: Subscriber.cpp:140
void directFrameCallback(visensor::ViFrame::Ptr frame_ptr, visensor::ViErrorCode error)
The image callback.
Definition: Subscriber.cpp:219
ros::NodeHandle * nh_
The node handle.
Definition: Subscriber.hpp:149
#define OKVIS_DEFINE_EXCEPTION(exceptionName, exceptionParent)
Macro for defining an exception with a given parent.
Definition: assert_macros.hpp:52
std::vector< image_transport::Subscriber > imageSubscribers_
The image message subscriber.
Definition: Subscriber.hpp:151
void setNodeHandle(ros::NodeHandle &nh)
Set the node handle. This sets up the callbacks. This is called in the constructor.
Definition: Subscriber.cpp:82
This file contains some useful assert macros.
void directFrameCornerCallback(visensor::ViFrame::Ptr frame_ptr, visensor::ViCorner::Ptr corners_ptr)
The callback for images including detected corners.
Definition: Subscriber.cpp:269
Header file for the VioParametersReader class.
Struct to combine all parameters and settings.
Definition: Parameters.hpp:280
okvis::VioInterface * vioInterface_
The VioInterface. (E.g. ThreadedKFVio)
Definition: Subscriber.hpp:161
void startSensors(const std::vector< unsigned int > &camRate, const unsigned int imuRate)
Start up sensor.
Definition: Subscriber.cpp:174
An abstract base class for interfaces between Front- and Backend.
Definition: VioInterface.hpp:66
Header file for the VioInterface class.
This class handles all the buffering of incoming data.
Definition: Subscriber.hpp:82
void configCallback(okvis_ros::CameraConfig &config, uint32_t level)
Dynamic reconfigure callback.
Definition: Subscriber.cpp:277
dynamic_reconfigure::Server< okvis_ros::CameraConfig > cameraConfigReconfigureService_
dynamic reconfigure service.
Definition: Subscriber.hpp:158
std::shared_ptr< visensor::ViSensorDriver > sensor_
The sensor API.
Definition: Subscriber.hpp:157
okvis::VioParameters vioParameters_
The parameters and settings.
Definition: Subscriber.hpp:162
This class reads and parses config file.
Definition: VioParametersReader.hpp:60