-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #212 from lbr-stack/dev-humble-cartesian-velocity
MoveIt Servo Support
- Loading branch information
Showing
38 changed files
with
1,183 additions
and
90 deletions.
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
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
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Please do e.g. refer to | ||
# - https://github.com/moveit/moveit2/blob/humble/moveit_ros/moveit_servo/config/panda_simulated_config.yaml | ||
# - https://github.com/moveit/moveit2/blob/humble/moveit_ros/moveit_servo/config/panda_simulated_config_pose_tracking.yaml | ||
/**/servo_node: | ||
ros__parameters: | ||
moveit_servo: | ||
## Properties of incoming commands | ||
command_in_type: "unitless" # "unitless"> in the range [-1:1], as if from joystick. "speed_units"> cmds are in m/s and rad/s | ||
scale: | ||
# Scale parameters are only used if command_in_type=="unitless" | ||
linear: 0.4 # Max linear velocity. Unit is [m/s]. Only used for Cartesian commands. | ||
rotational: 0.8 # Max angular velocity. Unit is [rad/s]. Only used for Cartesian commands. | ||
# Max joint angular/linear velocity. Only used for joint commands on joint_command_in_topic. | ||
joint: 0.5 | ||
|
||
# Optionally override Servo's internal velocity scaling when near singularity or collision (0.0 = use internal velocity scaling) | ||
# override_velocity_scaling_factor = 0.0 # valid range [0.0:1.0] | ||
|
||
## Properties of outgoing commands | ||
publish_period: 0.005 # #1/controller manager update rate [seconds] | ||
low_latency_mode: false # Set this to true to publish as soon as an incoming Twist command is received (publish_period is ignored) | ||
|
||
# What type of topic does your robot driver expect? | ||
# Currently supported are std_msgs/Float64MultiArray or trajectory_msgs/JointTrajectory | ||
command_out_type: std_msgs/Float64MultiArray | ||
|
||
# What to publish? Can save some bandwidth as most robots only require positions or velocities | ||
publish_joint_positions: true | ||
publish_joint_velocities: false | ||
publish_joint_accelerations: false | ||
|
||
## Plugins for smoothing outgoing commands | ||
smoothing_filter_plugin_name: "online_signal_smoothing::ButterworthFilterPlugin" | ||
|
||
# If is_primary_planning_scene_monitor is set to true, the Servo server's PlanningScene advertises the /get_planning_scene service, | ||
# which other nodes can use as a source for information about the planning environment. | ||
# NOTE: If a different node in your system is responsible for the "primary" planning scene instance (e.g. the MoveGroup node), | ||
# then is_primary_planning_scene_monitor needs to be set to false. | ||
is_primary_planning_scene_monitor: true | ||
|
||
## MoveIt properties | ||
move_group_name: arm # Often 'manipulator' or 'arm' | ||
planning_frame: link_0 # The MoveIt planning frame. Often 'base_link' or 'world' | ||
|
||
## Other frames | ||
ee_frame_name: link_ee # The name of the end effector link, used to return the EE pose | ||
robot_link_command_frame: link_0 # commands must be given in the frame of a robot link. Usually either the base or end effector | ||
|
||
## Stopping behaviour | ||
incoming_command_timeout: 0.1 # Stop servoing if X seconds elapse without a new command | ||
# If 0, republish commands forever even if the robot is stationary. Otherwise, specify num. to publish. | ||
# Important because ROS may drop some messages and we need the robot to halt reliably. | ||
num_outgoing_halt_msgs_to_publish: 4 | ||
|
||
## Configure handling of singularities and joint limits | ||
lower_singularity_threshold: 17.0 # Start decelerating when the condition number hits this (close to singularity) | ||
hard_stop_singularity_threshold: 30.0 # Stop when the condition number hits this | ||
joint_limit_margin: 0.1 # added as a buffer to joint limits [radians]. If moving quickly, make this larger. | ||
leaving_singularity_threshold_multiplier: 2.0 # Multiply the hard stop limit by this when leaving singularity (see https://github.com/ros-planning/moveit2/pull/620) | ||
|
||
## Topic names | ||
cartesian_command_in_topic: ~/delta_twist_cmds # Topic for incoming Cartesian twist commands | ||
joint_command_in_topic: ~/delta_joint_cmds # Topic for incoming joint angle commands | ||
joint_topic: /lbr/joint_states | ||
status_topic: ~/status # Publish status to this topic | ||
command_out_topic: /lbr/forward_position_controller/commands # Publish outgoing commands here | ||
|
||
## Collision checking for the entire robot body | ||
check_collisions: true # Check collisions? | ||
collision_check_rate: 10.0 # [Hz] Collision-checking can easily bog down a CPU if done too often. | ||
self_collision_proximity_threshold: 0.01 # Start decelerating when a self-collision is this far [m] | ||
scene_collision_proximity_threshold: 0.02 # Start decelerating when a scene collision is this far [m] |
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
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 |
---|---|---|
@@ -0,0 +1,72 @@ | ||
from typing import List | ||
|
||
from launch import LaunchContext, LaunchDescription, LaunchDescriptionEntity | ||
from launch.actions import OpaqueFunction, RegisterEventHandler | ||
from launch.conditions import IfCondition | ||
from launch.event_handlers import OnProcessStart | ||
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution | ||
from launch_ros.substitutions import FindPackageShare | ||
from lbr_bringup.description import LBRDescriptionMixin | ||
from lbr_bringup.moveit import LBRMoveGroupMixin, LBRMoveItServoMixin | ||
|
||
|
||
def hidden_setup(context: LaunchContext) -> List[LaunchDescriptionEntity]: | ||
ld = LaunchDescription() | ||
|
||
moveit_servo_config = PathJoinSubstitution( | ||
[FindPackageShare("lbr_bringup"), "config/moveit_servo.yaml"] | ||
) | ||
model = LaunchConfiguration("model").perform(context) | ||
moveit_configs = LBRMoveGroupMixin.moveit_configs_builder( | ||
robot_name=model, | ||
package_name=f"{model}_moveit_config", | ||
).to_moveit_configs() | ||
|
||
mode = LaunchConfiguration("mode").perform(context) | ||
use_sim_time = False | ||
if mode == "gazebo": | ||
use_sim_time = True | ||
|
||
# moveit servo node | ||
servo_node = LBRMoveItServoMixin.node_moveit_servo( | ||
parameters=[ | ||
moveit_configs.robot_description_kinematics, | ||
moveit_configs.robot_description_semantic, | ||
{"use_sim_time": use_sim_time}, | ||
moveit_servo_config, | ||
{ | ||
"moveit_servo.use_gazebo": mode | ||
== "gazebo", # we configure this parameter dynamically | ||
}, | ||
], | ||
) | ||
ld.add_action(servo_node) | ||
|
||
# call start servo after servo node start | ||
ld.add_action( | ||
RegisterEventHandler( | ||
OnProcessStart( | ||
target_action=servo_node, | ||
on_start=[ | ||
LBRMoveItServoMixin.call_start_servo_service( | ||
condition=IfCondition( | ||
LaunchConfiguration("default_enable_servo") | ||
) | ||
) | ||
], | ||
), | ||
) | ||
) | ||
|
||
return ld.entities | ||
|
||
|
||
def generate_launch_description() -> LaunchDescription: | ||
ld = LaunchDescription() | ||
|
||
ld.add_action(LBRDescriptionMixin.arg_mode()) | ||
ld.add_action(LBRDescriptionMixin.arg_model()) | ||
ld.add_action(LBRMoveItServoMixin.arg_default_enable_servo()) | ||
|
||
ld.add_action(OpaqueFunction(function=hidden_setup)) | ||
return ld |
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
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 |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>lbr_bringup</name> | ||
<version>2.1.1</version> | ||
<version>2.1.2</version> | ||
<description>LBR launch files.</description> | ||
<maintainer email="[email protected]">mhubii</maintainer> | ||
<license>Apache License 2.0</license> | ||
<license>Apache-2.0</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
<buildtool_depend>ament_cmake_python</buildtool_depend> | ||
|
@@ -17,6 +17,8 @@ | |
<exec_depend>lbr_description</exec_depend> | ||
<exec_depend>lbr_fri_ros2</exec_depend> | ||
<exec_depend>lbr_ros2_control</exec_depend> | ||
<exec_depend>moveit_ros_move_group</exec_depend> | ||
<exec_depend>moveit_servo</exec_depend> | ||
<exec_depend>rclpy</exec_depend> | ||
<exec_depend>robot_state_publisher</exec_depend> | ||
<exec_depend>ros_gz_sim</exec_depend> | ||
|
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
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 |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>lbr_demos_advanced_cpp</name> | ||
<version>2.1.1</version> | ||
<version>2.1.2</version> | ||
<description>Advanced C++ demos for the lbr_ros2_control.</description> | ||
<maintainer email="[email protected]">mhubii</maintainer> | ||
<license>Apache License 2.0</license> | ||
<license>Apache-2.0</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
|
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 |
---|---|---|
|
@@ -2,11 +2,11 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>lbr_demos_advanced_py</name> | ||
<version>2.1.1</version> | ||
<version>2.1.2</version> | ||
<description>Advanced Python demos for the lbr_ros2_control.</description> | ||
<maintainer email="[email protected]">mhubii</maintainer> | ||
<maintainer email="[email protected]">cmower</maintainer> | ||
<license>Apache License 2.0</license> | ||
<license>Apache-2.0</license> | ||
|
||
<exec_depend>lbr_description</exec_depend> | ||
<exec_depend>lbr_fri_idl</exec_depend> | ||
|
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
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 |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>lbr_demos_cpp</name> | ||
<version>2.1.1</version> | ||
<version>2.1.2</version> | ||
<description>C++ demos for lbr_ros2_control.</description> | ||
<maintainer email="[email protected]">mhubii</maintainer> | ||
<license>Apache License 2.0</license> | ||
<license>Apache-2.0</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
|
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 |
---|---|---|
|
@@ -2,10 +2,10 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
<name>lbr_demos_py</name> | ||
<version>2.1.1</version> | ||
<version>2.1.2</version> | ||
<description>Python demos for lbr_ros2_control.</description> | ||
<maintainer email="[email protected]">mhubii</maintainer> | ||
<license>Apache License 2.0</license> | ||
<license>Apache-2.0</license> | ||
|
||
<exec_depend>control_msgs</exec_depend> | ||
<exec_depend>lbr_bringup</exec_depend> | ||
|
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
Oops, something went wrong.