47 std::string joint_name;
48 std::optional<double> position = std::nullopt;
49 std::optional<double> velocity = std::nullopt;
50 std::optional<double> effort = std::nullopt;
51 std::optional<double> acceleration = std::nullopt;
52 std::optional<double> jerk = std::nullopt;
56 return has_position() || has_velocity() || has_effort() || has_acceleration() || has_jerk();
59 bool has_position()
const {
return position.has_value(); }
61 bool has_velocity()
const {
return velocity.has_value(); }
63 bool has_effort()
const {
return effort.has_value(); }
65 bool has_acceleration()
const {
return acceleration.has_value(); }
67 bool has_jerk()
const {
return jerk.has_value(); }
69 std::string to_string()
const
72 str +=
"Joint: '" + joint_name +
"', ";
75 str +=
"position: " + std::to_string(position.value()) +
", ";
79 str +=
"velocity: " + std::to_string(velocity.value()) +
", ";
83 str +=
"effort: " + std::to_string(effort.value()) +
", ";
85 if (has_acceleration())
87 str +=
"acceleration: " + std::to_string(acceleration.value()) +
", ";
91 str +=
"jerk: " + std::to_string(jerk.value());
94 if (!str.empty() && str.back() ==
' ')
98 if (!str.empty() && str.back() ==
',')
108 std::string joint_name;
114 bool has_actual_data()
const {
return actual.has_data(); }
116 bool has_command_data()
const {
return command.has_data(); }
118 bool has_limited_data()
const {
return limited.has_data(); }
120 void set_joint_name(
const std::string & name)
123 actual.joint_name = name;
124 command.joint_name = name;
125 limited.joint_name = name;
126 prev_command.joint_name = name;
129 std::string to_string()
const
132 FMT_COMPILE(
"Joint: '{}', (actual: [{}], command: [{}], limited: [{}])"), joint_name,
133 actual.to_string(), command.to_string(), limited.to_string());