Main Page
Namespaces
Classes
Files
File List
File Members
src
control_mode.cpp
Go to the documentation of this file.
1
// Copyright (c) 2017 Franka Emika GmbH
2
// Use of this source code is governed by the Apache-2.0 license, see LICENSE
3
#include <
franka_hw/control_mode.h
>
4
5
#include <algorithm>
6
#include <iterator>
7
#include <string>
8
#include <vector>
9
10
namespace
franka_hw
{
11
12
std::ostream&
operator<<
(std::ostream& ostream,
ControlMode
mode) {
13
if
(mode ==
ControlMode::None
) {
14
ostream <<
"<none>"
;
15
}
else
{
16
std::vector<std::string> names;
17
if
((mode &
ControlMode::JointTorque
) !=
ControlMode::None
) {
18
names.emplace_back(
"joint_torque"
);
19
}
20
if
((mode &
ControlMode::JointPosition
) !=
ControlMode::None
) {
21
names.emplace_back(
"joint_position"
);
22
}
23
if
((mode &
ControlMode::JointVelocity
) !=
ControlMode::None
) {
24
names.emplace_back(
"joint_velocity"
);
25
}
26
if
((mode &
ControlMode::CartesianVelocity
) !=
ControlMode::None
) {
27
names.emplace_back(
"cartesian_velocity"
);
28
}
29
if
((mode &
ControlMode::CartesianPose
) !=
ControlMode::None
) {
30
names.emplace_back(
"cartesian_pose"
);
31
}
32
std::copy(names.cbegin(), names.cend() - 1, std::ostream_iterator<std::string>(ostream,
", "
));
33
ostream << names.back();
34
}
35
return
ostream;
36
}
37
38
}
// namespace franka_hw
franka_hw::operator<<
std::ostream & operator<<(std::ostream &ostream, ControlMode mode)
Definition:
control_mode.cpp:12
franka_hw::ControlMode::None
franka_hw
Definition:
control_mode.h:8
franka_hw::ControlMode::JointVelocity
franka_hw::ControlMode
ControlMode
Definition:
control_mode.h:10
franka_hw::ControlMode::JointPosition
franka_hw::ControlMode::CartesianVelocity
franka_hw::ControlMode::CartesianPose
control_mode.h
franka_hw::ControlMode::JointTorque
franka_hw
Author(s): Franka Emika GmbH
autogenerated on Fri Oct 23 2020 03:47:05