SkinDemoMovebase class. More...
#include <skin_demo_movebase.h>
Classes | |
struct | sensor_data_struct |
Public Member Functions | |
void | publishBaseCommand () |
Publishes base commands. | |
SkinDemoMovebase () | |
Constructor initializes SkinDemoMovebase. | |
virtual | ~SkinDemoMovebase () |
Destructor of SkinDemoMovebase. | |
Private Member Functions | |
void | loadParameterInt (ros::NodeHandle &nh_, std::string param, int &data) |
Loads integer parameter from ROS parameter server. | |
void | loadParameterIntArray (ros::NodeHandle &nh_, std::string param, std::vector< int > &vec) |
Loads integer array parameter from ROS parameter server. | |
void | skinNewMeasCallback (const boost::shared_ptr< skin_driver::skin_meas const > &msg) |
Callback function which is called when new skin message arrives. | |
Private Attributes | |
boost::circular_buffer < geometry_msgs::Twist > | buf_command_ |
ros::NodeHandle | nh_ |
ros::NodeHandle | nh_private_ |
int | num_sensors_ |
std::vector< int > | patches_bw_ |
std::vector< int > | patches_fw_ |
std::vector< int > | patches_left_ |
std::vector< int > | patches_right_ |
std::vector< int > | patches_yawleft_ |
std::vector< int > | patches_yawright_ |
ros::Publisher | pub_cmd_vel_ |
ros::Subscriber | sub_skin_data_ |
SkinDemoMovebase class.
Reads skin messages and drives base in specific direction based on activated sensor patch. Velocity is determined by how close an object is to the skin patch.
Definition at line 50 of file skin_demo_movebase.h.
SkinDemoMovebase::SkinDemoMovebase | ( | ) |
Constructor initializes SkinDemoMovebase.
Initialize buffers, subscribe to skin_data message and register publisher of /base_controller/command message.
Definition at line 40 of file skin_demo_movebase.cpp.
SkinDemoMovebase::~SkinDemoMovebase | ( | ) | [virtual] |
Destructor of SkinDemoMovebase.
Definition at line 62 of file skin_demo_movebase.cpp.
void SkinDemoMovebase::loadParameterInt | ( | ros::NodeHandle & | nh_, | |
std::string | param, | |||
int & | data | |||
) | [private] |
Loads integer parameter from ROS parameter server.
Loads parameter, if parameter not present notifies user and exits.
nh_ | Node Handle to use | |
param | Name of parameter to load | |
data | Contains loaded parameter from server |
Definition at line 296 of file skin_demo_movebase.cpp.
void SkinDemoMovebase::loadParameterIntArray | ( | ros::NodeHandle & | nh_, | |
std::string | param, | |||
std::vector< int > & | vec | |||
) | [private] |
Loads integer array parameter from ROS parameter server.
Loads parameter array, if parameter not present notifies user and exits. Parameter array is returned as std::vector<int>.
nh_ | Node Handle to use | |
param | Name of parameter to load | |
vec | Contains loaded parameter from server |
Definition at line 318 of file skin_demo_movebase.cpp.
void SkinDemoMovebase::publishBaseCommand | ( | ) |
Publishes base commands.
Started by main, publishes base commands. Either command from buffer (where user commands are stored by skinNewMeasCallback) or stop messages with 0 velocity are published.
Definition at line 255 of file skin_demo_movebase.cpp.
void SkinDemoMovebase::skinNewMeasCallback | ( | const boost::shared_ptr< skin_driver::skin_meas const > & | msg | ) | [private] |
Callback function which is called when new skin message arrives.
Converts skin message and generates drive commands which are put in a circular buffer. These commands are read by publishing function.
msg | skin_data message. |
Definition at line 73 of file skin_demo_movebase.cpp.
boost::circular_buffer<geometry_msgs::Twist> SkinDemoMovebase::buf_command_ [private] |
Definition at line 79 of file skin_demo_movebase.h.
ros::NodeHandle SkinDemoMovebase::nh_ [private] |
Definition at line 55 of file skin_demo_movebase.h.
ros::NodeHandle SkinDemoMovebase::nh_private_ [private] |
Definition at line 56 of file skin_demo_movebase.h.
int SkinDemoMovebase::num_sensors_ [private] |
Definition at line 60 of file skin_demo_movebase.h.
std::vector<int> SkinDemoMovebase::patches_bw_ [private] |
Definition at line 62 of file skin_demo_movebase.h.
std::vector<int> SkinDemoMovebase::patches_fw_ [private] |
Definition at line 61 of file skin_demo_movebase.h.
std::vector<int> SkinDemoMovebase::patches_left_ [private] |
Definition at line 64 of file skin_demo_movebase.h.
std::vector<int> SkinDemoMovebase::patches_right_ [private] |
Definition at line 63 of file skin_demo_movebase.h.
std::vector<int> SkinDemoMovebase::patches_yawleft_ [private] |
Definition at line 66 of file skin_demo_movebase.h.
std::vector<int> SkinDemoMovebase::patches_yawright_ [private] |
Definition at line 65 of file skin_demo_movebase.h.
ros::Publisher SkinDemoMovebase::pub_cmd_vel_ [private] |
Definition at line 58 of file skin_demo_movebase.h.
ros::Subscriber SkinDemoMovebase::sub_skin_data_ [private] |
Definition at line 57 of file skin_demo_movebase.h.