test_component.hpp
Go to the documentation of this file.
00001 /*********************************************************************
00002  *
00003  *  Copyright (c) 2015, Intermodalics BVBA
00004  *  All rights reserved.
00005  *
00006  *********************************************************************/
00007 
00008 #ifndef RTT_DYNAMIC_RECONFIGURE_TESTS_TEST_COMPONENT_HPP
00009 #define RTT_DYNAMIC_RECONFIGURE_TESTS_TEST_COMPONENT_HPP
00010 
00011 #include <rtt/TaskContext.hpp>
00012 #include <geometry_msgs/Vector3.h>
00013 
00014 struct Properties {
00015     Properties()
00016     : int_param()
00017     , double_param()
00018     , str_param()
00019     , bool_param()
00020     , float_param()
00021     , uint_param()
00022     , bag_param()
00023     , str_param_in_bag()
00024     , vector3_param()
00025     {}
00026 
00027     int int_param;
00028     double double_param;
00029     std::string str_param;
00030     bool bool_param;
00031 
00032     // other property types
00033     float float_param;
00034     unsigned int uint_param;
00035 
00036     // PropertyBag properties
00037     RTT::PropertyBag bag_param;
00038     std::string str_param_in_bag;
00039 
00040     // composable properties
00041     geometry_msgs::Vector3 vector3_param;
00042 };
00043 
00044 class DynamicReconfigureTestComponent : public RTT::TaskContext
00045 {
00046 public:
00047     Properties props;
00048 
00049     // types directly supported by dynamic_reconfigure
00050     DynamicReconfigureTestComponent(const std::string &name = "component")
00051         : RTT::TaskContext(name)
00052     {
00053         this->addProperty("int_param", props.int_param);
00054         this->addProperty("double_param", props.double_param);
00055         this->addProperty("str_param", props.str_param);
00056         this->addProperty("bool_param", props.bool_param);
00057 
00058         this->addProperty("float_param", props.float_param);
00059         this->addProperty("uint_param", props.uint_param);
00060 
00061         props.bag_param.addProperty("str_param", props.str_param_in_bag);
00062         this->addProperty("bag_param", props.bag_param);
00063 
00064         props.vector3_param.x = 1.0;
00065         props.vector3_param.y = 2.0;
00066         props.vector3_param.z = 3.0;
00067         this->addProperty("vector3_param", props.vector3_param);
00068     }
00069 };
00070 
00071 #endif // RTT_DYNAMIC_RECONFIGURE_TESTS_TEST_COMPONENT_HPP


rtt_dynamic_reconfigure_tests
Author(s): Johannes Meyer
autogenerated on Wed Sep 16 2015 07:00:23