This class provides publishing methods for common messages. More...
#include <publisher.h>
Public Member Functions | |
void | initialize (ros::NodeHandle &nh, RobotDynamicsInterface::Ptr system, const std::string &map_frame) |
Initializes the class and registers topics. More... | |
Publisher ()=default | |
Default constructor. More... | |
Publisher (ros::NodeHandle &nh, RobotDynamicsInterface::Ptr system, const std::string &map_frame) | |
Constructor that initializes the class and registers topics. More... | |
void | publishGlobalPlan (const std::vector< geometry_msgs::PoseStamped > &global_plan) const |
Publish a given global plan to the ros topic ../../global_plan. More... | |
void | publishLocalPlan (const corbo::TimeSeries &ts) const |
Publish a given local plan to the ros topic ../../local_plan. More... | |
void | publishLocalPlan (const std::vector< geometry_msgs::PoseStamped > &local_plan) const |
Publish a given local plan to the ros topic ../../local_plan. More... | |
void | publishObstacles (const teb_local_planner::ObstContainer &obstacles) const |
Publish obstacle positions to the ros topic ../../mpc_markers. More... | |
void | publishRobotFootprintModel (const teb_local_planner::PoseSE2 ¤t_pose, const teb_local_planner::BaseRobotFootprintModel &robot_model, const std::string &ns="RobotFootprintModel", const std_msgs::ColorRGBA &color=toColorMsg(0.5, 0.0, 0.8, 0.0)) |
Publish the visualization of the robot model. More... | |
void | publishViaPoints (const std::vector< teb_local_planner::PoseSE2 > &via_points, const std::string &ns="ViaPoints") const |
Publish via-points to the ros topic ../../teb_markers. More... | |
Static Public Member Functions | |
static std_msgs::ColorRGBA | toColorMsg (float a, float r, float g, float b) |
Helper function to generate a color message from single values. More... | |
Private Types | |
using | CircularObstacle = teb_local_planner::CircularObstacle |
using | LineObstacle = teb_local_planner::LineObstacle |
using | ObstaclePtr = teb_local_planner::ObstaclePtr |
using | ObstContainer = teb_local_planner::ObstContainer |
using | Point2dContainer = teb_local_planner::Point2dContainer |
using | PointObstacle = teb_local_planner::PointObstacle |
using | PolygonObstacle = teb_local_planner::PolygonObstacle |
Private Attributes | |
ros::Publisher | _global_plan_pub |
bool | _initialized = false |
ros::Publisher | _local_plan_pub |
std::string | _map_frame = "map" |
ros::Publisher | _mpc_marker_pub |
RobotDynamicsInterface::Ptr | _system |
This class provides publishing methods for common messages.
Definition at line 66 of file publisher.h.
Definition at line 91 of file publisher.h.
Definition at line 92 of file publisher.h.
Definition at line 88 of file publisher.h.
Definition at line 89 of file publisher.h.
Definition at line 94 of file publisher.h.
Definition at line 90 of file publisher.h.
Definition at line 93 of file publisher.h.
|
default |
Default constructor.
mpc_local_planner::Publisher::Publisher | ( | ros::NodeHandle & | nh, |
RobotDynamicsInterface::Ptr | system, | ||
const std::string & | map_frame | ||
) |
Constructor that initializes the class and registers topics.
[in] | nh | local ros::NodeHandle |
[in] | map_frame | the planning frame name |
Definition at line 61 of file publisher.cpp.
void mpc_local_planner::Publisher::initialize | ( | ros::NodeHandle & | nh, |
RobotDynamicsInterface::Ptr | system, | ||
const std::string & | map_frame | ||
) |
Initializes the class and registers topics.
Call this function if only the default constructor has been called before.
[in] | nh | local ros::NodeHandle |
[in] | map_frame | the planning frame name |
Definition at line 63 of file publisher.cpp.
void mpc_local_planner::Publisher::publishGlobalPlan | ( | const std::vector< geometry_msgs::PoseStamped > & | global_plan | ) | const |
Publish a given global plan to the ros topic ../../global_plan.
[in] | global_plan | Pose array describing the global plan |
Definition at line 98 of file publisher.cpp.
void mpc_local_planner::Publisher::publishLocalPlan | ( | const corbo::TimeSeries & | ts | ) | const |
Publish a given local plan to the ros topic ../../local_plan.
[in] | local_plan | Pose array describing the local plan |
Definition at line 84 of file publisher.cpp.
void mpc_local_planner::Publisher::publishLocalPlan | ( | const std::vector< geometry_msgs::PoseStamped > & | local_plan | ) | const |
Publish a given local plan to the ros topic ../../local_plan.
[in] | local_plan | Pose array describing the local plan |
Definition at line 78 of file publisher.cpp.
void mpc_local_planner::Publisher::publishObstacles | ( | const teb_local_planner::ObstContainer & | obstacles | ) | const |
Publish obstacle positions to the ros topic ../../mpc_markers.
[in] | obstacles | Obstacle container |
Definition at line 127 of file publisher.cpp.
void mpc_local_planner::Publisher::publishRobotFootprintModel | ( | const teb_local_planner::PoseSE2 & | current_pose, |
const teb_local_planner::BaseRobotFootprintModel & | robot_model, | ||
const std::string & | ns = "RobotFootprintModel" , |
||
const std_msgs::ColorRGBA & | color = toColorMsg(0.5, 0.0, 0.8, 0.0) |
||
) |
Publish the visualization of the robot model.
[in] | current_pose | Current pose of the robot |
[in] | robot_model | Subclass of BaseRobotFootprintModel |
[in] | map_frame | frame name for the msg header |
[in] | ns | Namespace for the marker objects |
[in] | color | Color of the footprint |
Definition at line 104 of file publisher.cpp.
void mpc_local_planner::Publisher::publishViaPoints | ( | const std::vector< teb_local_planner::PoseSE2 > & | via_points, |
const std::string & | ns = "ViaPoints" |
||
) | const |
Publish via-points to the ros topic ../../teb_markers.
[in] | via_points | via-point container |
[in] | ns | marker namespace |
Definition at line 254 of file publisher.cpp.
|
static |
Helper function to generate a color message from single values.
[in] | a | Alpha value |
[in] | r | Red value |
[in] | g | Green value |
[in] | b | Blue value |
Definition at line 286 of file publisher.cpp.
|
private |
Definition at line 184 of file publisher.h.
|
private |
Definition at line 177 of file publisher.h.
|
private |
Definition at line 183 of file publisher.h.
|
private |
Definition at line 179 of file publisher.h.
|
private |
Definition at line 185 of file publisher.h.
|
private |
Definition at line 181 of file publisher.h.