-
Notifications
You must be signed in to change notification settings - Fork 405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
WIP: Use anchors and aliases for each joint in controller config + cleanup #554
Open
captain-yoshi
wants to merge
3
commits into
UniversalRobots:master
Choose a base branch
from
captain-yoshi:controller-config-simplification
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,166 +1,166 @@ | ||
# Settings for ros_control control loop | ||
hardware_control_loop: | ||
loop_hz: &loop_hz 125 | ||
loop_hz: &loop_hz 125 | ||
|
||
# Settings for ros_control hardware interface | ||
ur_hardware_interface: | ||
joints: &robot_joints | ||
- shoulder_pan_joint | ||
- shoulder_lift_joint | ||
- elbow_joint | ||
- wrist_1_joint | ||
- wrist_2_joint | ||
- wrist_3_joint | ||
joints: &robot_joints | ||
- &joint1 shoulder_pan_joint | ||
- &joint2 shoulder_lift_joint | ||
- &joint3 elbow_joint | ||
- &joint4 wrist_1_joint | ||
- &joint5 wrist_2_joint | ||
- &joint6 wrist_3_joint | ||
|
||
# Publish all joint states ---------------------------------- | ||
joint_state_controller: | ||
type: joint_state_controller/JointStateController | ||
publish_rate: *loop_hz | ||
type: joint_state_controller/JointStateController | ||
publish_rate: *loop_hz | ||
|
||
# Publish wrench ---------------------------------- | ||
force_torque_sensor_controller: | ||
type: force_torque_sensor_controller/ForceTorqueSensorController | ||
publish_rate: *loop_hz | ||
type: force_torque_sensor_controller/ForceTorqueSensorController | ||
publish_rate: *loop_hz | ||
|
||
# Publish speed_scaling factor | ||
speed_scaling_state_controller: | ||
type: scaled_controllers/SpeedScalingStateController | ||
publish_rate: *loop_hz | ||
type: scaled_controllers/SpeedScalingStateController | ||
publish_rate: *loop_hz | ||
|
||
# Joint Trajectory Controller - position based ------------------------------- | ||
# For detailed explanations of parameter see http://wiki.ros.org/joint_trajectory_controller | ||
scaled_pos_joint_traj_controller: | ||
type: position_controllers/ScaledJointTrajectoryController | ||
joints: *robot_joints | ||
constraints: | ||
goal_time: 0.6 | ||
stopped_velocity_tolerance: 0.05 | ||
shoulder_pan_joint: {trajectory: 0.2, goal: 0.1} | ||
shoulder_lift_joint: {trajectory: 0.2, goal: 0.1} | ||
elbow_joint: {trajectory: 0.2, goal: 0.1} | ||
wrist_1_joint: {trajectory: 0.2, goal: 0.1} | ||
wrist_2_joint: {trajectory: 0.2, goal: 0.1} | ||
wrist_3_joint: {trajectory: 0.2, goal: 0.1} | ||
stop_trajectory_duration: 0.5 | ||
state_publish_rate: *loop_hz | ||
action_monitor_rate: 20 | ||
type: position_controllers/ScaledJointTrajectoryController | ||
joints: *robot_joints | ||
constraints: | ||
goal_time: 0.6 | ||
stopped_velocity_tolerance: 0.05 | ||
*joint1: {trajectory: 0.2, goal: 0.1} | ||
*joint2: {trajectory: 0.2, goal: 0.1} | ||
*joint3: {trajectory: 0.2, goal: 0.1} | ||
*joint4: {trajectory: 0.2, goal: 0.1} | ||
*joint5: {trajectory: 0.2, goal: 0.1} | ||
*joint6: {trajectory: 0.2, goal: 0.1} | ||
stop_trajectory_duration: 0.5 | ||
state_publish_rate: *loop_hz | ||
action_monitor_rate: 20 | ||
|
||
pos_joint_traj_controller: | ||
type: position_controllers/JointTrajectoryController | ||
joints: *robot_joints | ||
constraints: | ||
goal_time: 0.6 | ||
stopped_velocity_tolerance: 0.05 | ||
shoulder_pan_joint: {trajectory: 0.2, goal: 0.1} | ||
shoulder_lift_joint: {trajectory: 0.2, goal: 0.1} | ||
elbow_joint: {trajectory: 0.2, goal: 0.1} | ||
wrist_1_joint: {trajectory: 0.2, goal: 0.1} | ||
wrist_2_joint: {trajectory: 0.2, goal: 0.1} | ||
wrist_3_joint: {trajectory: 0.2, goal: 0.1} | ||
stop_trajectory_duration: 0.5 | ||
state_publish_rate: *loop_hz | ||
action_monitor_rate: 20 | ||
type: position_controllers/JointTrajectoryController | ||
joints: *robot_joints | ||
constraints: | ||
goal_time: 0.6 | ||
stopped_velocity_tolerance: 0.05 | ||
*joint1: {trajectory: 0.2, goal: 0.1} | ||
*joint2: {trajectory: 0.2, goal: 0.1} | ||
*joint3: {trajectory: 0.2, goal: 0.1} | ||
*joint4: {trajectory: 0.2, goal: 0.1} | ||
*joint5: {trajectory: 0.2, goal: 0.1} | ||
*joint6: {trajectory: 0.2, goal: 0.1} | ||
stop_trajectory_duration: 0.5 | ||
state_publish_rate: *loop_hz | ||
action_monitor_rate: 20 | ||
|
||
scaled_vel_joint_traj_controller: | ||
type: velocity_controllers/ScaledJointTrajectoryController | ||
joints: *robot_joints | ||
constraints: | ||
goal_time: 0.6 | ||
stopped_velocity_tolerance: 0.05 | ||
shoulder_pan_joint: {trajectory: 0.1, goal: 0.1} | ||
shoulder_lift_joint: {trajectory: 0.1, goal: 0.1} | ||
elbow_joint: {trajectory: 0.1, goal: 0.1} | ||
wrist_1_joint: {trajectory: 0.1, goal: 0.1} | ||
wrist_2_joint: {trajectory: 0.1, goal: 0.1} | ||
wrist_3_joint: {trajectory: 0.1, goal: 0.1} | ||
gains: | ||
#!!These values have not been optimized!! | ||
shoulder_pan_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
shoulder_lift_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
elbow_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
wrist_1_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
wrist_2_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
wrist_3_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
# Use a feedforward term to reduce the size of PID gains | ||
velocity_ff: | ||
shoulder_pan_joint: 1.0 | ||
shoulder_lift_joint: 1.0 | ||
elbow_joint: 1.0 | ||
wrist_1_joint: 1.0 | ||
wrist_2_joint: 1.0 | ||
wrist_3_joint: 1.0 | ||
stop_trajectory_duration: 0.5 | ||
state_publish_rate: *loop_hz | ||
action_monitor_rate: 20 | ||
type: velocity_controllers/ScaledJointTrajectoryController | ||
joints: *robot_joints | ||
constraints: | ||
goal_time: 0.6 | ||
stopped_velocity_tolerance: 0.05 | ||
*joint1: {trajectory: 0.1, goal: 0.1} | ||
*joint2: {trajectory: 0.1, goal: 0.1} | ||
*joint3: {trajectory: 0.1, goal: 0.1} | ||
*joint4: {trajectory: 0.1, goal: 0.1} | ||
*joint5: {trajectory: 0.1, goal: 0.1} | ||
*joint6: {trajectory: 0.1, goal: 0.1} | ||
gains: | ||
#!!These values have not been optimized!! | ||
*joint1: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint2: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint3: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint4: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint5: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint6: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
# Use a feedforward term to reduce the size of PID gains | ||
velocity_ff: | ||
*joint1: 1.0 | ||
*joint2: 1.0 | ||
*joint3: 1.0 | ||
*joint4: 1.0 | ||
*joint5: 1.0 | ||
*joint6: 1.0 | ||
stop_trajectory_duration: 0.5 | ||
state_publish_rate: *loop_hz | ||
action_monitor_rate: 20 | ||
|
||
vel_joint_traj_controller: | ||
type: velocity_controllers/JointTrajectoryController | ||
joints: *robot_joints | ||
constraints: | ||
goal_time: 0.6 | ||
stopped_velocity_tolerance: 0.05 | ||
shoulder_pan_joint: {trajectory: 0.1, goal: 0.1} | ||
shoulder_lift_joint: {trajectory: 0.1, goal: 0.1} | ||
elbow_joint: {trajectory: 0.1, goal: 0.1} | ||
wrist_1_joint: {trajectory: 0.1, goal: 0.1} | ||
wrist_2_joint: {trajectory: 0.1, goal: 0.1} | ||
wrist_3_joint: {trajectory: 0.1, goal: 0.1} | ||
gains: | ||
#!!These values have not been optimized!! | ||
shoulder_pan_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
shoulder_lift_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
elbow_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
wrist_1_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
wrist_2_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
wrist_3_joint: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
# Use a feedforward term to reduce the size of PID gains | ||
velocity_ff: | ||
shoulder_pan_joint: 1.0 | ||
shoulder_lift_joint: 1.0 | ||
elbow_joint: 1.0 | ||
wrist_1_joint: 1.0 | ||
wrist_2_joint: 1.0 | ||
wrist_3_joint: 1.0 | ||
stop_trajectory_duration: 0.5 | ||
state_publish_rate: *loop_hz | ||
action_monitor_rate: 20 | ||
type: velocity_controllers/JointTrajectoryController | ||
joints: *robot_joints | ||
constraints: | ||
goal_time: 0.6 | ||
stopped_velocity_tolerance: 0.05 | ||
*joint1: {trajectory: 0.1, goal: 0.1} | ||
*joint2: {trajectory: 0.1, goal: 0.1} | ||
*joint3: {trajectory: 0.1, goal: 0.1} | ||
*joint4: {trajectory: 0.1, goal: 0.1} | ||
*joint5: {trajectory: 0.1, goal: 0.1} | ||
*joint6: {trajectory: 0.1, goal: 0.1} | ||
gains: | ||
#!!These values have not been optimized!! | ||
*joint1: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint2: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint3: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint4: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint5: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
*joint6: {p: 5.0, i: 0.05, d: 0.1, i_clamp: 1} | ||
# Use a feedforward term to reduce the size of PID gains | ||
velocity_ff: | ||
*joint1: 1.0 | ||
*joint2: 1.0 | ||
*joint3: 1.0 | ||
*joint4: 1.0 | ||
*joint5: 1.0 | ||
*joint6: 1.0 | ||
stop_trajectory_duration: 0.5 | ||
state_publish_rate: *loop_hz | ||
action_monitor_rate: 20 | ||
|
||
# Pass an array of joint velocities directly to the joints | ||
joint_group_vel_controller: | ||
type: velocity_controllers/JointGroupVelocityController | ||
joints: *robot_joints | ||
type: velocity_controllers/JointGroupVelocityController | ||
joints: *robot_joints | ||
|
||
forward_joint_traj_controller: | ||
type: "pass_through_controllers/JointTrajectoryController" | ||
joints: *robot_joints | ||
type: pass_through_controllers/JointTrajectoryController | ||
joints: *robot_joints | ||
|
||
forward_cartesian_traj_controller: | ||
type: "pass_through_controllers/CartesianTrajectoryController" | ||
joints: *robot_joints | ||
type: pass_through_controllers/CartesianTrajectoryController | ||
joints: *robot_joints | ||
|
||
twist_controller: | ||
type: "ros_controllers_cartesian/TwistController" | ||
frame_id: "tool0_controller" | ||
type: ros_controllers_cartesian/TwistController | ||
frame_id: tool0_controller | ||
publish_rate: *loop_hz | ||
joints: *robot_joints | ||
|
||
pose_based_cartesian_traj_controller: | ||
type: pose_controllers/CartesianTrajectoryController | ||
type: pose_controllers/CartesianTrajectoryController | ||
|
||
# UR driver convention | ||
base: base | ||
tip: tool0_controller | ||
joints: *robot_joints | ||
# UR driver convention | ||
base: base | ||
tip: tool0_controller | ||
joints: *robot_joints | ||
|
||
joint_based_cartesian_traj_controller: | ||
type: position_controllers/CartesianTrajectoryController | ||
type: position_controllers/CartesianTrajectoryController | ||
|
||
# UR driver convention | ||
base: base | ||
tip: tool0 | ||
joints: *robot_joints | ||
# UR driver convention | ||
base: base | ||
tip: tool0 | ||
joints: *robot_joints | ||
|
||
robot_status_controller: | ||
type: industrial_robot_status_controller/IndustrialRobotStatusController | ||
handle_name: industrial_robot_status_handle | ||
publish_rate: 10 | ||
type: industrial_robot_status_controller/IndustrialRobotStatusController | ||
handle_name: industrial_robot_status_handle | ||
publish_rate: 10 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure whether using anchors for this really improves things. Yes, it is less code duplication, but in my opinion this is also less readable.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If someone uses the prefix below in their urdf:
All the joints must be renamed, with anchors/aliases you only need to rename 6 joint names. Would something like this be better ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
have you considered using subst_value? I don't believe you'd need to manually rename anything.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This would work with the
/my_controller/joints
because they are values, but I would need to remap theconstraints
,gains
andvelocity_ff
namespaces:When adding new controllers I would have to remap the new controller namespace. With the anchors solution I don't have to bother, it scales well when adding new controllers. I may be missing something...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand what you write here.
But perhaps I also don't fully understand what you're trying to achieve.