reconfigure.h
Go to the documentation of this file.
00001 
00034 #ifndef MULTISENSE_ROS_RECONFIGURE_H
00035 #define MULTISENSE_ROS_RECONFIGURE_H
00036 
00037 #include <boost/shared_ptr.hpp>
00038 #include <boost/thread.hpp>
00039 #include <ros/ros.h>
00040 
00041 #include <multisense_lib/MultiSenseChannel.hh>
00042 
00043 #include <dynamic_reconfigure/server.h>
00044 #include <multisense_ros/sl_bm_cmv2000Config.h>
00045 #include <multisense_ros/sl_bm_cmv2000_imuConfig.h>
00046 #include <multisense_ros/sl_bm_cmv4000Config.h>
00047 #include <multisense_ros/sl_bm_cmv4000_imuConfig.h>
00048 #include <multisense_ros/sl_sgm_cmv2000_imuConfig.h>
00049 #include <multisense_ros/sl_sgm_cmv4000_imuConfig.h>
00050 #include <multisense_ros/bcam_imx104Config.h>
00051 #include <multisense_ros/st21_sgm_vga_imuConfig.h>
00052 #include <multisense_ros/mono_cmv2000Config.h>
00053 #include <multisense_ros/mono_cmv4000Config.h>
00054 
00055 namespace multisense_ros {
00056 
00057 class Reconfigure {
00058 public:
00059 
00060     Reconfigure(crl::multisense::Channel* driver,
00061                 boost::function<void ()> resolutionChangeCallback=0,
00062                 boost::function<void (int, int)> borderClipChangeCallback=0);
00063 
00064     ~Reconfigure();
00065 
00066     void imuCallback(const crl::multisense::imu::Header& header);
00067 
00068 private:
00069 
00070     //
00071     // Dynamic reconfigure callback variations
00072 
00073     void callback_sl_bm_cmv2000     (multisense_ros::sl_bm_cmv2000Config&      config, uint32_t level);
00074     void callback_sl_bm_cmv2000_imu (multisense_ros::sl_bm_cmv2000_imuConfig&  config, uint32_t level);
00075     void callback_sl_bm_cmv4000     (multisense_ros::sl_bm_cmv4000Config&      config, uint32_t level);
00076     void callback_sl_bm_cmv4000_imu (multisense_ros::sl_bm_cmv4000_imuConfig&  config, uint32_t level);
00077     void callback_sl_sgm_cmv2000_imu(multisense_ros::sl_sgm_cmv2000_imuConfig& config, uint32_t level);
00078     void callback_sl_sgm_cmv4000_imu(multisense_ros::sl_sgm_cmv4000_imuConfig& config, uint32_t level);
00079     void callback_bcam_imx104       (multisense_ros::bcam_imx104Config&        config, uint32_t level);
00080     void callback_st21_vga          (multisense_ros::st21_sgm_vga_imuConfig&   config, uint32_t level);
00081     void callback_mono_cmv2000      (multisense_ros::mono_cmv2000Config&       config, uint32_t level);
00082     void callback_mono_cmv4000      (multisense_ros::mono_cmv4000Config&       config, uint32_t level);
00083 
00084     //
00085     // Internal helper functions
00086 
00087     bool changeResolution(crl::multisense::image::Config& cfg,
00088                           int32_t width, int32_t height, int32_t disparities);
00089     template<class T> void configureSgm(crl::multisense::image::Config& cfg, const T& dyn);
00090     template<class T> void configureCamera(crl::multisense::image::Config& cfg, const T& dyn);
00091     template<class T> void configureCropMode(crl::multisense::image::Config& cfg, const T& dyn);
00092     template<class T> void configureImu(const T& dyn);
00093     template<class T> void configureBorderClip(const T& dyn);
00094 
00095     //
00096     // CRL sensor API
00097 
00098     crl::multisense::Channel* driver_;
00099 
00100     //
00101     // Resolution change callback
00102 
00103     boost::function<void ()> resolution_change_callback_;
00104 
00105     //
00106     // Driver nodes
00107 
00108     ros::NodeHandle device_nh_;
00109 
00110     //
00111     // Cached modes from the sensor
00112 
00113     std::vector<crl::multisense::system::DeviceMode> device_modes_;
00114     uint32_t                                         imu_samples_per_message_;
00115     std::vector<crl::multisense::imu::Config>        imu_configs_;
00116 
00117     //
00118     // Dynamic reconfigure server variations
00119 
00120     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::sl_bm_cmv2000Config> >      server_sl_bm_cmv2000_;
00121     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::sl_bm_cmv2000_imuConfig> >  server_sl_bm_cmv2000_imu_;
00122     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::sl_bm_cmv4000Config> >      server_sl_bm_cmv4000_;
00123     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::sl_bm_cmv4000_imuConfig> >  server_sl_bm_cmv4000_imu_;
00124     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::sl_sgm_cmv2000_imuConfig> > server_sl_sgm_cmv2000_imu_;
00125     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::sl_sgm_cmv4000_imuConfig> > server_sl_sgm_cmv4000_imu_;
00126     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::bcam_imx104Config> >        server_bcam_imx104_;
00127     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::st21_sgm_vga_imuConfig> >   server_st21_vga_;
00128     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::mono_cmv2000Config> >       server_mono_cmv2000_;
00129     boost::shared_ptr< dynamic_reconfigure::Server<multisense_ros::mono_cmv4000Config> >       server_mono_cmv4000_;
00130 
00131     //
00132     // Cached values for supported sub-systems (these may be unavailable on
00133     // certain hardware variations: S7, S7S, M, etc.)
00134 
00135     bool lighting_supported_;
00136     bool motor_supported_;
00137     bool crop_mode_changed_;
00138 
00139     //
00140     // Cached value for the boarder clip. These are used to determine if we
00141     // should regenerate our border clipping mask
00142 
00143     enum clip_ {RECTANGULAR, CIRCULAR};
00144 
00145     int border_clip_type_;
00146     double border_clip_value_;
00147 
00148     //
00149     // Border clip change callback
00150 
00151     boost::function<void (int, int)> border_clip_change_callback_;
00152 };
00153 
00154 } // multisense_ros
00155 
00156 #endif


multisense_ros
Author(s):
autogenerated on Fri Apr 5 2019 02:28:29