ros_plugin_demo
Demonstration of the ROS PlugInLib
 All Data Structures Namespaces Files Functions Variables Pages
Public Member Functions | Private Member Functions
plugin_demo_plugins_namespace::DirectOrtho Class Reference

This class create a path parallel to the axies of the coordinate system between the start and target pose. More...

#include <direct_ortho.hpp>

Inheritance diagram for plugin_demo_plugins_namespace::DirectOrtho:
plugin_demo_interface_namespace::PathPlanner

Public Member Functions

 DirectOrtho ()
 Intentionally left empty.
 
virtual ~DirectOrtho ()
 Intentionally left empty.
 
- Public Member Functions inherited from plugin_demo_interface_namespace::PathPlanner
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.
 

Private Member Functions

int getPath ()
 calculate the third point of the resulting path. More...
 
int onInit (ros::NodeHandle roshandle)
 writes only a info-msg. More...
 

Additional Inherited Members

- Protected Member Functions inherited from plugin_demo_interface_namespace::PathPlanner
 PathPlanner ()
 initialize init
 
void setPose2d (geometry_msgs::PoseStamped *pose3d, double x, double y, double theta)
 convert a given 2D-Pose into 3D-Stamped-Pose. More...
 
- Protected Attributes inherited from plugin_demo_interface_namespace::PathPlanner
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
 

Detailed Description

This class create a path parallel to the axies of the coordinate system between the start and target pose.

The resulting path only contain three points. The one in the middle takes the x-value from the start pose and the y-value from the target pose. Theta is the average of the thetas from the two other poses.

Definition at line 18 of file direct_ortho.hpp.

Member Function Documentation

int plugin_demo_plugins_namespace::DirectOrtho::getPath ( )
privatevirtual

calculate the third point of the resulting path.

Returns
error code

Implements plugin_demo_interface_namespace::PathPlanner.

Definition at line 18 of file direct_ortho.cpp.

19  {
20  current_path.poses.push_back(start);
21 
22  geometry_msgs::PoseStamped point;
23  double yaw = ( getYawFromQuat(start.pose.orientation) + getYawFromQuat(target.pose.orientation) ) / 2;
24  setPose2d(&point, start.pose.position.x, target.pose.position.y, yaw);
25  current_path.poses.push_back(point);
26 
27  current_path.poses.push_back(target);
28  ROS_INFO("[plugin direct_ortho] here comes the path");
29  }
double getYawFromQuat(geometry_msgs::Quaternion quat)
convert a quaternion into yaw
geometry_msgs::PoseStamped target
last pose of the path
nav_msgs::Path current_path
contain the path
void setPose2d(geometry_msgs::PoseStamped *pose3d, double x, double y, double theta)
convert a given 2D-Pose into 3D-Stamped-Pose.
geometry_msgs::PoseStamped start
starting pose of the path
int plugin_demo_plugins_namespace::DirectOrtho::onInit ( ros::NodeHandle  roshandle)
privatevirtual

writes only a info-msg.

Parameters
roshandlea valid ROS NodeHandle
Returns
error code

Reimplemented from plugin_demo_interface_namespace::PathPlanner.

Definition at line 13 of file direct_ortho.cpp.

14  {
15  ROS_INFO("[plugin direct_ortho] done init.");
16  }

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