Skip to content

Commit 5078c60

Browse files
author
Felix Exner
committed
Simplify joint state configuration
1 parent 5b1f7f3 commit 5078c60

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

ur_controllers/src/passthrough_trajectory_controller.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -100,15 +100,10 @@ controller_interface::InterfaceConfiguration PassthroughTrajectoryController::st
100100
{
101101
controller_interface::InterfaceConfiguration conf;
102102
conf.type = controller_interface::interface_configuration_type::INDIVIDUAL;
103-
const std::string tf_prefix = passthrough_params_.tf_prefix;
104103

105-
conf.names.reserve(joint_names_.size() * state_interface_types_.size());
106-
for (const auto& joint_name : joint_names_) {
107-
for (const auto& interface_type : state_interface_types_) {
108-
conf.names.emplace_back(joint_name + "/" + interface_type);
109-
}
110-
}
111-
conf.names.emplace_back(passthrough_params_.speed_scaling_interface_name);
104+
std::copy(joint_state_interface_names_.cbegin(), joint_state_interface_names_.cend(), std::back_inserter(conf.names));
105+
106+
conf.names.push_back(passthrough_params_.speed_scaling_interface_name);
112107

113108
return conf;
114109
}
@@ -216,7 +211,9 @@ controller_interface::return_type PassthroughTrajectoryController::update(const
216211
// Write a new point to the command interface, if the previous point has been read by the hardware interface.
217212
if (current_transfer_state == TRANSFER_STATE_WAITING_FOR_POINT) {
218213
if (current_index_ < active_joint_traj_.points.size()) {
219-
// Write the time_from_start parameter.
214+
// TODO(fexner): Make sure that we are writing to the correct interface. Joints could be
215+
// ordered differently inside the trajectory!
216+
// Write the time_from_start parameter.
220217
command_interfaces_[CommandInterfaces::PASSTHROUGH_TRAJECTORY_TIME_FROM_START].set_value(
221218
duration_to_double(active_joint_traj_.points[current_index_].time_from_start));
222219

0 commit comments

Comments
 (0)