Class TrajectoryVisualizer

Class Documentation

class TrajectoryVisualizer

Visualizes trajectories for debugging.

Public Functions

TrajectoryVisualizer() = default

Constructor for mppi::TrajectoryVisualizer.

void on_configure(rclcpp_lifecycle::LifecycleNode::WeakPtr parent, const std::string &name, const std::string &frame_id, ParametersHandler *parameters_handler)

Configure trajectory visualizer.

Parameters:
  • parent – WeakPtr to node

  • name – Name of plugin

  • frame_id – Frame to publish trajectories in

  • dynamic_parameter_handlerParameter handler object

void on_cleanup()

Cleanup object on shutdown.

void on_activate()

Activate object.

void on_deactivate()

Deactivate object.

void add(const xt::xtensor<float, 2> &trajectory, const std::string &marker_namespace, const builtin_interfaces::msg::Time &cmd_stamp)

Add an optimal trajectory to visualize.

Parameters:

trajectory – Optimal trajectory

void add(const models::Trajectories &trajectories, const std::string &marker_namespace)

Add candidate trajectories to visualize.

Parameters:

trajectories – Candidate trajectories

void visualize(const nav_msgs::msg::Path &plan)

Visualize the plan.

Parameters:

plan – Plan to visualize

void reset()

Reset object.

Protected Attributes

std::string frame_id_
std::shared_ptr<rclcpp_lifecycle::LifecyclePublisher<visualization_msgs::msg::MarkerArray>> trajectories_publisher_
std::shared_ptr<rclcpp_lifecycle::LifecyclePublisher<nav_msgs::msg::Path>> transformed_path_pub_
std::shared_ptr<rclcpp_lifecycle::LifecyclePublisher<nav_msgs::msg::Path>> optimal_path_pub_
std::unique_ptr<nav_msgs::msg::Path> optimal_path_
std::unique_ptr<visualization_msgs::msg::MarkerArray> points_
int marker_id_ = 0
ParametersHandler *parameters_handler_
size_t trajectory_step_ = {0}
size_t time_step_ = {0}
rclcpp::Logger logger_ = {rclcpp::get_logger("MPPIController")}