SMACC2
Loading...
Searching...
No Matches
common.hpp
Go to the documentation of this file.
1// Copyright 2021 RobosoftAI Inc.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#pragma once
16#include <iostream>
17
18#include <tf2_geometry_msgs/tf2_geometry_msgs.h>
19#include <geometry_msgs/msg/pose_stamped.hpp>
20#include <geometry_msgs/msg/twist.hpp>
21#include "rclcpp_lifecycle/lifecycle_node.hpp"
22
23std::ostream & operator<<(std::ostream & out, const geometry_msgs::msg::Twist & msg);
24
25std::ostream & operator<<(std::ostream & out, const geometry_msgs::msg::Pose & msg);
26
27std::ostream & operator<<(std::ostream & out, const geometry_msgs::msg::PoseStamped & msg);
28
29std::ostream & operator<<(std::ostream & out, const geometry_msgs::msg::Point & msg);
30
31std::ostream & operator<<(std::ostream & out, const geometry_msgs::msg::Quaternion & msg);
32
33template <typename T>
34void declareOrSet(rclcpp_lifecycle::LifecycleNode::SharedPtr & node, std::string param, T & value)
35{
36 if (!node->has_parameter(param))
37 {
38 node->declare_parameter(param, value);
39 // node->set_parameter(rclcpp::Parameter(param, value));
40 }
41}
std::ostream & operator<<(std::ostream &out, const geometry_msgs::msg::Quaternion &msg)
Definition: common.cpp:26
void declareOrSet(rclcpp_lifecycle::LifecycleNode::SharedPtr &node, std::string param, T &value)
Definition: common.hpp:34