Public Member Functions | Private Member Functions | Private Attributes
kobuki::RandomWalkerController Class Reference

#include <random_walker_controller.hpp>

Inheritance diagram for kobuki::RandomWalkerController:
Inheritance graph
[legend]

List of all members.

Public Member Functions

bool init ()
 RandomWalkerController (ros::NodeHandle &nh_priv, std::string &name)
void spin ()
 Publishes velocity commands and triggers the LEDs.
 ~RandomWalkerController ()

Private Member Functions

void bumperEventCB (const kobuki_msgs::BumperEventConstPtr msg)
 Trigger direction change and LED blink, when a bumper is pressed.
void cliffEventCB (const kobuki_msgs::CliffEventConstPtr msg)
 Trigger direction change and LED blink, when a cliff is detected.
void disableCB (const std_msgs::EmptyConstPtr msg)
 ROS logging output for disabling the controller.
void enableCB (const std_msgs::EmptyConstPtr msg)
 ROS logging output for enabling the controller.
void wheelDropEventCB (const kobuki_msgs::WheelDropEventConstPtr msg)
 Trigger stopping and LED blink, when a wheel drop is detected.

Private Attributes

bool bumper_center_pressed_
 Flag for center bumper's state.
ros::Subscriber bumper_event_subscriber_
 Subscribers.
bool bumper_left_pressed_
 Flag for left bumper's state.
bool bumper_right_pressed_
 Flag for right bumper's state.
bool change_direction_
 Flag for changing direction.
bool cliff_center_detected_
 Flag for center cliff sensor's state.
ros::Subscriber cliff_event_subscriber_
bool cliff_left_detected_
 Flag for left cliff sensor's state.
bool cliff_right_detected_
 Flag for right cliff sensor's state.
ros::Publisher cmd_vel_publisher_
 Publishers.
ros::Subscriber disable_controller_subscriber_
ros::Subscriber enable_controller_subscriber_
 Subscribers.
ros::Publisher led1_publisher_
ros::Publisher led2_publisher_
bool led_bumper_on_
 Flag for bumper LED's state.
bool led_cliff_on_
 Flag for cliff sensor LED's state.
bool led_wheel_drop_on_
 Flag for wheel drop sensor LED's state.
std::string name_
 Node(let) name.
ros::NodeHandle nh_priv_
 Private ROS handle.
bool stop_
 Flag for stopping.
bool turning_
 Flag for turning state.
int turning_direction_
 Randomly chosen turning direction.
ros::Duration turning_duration_
 Randomly chosen turning duration.
ros::Time turning_start_
 Start time of turning.
double vel_ang_
 Angular velocity for rotating.
double vel_lin_
 Linear velocity for moving straight.
ros::Subscriber wheel_drop_event_subscriber_
bool wheel_drop_left_detected_
 Flag for left wheel drop sensor's state.
bool wheel_drop_right_detected_
 Flag for right wheel drop sensor's state.

Detailed Description

@ brief A controller implementing a simple random walker algorithm

Controller moves the robot around, changing direction whenever a bumper or cliff event occurs For changing direction random angles are used.

Definition at line 42 of file random_walker_controller.hpp.


Constructor & Destructor Documentation

kobuki::RandomWalkerController::RandomWalkerController ( ros::NodeHandle nh_priv,
std::string &  name 
) [inline]

Definition at line 45 of file random_walker_controller.hpp.

Definition at line 62 of file random_walker_controller.hpp.


Member Function Documentation

void kobuki::RandomWalkerController::bumperEventCB ( const kobuki_msgs::BumperEventConstPtr  msg) [private]

Trigger direction change and LED blink, when a bumper is pressed.

Parameters:
msgbumper event

Definition at line 202 of file random_walker_controller.hpp.

void kobuki::RandomWalkerController::cliffEventCB ( const kobuki_msgs::CliffEventConstPtr  msg) [private]

