48 std::string joint_name;
49 std::optional<double> position = std::nullopt;
50 std::optional<double> velocity = std::nullopt;
51 std::optional<double> effort = std::nullopt;
52 std::optional<double> acceleration = std::nullopt;
53 std::optional<double> jerk = std::nullopt;
57 return has_position() || has_velocity() || has_effort() || has_acceleration() || has_jerk();
60 bool has_position()
const {
return position.has_value(); }
62 bool has_velocity()
const {
return velocity.has_value(); }
64 bool has_effort()
const {
return effort.has_value(); }
66 bool has_acceleration()
const {
return acceleration.has_value(); }
68 bool has_jerk()
const {
return jerk.has_value(); }
70 std::string to_string()
const
73 str +=
"Joint: '" + joint_name +
"', ";
76 str +=
"position: " + std::to_string(position.value()) +
", ";
80 str +=
"velocity: " + std::to_string(velocity.value()) +
", ";
84 str +=
"effort: " + std::to_string(effort.value()) +
", ";
86 if (has_acceleration())
88 str +=
"acceleration: " + std::to_string(acceleration.value()) +
", ";
92 str +=
"jerk: " + std::to_string(jerk.value());
95 if (!str.empty() && str.back() ==
' ')
99 if (!str.empty() && str.back() ==
',')
109 std::string joint_name;
115 bool has_actual_data()
const {
return actual.has_data(); }
117 bool has_command_data()
const {
return command.has_data(); }
119 bool has_limited_data()
const {
return limited.has_data(); }
121 void set_joint_name(
const std::string & name)
124 actual.joint_name = name;
125 command.joint_name = name;
126 limited.joint_name = name;
127 prev_command.joint_name = name;
130 std::string to_string()
const
133 FMT_COMPILE(
"Joint: '{}', (actual: [{}], command: [{}], limited: [{}])"), joint_name,
134 actual.to_string(), command.to_string(), limited.to_string());