ros_plugin_demo
Demonstration of the ROS PlugInLib
|
Contain the Interface . More...
#include <path_planner.hpp>
Public Member Functions | |
void | initialize (ros::NodeHandle roshandle) |
Initalize the global variables. More... | |
double | getYawFromQuat (geometry_msgs::Quaternion quat) |
convert a quaternion into yaw More... | |
void | tfFrameFromPoseStamped (geometry_msgs::PoseStamped *pose, tf::Transform *tf_tf) |
build a tf-frame for a given pose More... | |
int | setPoints (geometry_msgs::Pose2D *start, geometry_msgs::Pose2D *target) |
replace the current start and target poses and call getPath() More... | |
int | getPoints (geometry_msgs::Pose2D *start, geometry_msgs::Pose2D *target) |
returns the current start and target poses More... | |
virtual | ~PathPlanner () |
Intentionally left empty. | |
Protected Member Functions | |
PathPlanner () | |
initialize init | |
virtual int | onInit (ros::NodeHandle roshandle) |
In this function the plugIn can do some initialisation depending on a ROS NodeHandle. More... | |
virtual int | getPath ()=0 |
calculate current_path from start and target inside a plugIn. More... | |
void | setPose2d (geometry_msgs::PoseStamped *pose3d, double x, double y, double theta) |
convert a given 2D-Pose into 3D-Stamped-Pose. More... | |
Protected Attributes | |
bool | init |
true if initialized. More... | |
geometry_msgs::PoseStamped | start |
starting pose of the path | |
geometry_msgs::PoseStamped | target |
last pose of the path | |
nav_msgs::Path | current_path |
contain the path | |
Private Member Functions | |
void | getTargetCallback (const geometry_msgs::PoseStamped event) |
receives a new target pose and call getPath(). More... | |
void | sendPathCallback (const ros::TimerEvent &event) |
call sendPath() More... | |
void | getStarttCallback (const geometry_msgs::Pose2D event) |
receives a new start pose and call getPath(). More... | |
void | sendPath () |
publish current_path and the start_tf and target_tf frames | |
Private Attributes | |
ros::Subscriber | getTargetSub |
listen for a new target pose | |
ros::Subscriber | getStartSub |
listen for a new start pose | |
ros::Publisher | pathPub |
send the path calculated by the plugIn | |
ros::Timer | sendPathTimer |
periodic calling of the path publisher | |
tf::Transform | start_tf |
the start tf-frame | |
tf::Transform | target_tf |
the target tf-frame | |
tf::TransformBroadcaster | tf_br |
send tf-transforms | |
Contain the Interface .
Serve some mutual functions for all inherited plugIns.
Definition at line 23 of file path_planner.hpp.
|
protectedpure virtual |
calculate current_path from start and target inside a plugIn.
Implemented in plugin_demo_plugins_namespace::Direct, and plugin_demo_plugins_namespace::DirectOrtho.
int plugin_demo_interface_namespace::PathPlanner::getPoints | ( | geometry_msgs::Pose2D * | start, |
geometry_msgs::Pose2D * | target | ||
) |
returns the current start and target poses
start | current start pose |
target | current target pose |
Definition at line 76 of file path_planner.cpp.
|
private |
receives a new start pose and call getPath().
event | a pose message from the main part of this demo |
Definition at line 107 of file path_planner.cpp.
|
private |
receives a new target pose and call getPath().
event | a pose message from rViz |
Definition at line 119 of file path_planner.cpp.
double plugin_demo_interface_namespace::PathPlanner::getYawFromQuat | ( | geometry_msgs::Quaternion | quat | ) |
convert a quaternion into yaw
quat | a Quaternion |
Definition at line 89 of file path_planner.cpp.
void plugin_demo_interface_namespace::PathPlanner::initialize | ( | ros::NodeHandle | roshandle | ) |
Initalize the global variables.
roshandle | a valid ROS NodeHandle |
Definition at line 14 of file path_planner.cpp.
|
protectedvirtual |
In this function the plugIn can do some initialisation depending on a ROS NodeHandle.
roshandle | a valid ROS NodeHandle |
Reimplemented in plugin_demo_plugins_namespace::Direct, and plugin_demo_plugins_namespace::DirectOrtho.
Definition at line 43 of file path_planner.cpp.
|
private |
call sendPath()
event | some time values |
Definition at line 131 of file path_planner.cpp.
int plugin_demo_interface_namespace::PathPlanner::setPoints | ( | geometry_msgs::Pose2D * | start, |
geometry_msgs::Pose2D * | target | ||
) |
replace the current start and target poses and call getPath()
start | new start pose |
target | new target pose |
Definition at line 60 of file path_planner.cpp.
|
protected |
convert a given 2D-Pose into 3D-Stamped-Pose.
pose3d | pointer to the target variable |
x | the x-value of the 2D-Pose |
y | the y-value of the 2D-Pose |
theta | the theta-value of the 2D-Pose |
Definition at line 48 of file path_planner.cpp.
void plugin_demo_interface_namespace::PathPlanner::tfFrameFromPoseStamped | ( | geometry_msgs::PoseStamped * | pose, |
tf::Transform * | tf_tf | ||
) |
build a tf-frame for a given pose
pose | the pose for the tf-frame |
tf_tf | the resulting tf-frame |
Definition at line 100 of file path_planner.cpp.
|
protected |
true if initialized.
Definition at line 54 of file path_planner.hpp.