5 #ifndef ROS_PLUGIN_DEMO_PATHPLANNER_H_
6 #define ROS_PLUGIN_DEMO_PATHPLANNER_H_
9 #include "geometry_msgs/PoseStamped.h"
10 #include "nav_msgs/Path.h"
11 #include "geometry_msgs/Pose2D.h"
12 #include <tf/transform_broadcaster.h>
17 namespace plugin_demo_interface_namespace
56 geometry_msgs::PoseStamped
start;
69 virtual int onInit(ros::NodeHandle roshandle);
82 void setPose2d(geometry_msgs::PoseStamped *pose3d,
double x,
double y,
double theta);
119 #endif //ROS_PLUGIN_DEMO_PATHPLANNER_H_
ros::Timer sendPathTimer
periodic calling of the path publisher
void sendPathCallback(const ros::TimerEvent &event)
call sendPath()
void initialize(ros::NodeHandle roshandle)
Initalize the global variables.
int setPoints(geometry_msgs::Pose2D *start, geometry_msgs::Pose2D *target)
replace the current start and target poses and call getPath()
void getTargetCallback(const geometry_msgs::PoseStamped event)
receives a new target pose and call getPath().
ros::Publisher pathPub
send the path calculated by the plugIn
void getStarttCallback(const geometry_msgs::Pose2D event)
receives a new start pose and call getPath().
virtual int onInit(ros::NodeHandle roshandle)
In this function the plugIn can do some initialisation depending on a ROS NodeHandle.
double getYawFromQuat(geometry_msgs::Quaternion quat)
convert a quaternion into yaw
tf::TransformBroadcaster tf_br
send tf-transforms
void sendPath()
publish current_path and the start_tf and target_tf frames
void tfFrameFromPoseStamped(geometry_msgs::PoseStamped *pose, tf::Transform *tf_tf)
build a tf-frame for a given pose
int getPoints(geometry_msgs::Pose2D *start, geometry_msgs::Pose2D *target)
returns the current start and target poses
ros::Subscriber getStartSub
listen for a new start pose
PathPlanner()
initialize init
tf::Transform start_tf
the start tf-frame
geometry_msgs::PoseStamped target
last pose of the path
ros::Subscriber getTargetSub
listen for a new target pose
virtual ~PathPlanner()
Intentionally left empty.
nav_msgs::Path current_path
contain the path
tf::Transform target_tf
the target tf-frame
virtual int getPath()=0
calculate current_path from start and target inside a plugIn.
void setPose2d(geometry_msgs::PoseStamped *pose3d, double x, double y, double theta)
convert a given 2D-Pose into 3D-Stamped-Pose.
bool init
true if initialized.
geometry_msgs::PoseStamped start
starting pose of the path