SMACC2
Loading...
Searching...
No Matches
Functions
common.hpp File Reference
#include <iostream>
#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
#include <geometry_msgs/msg/pose_stamped.hpp>
#include <geometry_msgs/msg/twist.hpp>
#include "rclcpp_lifecycle/lifecycle_node.hpp"
Include dependency graph for common.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &out, const geometry_msgs::msg::Twist &msg)
 
std::ostream & operator<< (std::ostream &out, const geometry_msgs::msg::Pose &msg)
 
std::ostream & operator<< (std::ostream &out, const geometry_msgs::msg::PoseStamped &msg)
 
std::ostream & operator<< (std::ostream &out, const geometry_msgs::msg::Point &msg)
 
std::ostream & operator<< (std::ostream &out, const geometry_msgs::msg::Quaternion &msg)
 
template<typename T >
void declareOrSet (rclcpp_lifecycle::LifecycleNode::SharedPtr &node, std::string param, T &value)
 

Function Documentation

◆ declareOrSet()

template<typename T >
void declareOrSet ( rclcpp_lifecycle::LifecycleNode::SharedPtr &  node,
std::string  param,
T &  value 
)

Definition at line 34 of file common.hpp.

35{
36 if (!node->has_parameter(param))
37 {
38 node->declare_parameter(param, value);
39 // node->set_parameter(rclcpp::Parameter(param, value));
40 }
41}

Referenced by cl_nav2z::backward_local_planner::BackwardLocalPlanner::configure(), cl_nav2z::forward_local_planner::ForwardLocalPlanner::configure(), cl_nav2z::pure_spinning_local_planner::PureSpinningLocalPlanner::configure(), cl_nav2z::backward_global_planner::BackwardGlobalPlanner::configure(), and cl_nav2z::undo_path_global_planner::UndoPathGlobalPlanner::configure().

Here is the caller graph for this function:

◆ operator<<() [1/5]

std::ostream & operator<< ( std::ostream &  out,
const geometry_msgs::msg::Point &  msg 
)

Definition at line 52 of file common.cpp.

53{
54 return out << "[ " << msg.x << " " << msg.y << " " << msg.z << "]";
55}

◆ operator<<() [2/5]

std::ostream & operator<< ( std::ostream &  out,
const geometry_msgs::msg::Pose &  msg 
)

Definition at line 36 of file common.cpp.

37{
38 return out << "Position[" << msg.position << "], Orientation[" << msg.orientation << "]";
39}

◆ operator<<() [3/5]

std::ostream & operator<< ( std::ostream &  out,
const geometry_msgs::msg::PoseStamped &  msg 
)

Definition at line 41 of file common.cpp.

42{
43 return out << "[serialization geometry_msgs::msg::PoseStamped] frame_id: " << msg.header.frame_id
44 << ", pose: " << msg.pose;
45}

◆ operator<<() [4/5]

std::ostream & operator<< ( std::ostream &  out,
const geometry_msgs::msg::Quaternion &  msg 
)

Definition at line 26 of file common.cpp.

27{
28 return out << " Quaternion[" << msg.x << " , " << msg.y << " , " << msg.z << ", w:" << msg.w;
29}

◆ operator<<() [5/5]

std::ostream & operator<< ( std::ostream &  out,
const geometry_msgs::msg::Twist &  msg 
)

Definition at line 124 of file common.cpp.

125{
126 out << "Twist [" << msg.linear.x << "m , " << msg.linear.y << "m , " << msg.angular.z << "rad ]";
127 return out;
128}