still error in moveit (gripper motion can be planned but not executed)

updated README.md
This commit is contained in:
Niko Feith 2024-04-02 18:54:31 +02:00
parent ab2278c0c8
commit ce035fa6d7
6 changed files with 51 additions and 44 deletions

View File

@ -64,7 +64,7 @@ ros2 launch ur_robotiq_moveit_config ur_robotiq_moveit.launch.py use_fake_hardwa
### use_fake_hardware:=true ### use_fake_hardware:=true
Terminal 1.: Terminal 1.:
```bash ```bash
ros2 launch ur_robotiq_description ur_robotiq_control.launch.py robot_ip:=aaa.bbb.ccc.ddd use_fake_hardware:=true launch_rviz:=false ros2 launch ur_robotiq_description ur_robotiq_control.launch.py robot_ip:=aaa.bbb.ccc.ddd use_fake_hardware:=true launch_rviz:=false initial_joint_controller:=joint_trajectory_controller
``` ```
Terminal 2.: Terminal 2.:
```bash ```bash

View File

@ -131,6 +131,7 @@ forward_position_controller:
- $(var tf_prefix)wrist_2_joint - $(var tf_prefix)wrist_2_joint
- $(var tf_prefix)wrist_3_joint - $(var tf_prefix)wrist_3_joint
robotiq_gripper_controller: robotiq_gripper_controller:
ros__parameters: ros__parameters:
default: true default: true

View File

@ -7,6 +7,7 @@ from launch.actions import DeclareLaunchArgument, OpaqueFunction
from launch.conditions import IfCondition, UnlessCondition from launch.conditions import IfCondition, UnlessCondition
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution, TextSubstitution from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution, TextSubstitution
def launch_setup(context, *args, **kwargs): def launch_setup(context, *args, **kwargs):
# Initialize Arguments # Initialize Arguments
ur_type = LaunchConfiguration("ur_type") ur_type = LaunchConfiguration("ur_type")
@ -44,8 +45,6 @@ def launch_setup(context, *args, **kwargs):
script_sender_port = LaunchConfiguration("script_sender_port") script_sender_port = LaunchConfiguration("script_sender_port")
trajectory_port = LaunchConfiguration("trajectory_port") trajectory_port = LaunchConfiguration("trajectory_port")
# Config Paths UR # Config Paths UR
joint_limit_params = PathJoinSubstitution( joint_limit_params = PathJoinSubstitution(
[FindPackageShare(ur_description_package), "config", ur_type, "joint_limits.yaml"] [FindPackageShare(ur_description_package), "config", ur_type, "joint_limits.yaml"]
@ -191,8 +190,7 @@ def launch_setup(context, *args, **kwargs):
control_node = Node( control_node = Node(
package="controller_manager", package="controller_manager",
executable="ros2_control_node", executable="ros2_control_node",
parameters=[ parameters=[robot_description,
robot_description,
update_rate_config_file, update_rate_config_file,
ParameterFile(initial_joint_controllers, allow_substs=True), ParameterFile(initial_joint_controllers, allow_substs=True),
], ],
@ -203,8 +201,7 @@ def launch_setup(context, *args, **kwargs):
ur_control_node = Node( ur_control_node = Node(
package="ur_robot_driver", package="ur_robot_driver",
executable="ur_ros2_control_node", executable="ur_ros2_control_node",
parameters=[ parameters=[robot_description,
robot_description,
update_rate_config_file, update_rate_config_file,
ParameterFile(initial_joint_controllers, allow_substs=True), ParameterFile(initial_joint_controllers, allow_substs=True),
], ],
@ -606,5 +603,4 @@ def generate_launch_description():
) )
) )
return LaunchDescription(declared_arguments + [OpaqueFunction(function=launch_setup)]) return LaunchDescription(declared_arguments + [OpaqueFunction(function=launch_setup)])

View File

@ -34,7 +34,7 @@ robotiq_gripper_controller:
action_ns: gripper_cmd action_ns: gripper_cmd
type: GripperCommand type: GripperCommand
default: true default: true
joints: controlled_joints:
- finger_joint - finger_joint

View File

@ -24,7 +24,7 @@ def load_yaml(package_name, file_path):
return None return None
def generate_launch_description(): def launch_setup(context, *args, **kwargs):
# Initialize Arguments # Initialize Arguments
ur_type = LaunchConfiguration("ur_type") ur_type = LaunchConfiguration("ur_type")
@ -145,10 +145,12 @@ def generate_launch_description():
ompl_planning_pipeline_config["move_group"].update(ompl_planning_yaml) ompl_planning_pipeline_config["move_group"].update(ompl_planning_yaml)
# Trajectory Execution Configuration # Trajectory Execution Configuration
controllers_yaml = load_yaml(moveit_config_package, "config/moveit_controllers.yaml")
# the scaled_joint_trajectory_controller does not work on fake hardware # the scaled_joint_trajectory_controller does not work on fake hardware
change_controllers = use_fake_hardware use_fake_hw = use_fake_hardware.perform(context)
if change_controllers == "true": controllers_yaml = load_yaml(moveit_config_package, "config/moveit_controllers.yaml")
if use_fake_hw == "true":
print("Using fake hardware")
controllers_yaml["scaled_joint_trajectory_controller"]["default"] = False controllers_yaml["scaled_joint_trajectory_controller"]["default"] = False
controllers_yaml["joint_trajectory_controller"]["default"] = True controllers_yaml["joint_trajectory_controller"]["default"] = True
@ -232,6 +234,12 @@ def generate_launch_description():
output="screen", output="screen",
) )
nodes_to_start = [move_group_node, rviz_node, servo_node]
return nodes_to_start
def generate_launch_description():
# Declare the Launch arguments # Declare the Launch arguments
declared_arguments = [] declared_arguments = []
# UR specific arguments # UR specific arguments
@ -302,7 +310,6 @@ def generate_launch_description():
DeclareLaunchArgument("launch_servo", default_value="true", description="Launch Servo?") DeclareLaunchArgument("launch_servo", default_value="true", description="Launch Servo?")
) )
# servo_node,
nodes_to_start = [move_group_node, rviz_node, servo_node]
return LaunchDescription(declared_arguments + nodes_to_start)
return LaunchDescription(declared_arguments + [OpaqueFunction(function=launch_setup)])

View File

@ -50,6 +50,9 @@
<exec_depend>robotiq_controllers</exec_depend> <exec_depend>robotiq_controllers</exec_depend>
<exec_depend>gripper_controllers</exec_depend> <exec_depend>gripper_controllers</exec_depend>
<depend>control_msgs</depend>
<depend>rclcpp_action</depend>
<export> <export>
<build_type>ament_cmake</build_type> <build_type>ament_cmake</build_type>