Skip to content

Commit

Permalink
Merge pull request #130 from iory/controller
Browse files Browse the repository at this point in the history
Use default_controller param in default_controller
  • Loading branch information
iory authored Dec 5, 2024
2 parents 0752dea + 460ad6c commit 1100376
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion ros/kxr_controller/python/kxr_controller/kxr_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,4 +210,18 @@ def fullbody_controller(self):
}

def default_controller(self):
return [self.fullbody_controller]
controller_names = rospy.get_param(
self.namespace + 'default_controller', None)
if controller_names is None:
return [self.fullbody_controller]
controllers = []
for cont_name in controller_names:
controllers.append({
"controller_type": cont_name,
"controller_action": cont_name + "/follow_joint_trajectory",
"controller_state": cont_name + "/state",
"action_type": control_msgs.msg.FollowJointTrajectoryAction,
"joint_names": rospy.get_param(
self.namespace + cont_name + '/joints'),
})
return controllers

0 comments on commit 1100376

Please sign in to comment.