From a6e4955f072ac505c195725d8774df8fc170cd61 Mon Sep 17 00:00:00 2001 From: Ruichao Wu Date: Wed, 7 Dec 2022 12:15:35 +0100 Subject: [PATCH 1/6] get robot ip from env --- ur5_cell_moveit_config/launch/robot.launch.py | 33 +++++++++++-------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/ur5_cell_moveit_config/launch/robot.launch.py b/ur5_cell_moveit_config/launch/robot.launch.py index 4883d1d..d635e41 100644 --- a/ur5_cell_moveit_config/launch/robot.launch.py +++ b/ur5_cell_moveit_config/launch/robot.launch.py @@ -10,11 +10,16 @@ from moveit_configs_utils.launch_utils import DeclareBooleanLaunchArg from launch.substitutions import LaunchConfiguration from ament_index_python.packages import get_package_share_directory +import os + def generate_launch_description(): - moveit_config = MoveItConfigsBuilder("ur5_msa", package_name="ur5_cell_moveit_config").to_moveit_configs() - #pprint.pprint(moveit_config.to_dict()) + moveit_config = MoveItConfigsBuilder( + "ur5_msa", package_name="ur5_cell_moveit_config").to_moveit_configs() + # pprint.pprint(moveit_config.to_dict()) + ROBOT_IP = os.environ['ROBOT_IP'] + ld = LaunchDescription() ld.add_action( DeclareBooleanLaunchArg( @@ -32,15 +37,14 @@ def generate_launch_description(): ) ld.add_action( DeclareBooleanLaunchArg( - "use_rviz", + "use_rviz", default_value=True) - ) - + ) virtual_joints_launch = ( moveit_config.package_path / "launch/static_virtual_joint_tfs.launch.py" ) - + if virtual_joints_launch.exists(): ld.add_action( IncludeLaunchDescription( @@ -87,12 +91,12 @@ def generate_launch_description(): package="ur_robot_driver", executable="ur_ros2_control_node", parameters=[ - moveit_config.robot_description, + moveit_config.robot_description, str(moveit_config.package_path / "config/ros2_controllers.yaml")], output="screen" ) - ) - + ) + ld.add_action( Node( package="ur_robot_driver", @@ -101,10 +105,10 @@ def generate_launch_description(): name="dashboard_client", output="screen", emulate_tty=True, - parameters=[{"robot_ip": "192.168.56.2"}], + parameters=[{"robot_ip": ROBOT_IP}], ) ) - + ld.add_action( Node( package="ur_robot_driver", @@ -131,9 +135,10 @@ def generate_launch_description(): ld.add_action( IncludeLaunchDescription( PythonLaunchDescriptionSource( - str(moveit_config.package_path / "launch/spawn_controllers.launch.py") + str(moveit_config.package_path / + "launch/spawn_controllers.launch.py") ), ) ) - - return ld \ No newline at end of file + + return ld From 259b9af07a1997c864425d75ffc99bd47093579d Mon Sep 17 00:00:00 2001 From: Ruichao Wu Date: Tue, 24 Jan 2023 08:33:39 +0100 Subject: [PATCH 2/6] change load_yaml to xacro.load_yaml --- ur5_cell_moveit_config/config/ur5_msa.ros2_control.xacro | 2 +- ur5e_cell_description/urdf/workcell.urdf.xacro | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ur5_cell_moveit_config/config/ur5_msa.ros2_control.xacro b/ur5_cell_moveit_config/config/ur5_msa.ros2_control.xacro index 9121460..e72c6b4 100644 --- a/ur5_cell_moveit_config/config/ur5_msa.ros2_control.xacro +++ b/ur5_cell_moveit_config/config/ur5_msa.ros2_control.xacro @@ -1,7 +1,7 @@ - + diff --git a/ur5e_cell_description/urdf/workcell.urdf.xacro b/ur5e_cell_description/urdf/workcell.urdf.xacro index f75c9c0..b97c1b8 100644 --- a/ur5e_cell_description/urdf/workcell.urdf.xacro +++ b/ur5e_cell_description/urdf/workcell.urdf.xacro @@ -61,7 +61,7 @@ sim_gazebo="$(arg sim_gazebo)" sim_ignition="$(arg sim_ignition)" headless_mode="$(arg headless_mode)" - initial_positions="${load_yaml(initial_positions_file)}" + initial_positions="${xacro.load_yaml(initial_positions_file)}" use_tool_communication="$(arg use_tool_communication)" tool_voltage="$(arg tool_voltage)" tool_parity="$(arg tool_parity)" @@ -103,4 +103,4 @@ - \ No newline at end of file + From b524b3205e96feef8caa7ed1a772fb650e12bfca Mon Sep 17 00:00:00 2001 From: Ruichao Wu Date: Thu, 26 Jan 2023 10:47:30 +0100 Subject: [PATCH 3/6] add group hand --- ur5_cell_moveit_config/config/ur5_msa.srdf | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/ur5_cell_moveit_config/config/ur5_msa.srdf b/ur5_cell_moveit_config/config/ur5_msa.srdf index 31a1923..145e261 100644 --- a/ur5_cell_moveit_config/config/ur5_msa.srdf +++ b/ur5_cell_moveit_config/config/ur5_msa.srdf @@ -18,6 +18,15 @@ + + + + + + + + + From 75640cf1ad24a6fbc37a860a75b64bdda81310ef Mon Sep 17 00:00:00 2001 From: Ruichao Wu Date: Mon, 30 Jan 2023 18:07:33 +0100 Subject: [PATCH 4/6] remove unused pacakages and add mssing dependencies --- ur5_cell_moveit_config/package.xml | 3 ++- ur5e_cell_description/CMakeLists.txt | 11 +++++------ ur5e_cell_description/package.xml | 9 ++++----- 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/ur5_cell_moveit_config/package.xml b/ur5_cell_moveit_config/package.xml index d3746ea..41153cc 100644 --- a/ur5_cell_moveit_config/package.xml +++ b/ur5_cell_moveit_config/package.xml @@ -40,9 +40,10 @@ rviz2 rviz_common rviz_default_plugins - tf2_ros ur_description xacro + ur5e_cell_description + ur_robot_driver diff --git a/ur5e_cell_description/CMakeLists.txt b/ur5e_cell_description/CMakeLists.txt index 71d3826..f937721 100644 --- a/ur5e_cell_description/CMakeLists.txt +++ b/ur5e_cell_description/CMakeLists.txt @@ -7,14 +7,11 @@ endif() # find dependencies find_package(ament_cmake REQUIRED) -find_package(rclcpp REQUIRED) -find_package(rclpy REQUIRED) -find_package(ur_description) # add this line to include launch and urdf directory -install(DIRECTORY - launch - urdf +install(DIRECTORY + launch + urdf config meshes rviz @@ -22,9 +19,11 @@ install(DIRECTORY if(BUILD_TESTING) find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights # comment the line when a copyright and license is added to all source files set(ament_cmake_copyright_FOUND TRUE) + # the following line skips cpplint (only works in a git repo) # comment the line when this package is in a git repo and when # a copyright and license is added to all source files diff --git a/ur5e_cell_description/package.xml b/ur5e_cell_description/package.xml index b02a53c..13e1f6a 100644 --- a/ur5e_cell_description/package.xml +++ b/ur5e_cell_description/package.xml @@ -9,12 +9,11 @@ ament_cmake - rclcpp - rclpy - ur_description - ur_moveit_config - ur_robot_driver + ur_description ros2launch + rviz2 + joint_state_publisher_gui + robot_state_publisher ament_lint_auto From 831631ebbc8b6f45e24f2ea0c5a83a44b89e9053 Mon Sep 17 00:00:00 2001 From: Ruichao Wu Date: Mon, 30 Jan 2023 18:08:42 +0100 Subject: [PATCH 5/6] define valid initial positions --- ur5_cell_moveit_config/config/initial_positions.yaml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ur5_cell_moveit_config/config/initial_positions.yaml b/ur5_cell_moveit_config/config/initial_positions.yaml index 0fd53b9..9719360 100644 --- a/ur5_cell_moveit_config/config/initial_positions.yaml +++ b/ur5_cell_moveit_config/config/initial_positions.yaml @@ -1,9 +1,9 @@ # Default initial positions for ur5_msa's ros2_control fake system initial_positions: - elbow_joint: 0 - shoulder_lift_joint: 0 - shoulder_pan_joint: 0 - wrist_1_joint: 0 - wrist_2_joint: 0 - wrist_3_joint: 0 \ No newline at end of file + elbow_joint: -1.5794 + shoulder_lift_joint: -1.74 + shoulder_pan_joint: -1.5708 + wrist_1_joint: 0.1736 + wrist_2_joint: 1.5621 + wrist_3_joint: 0 From c918e592506366fe7561ad20e891f1bbbcbc5938 Mon Sep 17 00:00:00 2001 From: Ruichao Wu Date: Mon, 30 Jan 2023 18:09:00 +0100 Subject: [PATCH 6/6] add group state --- ur5_cell_moveit_config/config/ur5_msa.srdf | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/ur5_cell_moveit_config/config/ur5_msa.srdf b/ur5_cell_moveit_config/config/ur5_msa.srdf index 145e261..7c32660 100644 --- a/ur5_cell_moveit_config/config/ur5_msa.srdf +++ b/ur5_cell_moveit_config/config/ur5_msa.srdf @@ -25,6 +25,22 @@ + + + + + + + + + + + + + + + +