Quad-SDK
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | List of all members
TrajectoryPublisher Class Reference

A class for publishing the current state of a trajectory. More...

#include <trajectory_publisher.h>

Public Member Functions

 TrajectoryPublisher (ros::NodeHandle nh)
 Constructor for TrajectoryPublisher Class.
 
void spin ()
 Calls ros spinOnce and pubs data at set frequency.
 

Private Member Functions

void importTrajectory ()
 Import trajectory from external source (user implemented)
 
void robotPlanCallback (const quad_msgs::RobotPlan::ConstPtr &msg)
 Callback function to handle new body plan data.
 
void publishTrajectoryState ()
 Publish the current trajectory state.
 

Private Attributes

ros::Subscriber body_plan_sub_
 ROS Subscriber for the body plan.
 
ros::Publisher trajectory_state_pub_
 ROS Publisher for the current trajectory state.
 
ros::NodeHandle nh_
 Nodehandle to pub to and sub from.
 
quad_msgs::RobotPlan body_plan_msg_
 Vector of body states to store the body plan.
 
quad_msgs::RobotState::ConstPtr robot_state_msg_
 Robot state message.
 
double update_rate_
 Update rate for sending and receiving data.
 
std::string map_frame_
 Handle for the map frame.
 
std::string traj_source_
 The source of the current trajectory (import or topic)
 
std::shared_ptr< quad_utils::QuadKDquadKD_
 QuadKD class.
 

Detailed Description

A class for publishing the current state of a trajectory.

TrajectoryPublisher is a class for publishing the current state of a given robot trajectory. It subscribes to a topic of type RobotPlan or can be customized to import data directly (such as from a .csv), then interpolates that trajectory to find the state at the current time and publishes it to the trajectory state topic.

Constructor & Destructor Documentation

◆ TrajectoryPublisher()

TrajectoryPublisher::TrajectoryPublisher ( ros::NodeHandle  nh)

Constructor for TrajectoryPublisher Class.

Parameters
[in]nhROS NodeHandle to publish and subscribe from
Returns
Constructed object of type TrajectoryPublisher

Member Function Documentation

◆ robotPlanCallback()

void TrajectoryPublisher::robotPlanCallback ( const quad_msgs::RobotPlan::ConstPtr &  msg)
private

Callback function to handle new body plan data.

Parameters
[in]msgBody plan message contining interpolated output of body planner

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