Trigger direction change and LED blink, when a cliff is detected.

Parameters:
msgcliff event

Definition at line 265 of file random_walker_controller.hpp.

void kobuki::RandomWalkerController::disableCB ( const std_msgs::EmptyConstPtr  msg) [private]

ROS logging output for disabling the controller.

Parameters:
msgincoming topic message

Definition at line 190 of file random_walker_controller.hpp.

void kobuki::RandomWalkerController::enableCB ( const std_msgs::EmptyConstPtr  msg) [private]

ROS logging output for enabling the controller.

Parameters:
msgincoming topic message

Definition at line 178 of file random_walker_controller.hpp.

bool kobuki::RandomWalkerController::init ( ) [inline, virtual]

Set-up necessary publishers/subscribers and initialise time

Returns:
true, if successful

Implements yocs::Controller.

Definition at line 68 of file random_walker_controller.hpp.

Publishes velocity commands and triggers the LEDs.

Reimplemented from yocs::Controller.

Definition at line 379 of file random_walker_controller.hpp.

void kobuki::RandomWalkerController::wheelDropEventCB ( const kobuki_msgs::WheelDropEventConstPtr  msg) [private]

Trigger stopping and LED blink, when a wheel drop is detected.

Parameters:
msgwheel drop event

Definition at line 325 of file random_walker_controller.hpp.


Member Data Documentation

Flag for center bumper's state.

Definition at line 115 of file random_walker_controller.hpp.

Subscribers.

Definition at line 105 of file random_walker_controller.hpp.

Flag for left bumper's state.

Definition at line 113 of file random_walker_controller.hpp.

Flag for right bumper's state.

Definition at line 117 of file random_walker_controller.hpp.

Flag for changing direction.

Definition at line 109 of file random_walker_controller.hpp.

Flag for center cliff sensor's state.

Definition at line 121 of file random_walker_controller.hpp.

Definition at line 105 of file random_walker_controller.hpp.

Flag for left cliff sensor's state.

Definition at line 119 of file random_walker_controller.hpp.

Flag for right cliff sensor's state.

Definition at line 123 of file random_walker_controller.hpp.

Publishers.

Definition at line 107 of file random_walker_controller.hpp.

Definition at line 103 of file random_walker_controller.hpp.

Subscribers.

Definition at line 103 of file random_walker_controller.hpp.

Definition at line 107 of file random_walker_controller.hpp.

Definition at line 107 of file random_walker_controller.hpp.

Flag for bumper LED's state.

Definition at line 129 of file random_walker_controller.hpp.

Flag for cliff sensor LED's state.

Definition at line 131 of file random_walker_controller.hpp.

Flag for wheel drop sensor LED's state.

Definition at line 133 of file random_walker_controller.hpp.

Node(let) name.

Definition at line 101 of file random_walker_controller.hpp.

Private ROS handle.

Definition at line 99 of file random_walker_controller.hpp.

Flag for stopping.

Definition at line 111 of file random_walker_controller.hpp.

Flag for turning state.

Definition at line 145 of file random_walker_controller.hpp.

Randomly chosen turning direction.

Definition at line 141 of file random_walker_controller.hpp.

Randomly chosen turning duration.

Definition at line 139 of file random_walker_controller.hpp.

Start time of turning.

Definition at line 143 of file random_walker_controller.hpp.

Angular velocity for rotating.

Definition at line 137 of file random_walker_controller.hpp.

Linear velocity for moving straight.

Definition at line 135 of file random_walker_controller.hpp.

Definition at line 105 of file random_walker_controller.hpp.

Flag for left wheel drop sensor's state.

Definition at line 125 of file random_walker_controller.hpp.

Flag for right wheel drop sensor's state.

Definition at line 127 of file random_walker_controller.hpp.


The documentation for this class was generated from the following file:


kobuki_random_walker
Author(s): Marcus Liebhardt
autogenerated on Wed Sep 16 2015 04:35:24