SMACC2
Loading...
Searching...
No Matches
smacc2_client_library
cl_moveit2z
include
cl_moveit2z
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
/*****************************************************************************************************************
16
*
17
* Authors: Pablo Inigo Blasco, Brett Aldrich
18
*
19
******************************************************************************************************************/
20
21
#pragma once
22
23
#include <tf2/utils.h>
24
#include <geometry_msgs/msg/quaternion.hpp>
25
#include <geometry_msgs/msg/quaternion_stamped.hpp>
26
#include <moveit_msgs/srv/get_position_ik.hpp>
27
28
// All stream operators are now inline for header-only implementation
29
// CRITICAL: Order matters! Primitive types first, then compound types that use them
30
31
// Primitive geometry types (no dependencies)
32
inline
std::ostream &
operator<<
(std::ostream & out,
const
geometry_msgs::msg::Vector3 & msg)
33
{
34
return
out <<
"[ "
<< msg.x <<
" "
<< msg.y <<
" "
<< msg.z <<
"]"
;
35
}
36
37
inline
std::ostream &
operator<<
(std::ostream & out,
const
geometry_msgs::msg::Point & msg)
38
{
39
return
out <<
"[ "
<< msg.x <<
" "
<< msg.y <<
" "
<< msg.z <<
"]"
;
40
}
41
42
inline
std::ostream &
operator<<
(std::ostream & out,
const
geometry_msgs::msg::Quaternion & msg)
43
{
44
return
out <<
" Quaternion["
<< msg.x <<
" , "
<< msg.y <<
" , "
<< msg.z <<
", w:"
<< msg.w;
45
}
46
47
// Compound types (depend on primitive types above)
48
inline
std::ostream &
operator<<
(std::ostream & out,
const
geometry_msgs::msg::Transform & msg)
49
{
50
return
out <<
"Translation["
<< msg.translation <<
"], Rotation["
<< msg.rotation <<
"]"
;
51
}
52
53
inline
std::ostream &
operator<<
(std::ostream & out,
const
geometry_msgs::msg::Pose & msg)
54
{
55
return
out <<
"Position["
<< msg.position <<
"], Orientation["
<< msg.orientation <<
"]"
;
56
}
57
58
inline
std::ostream &
operator<<
(std::ostream & out,
const
geometry_msgs::msg::PoseStamped & msg)
59
{
60
return
out <<
"[serialization geometry_msgs::msg::PoseStamped] frame_id: "
<< msg.header.frame_id
61
<<
", pose: "
<< msg.pose;
62
}
63
64
inline
std::ostream &
operator<<
(
65
std::ostream & out,
const
moveit_msgs::srv::GetPositionIK::Request & msg)
66
{
67
return
out <<
"[moveit_msgs::srv::GetPositionIK::Request] position["
68
<< msg.ik_request.pose_stamped <<
"]"
;
69
}
70
71
inline
std::ostream &
operator<<
(std::ostream & out,
const
sensor_msgs::msg::JointState &
/*msg*/
)
72
{
73
return
out <<
"[sensor_msgs::msg::JointState]"
;
74
}
operator<<
std::ostream & operator<<(std::ostream &out, const geometry_msgs::msg::Vector3 &msg)
Definition
common.hpp:32
Generated by
1.12.0