From 817dfeaa0f63883ab6595c2ec4c4e693151eba83 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Wed, 2 Aug 2023 16:57:01 +0300 Subject: [PATCH 01/15] =?UTF-8?q?=F0=9F=9A=A7=20add=20impedance=20controll?= =?UTF-8?q?er=20node?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- rbs_bringup/launch/bringup.launch.py | 4 +- .../CMakeLists.txt | 35 +++++++++++++++++ .../cartesian_impedance_controller.hpp | 39 +++++++++++++++++++ .../package.xml | 18 +++++++++ .../src/cartesian_impedance_controller.cpp | 14 +++++++ rbs_simulation/launch/simulation.launch.py | 6 +-- rbs_simulation/mujoco_model/current_mj.xml | 5 +++ 7 files changed, 116 insertions(+), 5 deletions(-) create mode 100644 rbs_controllers/cartesian_impedance_controller/CMakeLists.txt create mode 100644 rbs_controllers/cartesian_impedance_controller/include/cartesian_impedance_controller/cartesian_impedance_controller.hpp create mode 100644 rbs_controllers/cartesian_impedance_controller/package.xml create mode 100644 rbs_controllers/cartesian_impedance_controller/src/cartesian_impedance_controller.cpp diff --git a/rbs_bringup/launch/bringup.launch.py b/rbs_bringup/launch/bringup.launch.py index 32caa7f..0545b75 100644 --- a/rbs_bringup/launch/bringup.launch.py +++ b/rbs_bringup/launch/bringup.launch.py @@ -83,7 +83,7 @@ def generate_launch_description(): declared_arguments.append( DeclareLaunchArgument( "start_joint_controller", - default_value="true", + default_value="false", description="Enable headless mode for robot control", ) ) @@ -126,7 +126,7 @@ def generate_launch_description(): ) ) declared_arguments.append( - DeclareLaunchArgument("with_gripper", default_value="true", description="With gripper or not?") + DeclareLaunchArgument("with_gripper", default_value="false", description="With gripper or not?") ) declared_arguments.append( DeclareLaunchArgument("launch_rviz", default_value="true", description="Launch RViz?") diff --git a/rbs_controllers/cartesian_impedance_controller/CMakeLists.txt b/rbs_controllers/cartesian_impedance_controller/CMakeLists.txt new file mode 100644 index 0000000..c3b26f4 --- /dev/null +++ b/rbs_controllers/cartesian_impedance_controller/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.8) +project(cartesian_impedance_controller) + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) +# uncomment the following section in order to fill in +# further dependencies manually. +# find_package( REQUIRED) + +# add_executable(cartesian_impedance_controller src/cartesian_impedance_controller.cpp) +# target_include_directories(cartesian_impedance_controller PUBLIC +# $ +# $) +# target_compile_features(cartesian_impedance_controller PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 + +# install(TARGETS cartesian_impedance_controller +# DESTINATION lib/${PROJECT_NAME}) + +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 + set(ament_cmake_cpplint_FOUND TRUE) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package() diff --git a/rbs_controllers/cartesian_impedance_controller/include/cartesian_impedance_controller/cartesian_impedance_controller.hpp b/rbs_controllers/cartesian_impedance_controller/include/cartesian_impedance_controller/cartesian_impedance_controller.hpp new file mode 100644 index 0000000..0560abb --- /dev/null +++ b/rbs_controllers/cartesian_impedance_controller/include/cartesian_impedance_controller/cartesian_impedance_controller.hpp @@ -0,0 +1,39 @@ +#include +#include +#include +#include + +namespace cartesian_impedance_controller +{ + +class CartesianImpedanceController : +public cartesian_motion_controller::CartesianMotionController, +public cartesian_force_controller::CartesianForceController +{ + public: + CartesianImpedanceController(); + + virtual LifecycleNodeInterface::CallbackReturn on_init() override; + + rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_configure( + const rclcpp_lifecycle::State & previous_state) override; + rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_activate( + const rclcpp_lifecycle::State & previous_state) override; + rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_deactivate( + const rclcpp_lifecycle::State & previous_state) override; + controller_interface::return_type update(const rclcpp::Time & time, const rclcpp::Duration & period) override; + + using Base = cartesian_controller_base::CartesianControllerBase; + using MotionBase = cartesian_motion_controller::CartesianMotionController; + using ForceBase = cartesian_force_controller::CartesianForceController; + + private: + ctrl::Vector6D computeImpedance(); + ctrl::Matrix6D m_stiffness; + ctrl::Matrix6D m_damping; + std::string m_compliance_ref_link; + + +}; + +} \ No newline at end of file diff --git a/rbs_controllers/cartesian_impedance_controller/package.xml b/rbs_controllers/cartesian_impedance_controller/package.xml new file mode 100644 index 0000000..5a81605 --- /dev/null +++ b/rbs_controllers/cartesian_impedance_controller/package.xml @@ -0,0 +1,18 @@ + + + + cartesian_impedance_controller + 0.0.0 + TODO: Package description + bill-finger + TODO: License declaration + + ament_cmake + + ament_lint_auto + ament_lint_common + + + ament_cmake + + diff --git a/rbs_controllers/cartesian_impedance_controller/src/cartesian_impedance_controller.cpp b/rbs_controllers/cartesian_impedance_controller/src/cartesian_impedance_controller.cpp new file mode 100644 index 0000000..aa9a431 --- /dev/null +++ b/rbs_controllers/cartesian_impedance_controller/src/cartesian_impedance_controller.cpp @@ -0,0 +1,14 @@ +#include "cartesian_controller_base/Utility.h" +#include "controller_interface/controller_interface.hpp" +#include + +namespace cartesian_impedance_controller +{ +CartesianImpedanceController::CartesianImpedanceController() +: Base::CartesianControllerBase(), +MotionBase::CartesianMotionController(), +ForceBase::CartesianForceController() +{ +} + +} \ No newline at end of file diff --git a/rbs_simulation/launch/simulation.launch.py b/rbs_simulation/launch/simulation.launch.py index 37423fb..1470229 100644 --- a/rbs_simulation/launch/simulation.launch.py +++ b/rbs_simulation/launch/simulation.launch.py @@ -43,18 +43,18 @@ def generate_launch_description(): PythonLaunchDescriptionSource( [os.path.join(get_package_share_directory('ros_gz_sim'), 'launch', 'gz_sim.launch.py')]), - launch_arguments=[('ign_args', [' -r ',world_config_file, " -s"])], + launch_arguments=[('gz_args', [' -r ',world_config_file, " -s"])], condition=UnlessCondition(gazebo_gui)) gazebo = IncludeLaunchDescription( PythonLaunchDescriptionSource( [os.path.join(get_package_share_directory('ros_gz_sim'), 'launch', 'gz_sim.launch.py')]), - launch_arguments=[('ign_args', [' -r ',world_config_file])], + launch_arguments=[('gz_args', [' -r ',world_config_file])], condition=IfCondition(gazebo_gui)) # Spawn robot - gazebo_spawn_robot = Node(package='ros_ign_gazebo', executable='create', + gazebo_spawn_robot = Node(package='ros_gz_sim', executable='create', arguments=[ '-name', rbs_robot_type, '-x', '0.0', diff --git a/rbs_simulation/mujoco_model/current_mj.xml b/rbs_simulation/mujoco_model/current_mj.xml index 465d8f3..d978eae 100644 --- a/rbs_simulation/mujoco_model/current_mj.xml +++ b/rbs_simulation/mujoco_model/current_mj.xml @@ -2,6 +2,9 @@ + + + @@ -11,6 +14,8 @@ + + -- 2.49.0 From ecb179d95d290c05653f6f3038049560dbcd40b3 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Thu, 17 Aug 2023 14:57:18 +0300 Subject: [PATCH 02/15] update scenaries --- rbs_bringup/launch/bringup.launch.py | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/rbs_bringup/launch/bringup.launch.py b/rbs_bringup/launch/bringup.launch.py index 0545b75..07b2cf6 100644 --- a/rbs_bringup/launch/bringup.launch.py +++ b/rbs_bringup/launch/bringup.launch.py @@ -45,15 +45,8 @@ def generate_launch_description(): declared_arguments.append( DeclareLaunchArgument( "controllers_file", - default_value="ur_controllers.yaml", - description="YAML file with the controllers configuration.", - ) - ) - declared_arguments.append( - DeclareLaunchArgument( - "controllers_with_gripper_file", default_value="ur_plus_gripper_controllers.yaml", - description="YAML file with the UR + gripper_controller configuration.", + description="YAML file with the controllers configuration.", ) ) declared_arguments.append( -- 2.49.0 From 478cde4e3200da7e14446543a236ae44e3ae40c5 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Thu, 17 Aug 2023 15:05:46 +0300 Subject: [PATCH 03/15] add ft sensor broadcaster --- README.md | 2 +- rbs.repos | 10 +++++++--- rbs_bringup/launch/bringup.launch.py | 2 +- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index cb576cf..48cfdc1 100644 --- a/README.md +++ b/README.md @@ -27,7 +27,7 @@ git clone https://gitlab.com/robosphere/robossembler-ros2 vcs import . < robossembler-ros2/rbs.repos cd .. rosdep install -y -r -q --from-paths src --ignore-src --rosdistro humble -colcon build --packages-skip cartesian_controller_simulation cartesian_controller_tests --cmake-args -DCMAKE_BUILD_TYPE=Release --symlink-install +colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --symlink-install ``` For simulation with Mujoco, pls [ref](https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers/blob/fdaa9a2dd0ce15fc949b127dd1164095504273fb/cartesian_controller_simulation/README.md) build and install section. diff --git a/rbs.repos b/rbs.repos index 379d37e..7941836 100644 --- a/rbs.repos +++ b/rbs.repos @@ -15,7 +15,11 @@ repositories: type: git url: https://github.com/solid-sinusoid/ros2_robotiq_gripper.git version: dev - cartesian_controllers: + # cartesian_controllers: + # type: git + # url: https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers.git + # version: ros2 + gz_ros2_control: type: git - url: https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers.git - version: ros2 \ No newline at end of file + url: https://github.com/solid-sinusoid/gz_ros2_control.git + version: ft-sensor-broadcaster \ No newline at end of file diff --git a/rbs_bringup/launch/bringup.launch.py b/rbs_bringup/launch/bringup.launch.py index 07b2cf6..21cbe73 100644 --- a/rbs_bringup/launch/bringup.launch.py +++ b/rbs_bringup/launch/bringup.launch.py @@ -119,7 +119,7 @@ def generate_launch_description(): ) ) declared_arguments.append( - DeclareLaunchArgument("with_gripper", default_value="false", description="With gripper or not?") + DeclareLaunchArgument("with_gripper", default_value="true", description="With gripper or not?") ) declared_arguments.append( DeclareLaunchArgument("launch_rviz", default_value="true", description="Launch RViz?") -- 2.49.0 From 653890491c3b1c24ce6bda22a3da99d5df6cd124 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Wed, 23 Aug 2023 16:48:10 +0300 Subject: [PATCH 04/15] add ft sensor plugin to sdf --- rbs_simulation/worlds/mir.sdf | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/rbs_simulation/worlds/mir.sdf b/rbs_simulation/worlds/mir.sdf index d658131..30eccd0 100644 --- a/rbs_simulation/worlds/mir.sdf +++ b/rbs_simulation/worlds/mir.sdf @@ -12,7 +12,8 @@ ogre2 - + + 0 0 -9.8 6e-06 2.3e-05 -4.2e-05 @@ -54,7 +55,7 @@ true true - + true @@ -264,7 +265,7 @@ -0.9 0 0.6250 0 0 0 --> - + + + + + + + + + + + + diff --git a/rbs_bt_executor/bt_trees/example_skills/move_to_pose.xml b/rbs_bt_executor/bt_trees/example_skills/move_to_pose.xml new file mode 100644 index 0000000..8715ab5 --- /dev/null +++ b/rbs_bt_executor/bt_trees/example_skills/move_to_pose.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + diff --git a/rbs_bt_executor/bt_trees/example_skills/move_to_pose_array.xml b/rbs_bt_executor/bt_trees/example_skills/move_to_pose_array.xml new file mode 100644 index 0000000..c9e3414 --- /dev/null +++ b/rbs_bt_executor/bt_trees/example_skills/move_to_pose_array.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/rbs_bt_executor/bt_trees/test_tree.xml b/rbs_bt_executor/bt_trees/test_tree.xml index 8e11ecc..79b71fa 100644 --- a/rbs_bt_executor/bt_trees/test_tree.xml +++ b/rbs_bt_executor/bt_trees/test_tree.xml @@ -6,7 +6,7 @@ + robot_name="rbs_arm" /> -- 2.49.0 From ed6d163e5ba8b2c053dd8ad6828f40a49d3b087c Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Thu, 8 Feb 2024 17:40:55 +0300 Subject: [PATCH 07/15] remove extra packages --- .../CMakeLists.txt | 35 ----------------- .../cartesian_impedance_controller.hpp | 39 ------------------- .../package.xml | 18 --------- .../src/cartesian_impedance_controller.cpp | 14 ------- 4 files changed, 106 deletions(-) delete mode 100644 rbs_controllers/cartesian_impedance_controller/CMakeLists.txt delete mode 100644 rbs_controllers/cartesian_impedance_controller/include/cartesian_impedance_controller/cartesian_impedance_controller.hpp delete mode 100644 rbs_controllers/cartesian_impedance_controller/package.xml delete mode 100644 rbs_controllers/cartesian_impedance_controller/src/cartesian_impedance_controller.cpp diff --git a/rbs_controllers/cartesian_impedance_controller/CMakeLists.txt b/rbs_controllers/cartesian_impedance_controller/CMakeLists.txt deleted file mode 100644 index c3b26f4..0000000 --- a/rbs_controllers/cartesian_impedance_controller/CMakeLists.txt +++ /dev/null @@ -1,35 +0,0 @@ -cmake_minimum_required(VERSION 3.8) -project(cartesian_impedance_controller) - -if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") - add_compile_options(-Wall -Wextra -Wpedantic) -endif() - -# find dependencies -find_package(ament_cmake REQUIRED) -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) - -# add_executable(cartesian_impedance_controller src/cartesian_impedance_controller.cpp) -# target_include_directories(cartesian_impedance_controller PUBLIC -# $ -# $) -# target_compile_features(cartesian_impedance_controller PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 - -# install(TARGETS cartesian_impedance_controller -# DESTINATION lib/${PROJECT_NAME}) - -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 - set(ament_cmake_cpplint_FOUND TRUE) - ament_lint_auto_find_test_dependencies() -endif() - -ament_package() diff --git a/rbs_controllers/cartesian_impedance_controller/include/cartesian_impedance_controller/cartesian_impedance_controller.hpp b/rbs_controllers/cartesian_impedance_controller/include/cartesian_impedance_controller/cartesian_impedance_controller.hpp deleted file mode 100644 index 0560abb..0000000 --- a/rbs_controllers/cartesian_impedance_controller/include/cartesian_impedance_controller/cartesian_impedance_controller.hpp +++ /dev/null @@ -1,39 +0,0 @@ -#include -#include -#include -#include - -namespace cartesian_impedance_controller -{ - -class CartesianImpedanceController : -public cartesian_motion_controller::CartesianMotionController, -public cartesian_force_controller::CartesianForceController -{ - public: - CartesianImpedanceController(); - - virtual LifecycleNodeInterface::CallbackReturn on_init() override; - - rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_configure( - const rclcpp_lifecycle::State & previous_state) override; - rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_activate( - const rclcpp_lifecycle::State & previous_state) override; - rclcpp_lifecycle::node_interfaces::LifecycleNodeInterface::CallbackReturn on_deactivate( - const rclcpp_lifecycle::State & previous_state) override; - controller_interface::return_type update(const rclcpp::Time & time, const rclcpp::Duration & period) override; - - using Base = cartesian_controller_base::CartesianControllerBase; - using MotionBase = cartesian_motion_controller::CartesianMotionController; - using ForceBase = cartesian_force_controller::CartesianForceController; - - private: - ctrl::Vector6D computeImpedance(); - ctrl::Matrix6D m_stiffness; - ctrl::Matrix6D m_damping; - std::string m_compliance_ref_link; - - -}; - -} \ No newline at end of file diff --git a/rbs_controllers/cartesian_impedance_controller/package.xml b/rbs_controllers/cartesian_impedance_controller/package.xml deleted file mode 100644 index 5a81605..0000000 --- a/rbs_controllers/cartesian_impedance_controller/package.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - cartesian_impedance_controller - 0.0.0 - TODO: Package description - bill-finger - TODO: License declaration - - ament_cmake - - ament_lint_auto - ament_lint_common - - - ament_cmake - - diff --git a/rbs_controllers/cartesian_impedance_controller/src/cartesian_impedance_controller.cpp b/rbs_controllers/cartesian_impedance_controller/src/cartesian_impedance_controller.cpp deleted file mode 100644 index aa9a431..0000000 --- a/rbs_controllers/cartesian_impedance_controller/src/cartesian_impedance_controller.cpp +++ /dev/null @@ -1,14 +0,0 @@ -#include "cartesian_controller_base/Utility.h" -#include "controller_interface/controller_interface.hpp" -#include - -namespace cartesian_impedance_controller -{ -CartesianImpedanceController::CartesianImpedanceController() -: Base::CartesianControllerBase(), -MotionBase::CartesianMotionController(), -ForceBase::CartesianForceController() -{ -} - -} \ No newline at end of file -- 2.49.0 From dc628f1387b4cf94bbe818c049757ce992292599 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Thu, 15 Feb 2024 19:46:32 +0300 Subject: [PATCH 08/15] add launch arguments for gazebo Added gazebo gui argument and arguments to start without controllers --- rbs_bringup/config/rbs.rviz | 281 +++++++++++---------------- rbs_bringup/launch/bringup.launch.py | 22 ++- 2 files changed, 134 insertions(+), 169 deletions(-) diff --git a/rbs_bringup/config/rbs.rviz b/rbs_bringup/config/rbs.rviz index df9e15c..3f2dc2f 100644 --- a/rbs_bringup/config/rbs.rviz +++ b/rbs_bringup/config/rbs.rviz @@ -6,9 +6,8 @@ Panels: Expanded: - /Global Options1 - /TF1/Frames1 - - /MarkerArray2 Splitter Ratio: 0.49496981501579285 - Tree Height: 981 + Tree Height: 985 - Class: rviz_common/Selection Name: Selection - Class: rviz_common/Tool Properties @@ -76,62 +75,37 @@ Visualization Manager: Expand Link Details: false Expand Tree: false Link Tree Style: Links in Alphabetic Order - base: - Alpha: 1 - Show Axes: false - Show Trail: false base_link: Alpha: 1 Show Axes: false Show Trail: false - base_link_inertia: + Value: true + ee_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - flange: - Alpha: 1 - Show Axes: false - Show Trail: false - forearm_link: + fork0_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - ft_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - inner_rgbd_camera: + fork1_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - outer_rgbd_camera: + fork2_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - schunk_grasp_point: - Alpha: 1 - Show Axes: false - Show Trail: false - schunk_gripper_base_link: + main0_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - schunk_l_finger_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - schunk_r_finger_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - shoulder_link: + main1_link: Alpha: 1 Show Axes: false Show Trail: false @@ -140,77 +114,37 @@ Visualization Manager: Alpha: 1 Show Axes: false Show Trail: false - upper_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true world: Alpha: 1 Show Axes: false Show Trail: false - wrist_1_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wrist_2_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wrist_3_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true Robot Alpha: 1 Show Robot Collision: false - Show Robot Visual: true + Show Robot Visual: false Value: true - Class: rviz_default_plugins/TF Enabled: true Frame Timeout: 15 Frames: All Enabled: false - base: - Value: false base_link: Value: false - base_link_inertia: - Value: false - flange: - Value: false - forearm_link: - Value: false - ft_frame: - Value: false - inner_rgbd_camera: - Value: false - outer_rgbd_camera: - Value: false - schunk_grasp_point: + ee_link: Value: true - schunk_gripper_base_link: + fork0_link: Value: true - schunk_l_finger_link: + fork1_link: Value: true - schunk_r_finger_link: + fork2_link: + Value: true + main0_link: + Value: true + main1_link: Value: true - shoulder_link: - Value: false tool0: Value: false - upper_arm_link: - Value: false world: Value: false - wrist_1_link: - Value: false - wrist_2_link: - Value: false - wrist_3_link: - Value: false Marker Scale: 0.4000000059604645 Name: TF Show Arrows: true @@ -219,30 +153,14 @@ Visualization Manager: Tree: world: base_link: - base: - {} - base_link_inertia: - shoulder_link: - upper_arm_link: - forearm_link: - wrist_1_link: - wrist_2_link: - wrist_3_link: - flange: - tool0: - inner_rgbd_camera: - {} - schunk_grasp_point: - {} - schunk_gripper_base_link: - schunk_l_finger_link: - {} - schunk_r_finger_link: - {} - ft_frame: - {} - outer_rgbd_camera: - {} + fork0_link: + main0_link: + fork1_link: + main1_link: + fork2_link: + ee_link: + tool0: + {} Update Interval: 0 Value: true - Class: moveit_rviz_plugin/Trajectory @@ -255,62 +173,37 @@ Visualization Manager: Expand Link Details: false Expand Tree: false Link Tree Style: Links in Alphabetic Order - base: - Alpha: 1 - Show Axes: false - Show Trail: false base_link: Alpha: 1 Show Axes: false Show Trail: false - base_link_inertia: + Value: true + ee_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - flange: - Alpha: 1 - Show Axes: false - Show Trail: false - forearm_link: + fork0_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - ft_frame: - Alpha: 1 - Show Axes: false - Show Trail: false - inner_rgbd_camera: + fork1_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - outer_rgbd_camera: + fork2_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - schunk_grasp_point: - Alpha: 1 - Show Axes: false - Show Trail: false - schunk_gripper_base_link: + main0_link: Alpha: 1 Show Axes: false Show Trail: false Value: true - schunk_l_finger_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - schunk_r_finger_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - shoulder_link: + main1_link: Alpha: 1 Show Axes: false Show Trail: false @@ -319,30 +212,10 @@ Visualization Manager: Alpha: 1 Show Axes: false Show Trail: false - upper_arm_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true world: Alpha: 1 Show Axes: false Show Trail: false - wrist_1_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wrist_2_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true - wrist_3_link: - Alpha: 1 - Show Axes: false - Show Trail: false - Value: true Loop Animation: false Name: Trajectory Robot Alpha: 0.5 @@ -368,6 +241,84 @@ Visualization Manager: Reliability Policy: Reliable Value: workspace Value: true + - Class: rviz_default_plugins/InteractiveMarkers + Enable Transparency: true + Enabled: true + Interactive Markers Namespace: /motion_controller_handle + Name: InteractiveMarkers + Show Axes: false + Show Descriptions: true + Show Visual Aids: false + Value: true + - Alpha: 1 + Class: rviz_default_plugins/RobotModel + Collision Enabled: false + Description File: "" + Description Source: Topic + Description Topic: + Depth: 5 + Durability Policy: Volatile + History Policy: Keep Last + Reliability Policy: Reliable + Value: /robot_description + Enabled: true + Links: + All Links Enabled: true + Expand Joint Details: false + Expand Link Details: false + Expand Tree: false + Link Tree Style: Links in Alphabetic Order + base_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + ee_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + fork0_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + fork1_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + fork2_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + main0_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + main1_link: + Alpha: 1 + Show Axes: false + Show Trail: false + Value: true + tool0: + Alpha: 1 + Show Axes: false + Show Trail: false + world: + Alpha: 1 + Show Axes: false + Show Trail: false + Mass Properties: + Inertia: false + Mass: false + Name: RobotModel + TF Prefix: "" + Update Interval: 0 + Value: true + Visual Enabled: true Enabled: true Global Options: Background Color: 48; 48; 48 @@ -414,7 +365,7 @@ Visualization Manager: Views: Current: Class: rviz_default_plugins/Orbit - Distance: 6.619869709014893 + Distance: 2.528358221054077 Enable Stereo Rendering: Stereo Eye Separation: 0.05999999865889549 Stereo Focal Distance: 1 @@ -429,10 +380,10 @@ Visualization Manager: Invert Z Axis: false Name: Current View Near Clip Distance: 0.009999999776482582 - Pitch: 0.5753980875015259 + Pitch: 0.5803980827331543 Target Frame: Value: Orbit (rviz) - Yaw: 1.1453965902328491 + Yaw: 1.0903966426849365 Saved: ~ Window Geometry: Displays: @@ -440,7 +391,7 @@ Window Geometry: Height: 1385 Hide Left Dock: false Hide Right Dock: false - QMainWindow State: 000000ff00000000fd00000004000000000000025f000004cdfc020000000cfb0000001200530065006c0065006300740069006f006e00000001e10000009b000000b000fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000006e000004cd0000018200fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000032c000002170000000000000000fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000003c005400720061006a006500630074006f007200790020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000007a00ffffff000000010000015f000004cdfc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073010000006e000004cd0000013200fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d006501000000000000045000000000000000000000052d000004cd00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 + QMainWindow State: 000000ff00000000fd00000004000000000000025f000004cffc020000000cfb0000001200530065006c0065006300740069006f006e00000001e10000009b000000af00fffffffb0000001e0054006f006f006c002000500072006f007000650072007400690065007302000001ed000001df00000185000000a3fb000000120056006900650077007300200054006f006f02000001df000002110000018500000122fb000000200054006f006f006c002000500072006f0070006500720074006900650073003203000002880000011d000002210000017afb000000100044006900730070006c006100790073010000006d000004cf0000018000fffffffb0000002000730065006c0065006300740069006f006e00200062007500660066006500720200000138000000aa0000023a00000294fb00000014005700690064006500530074006500720065006f02000000e6000000d2000003ee0000030bfb0000000c004b0069006e0065006300740200000186000001060000030c00000261fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000032c000002170000000000000000fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000000000000000fb0000003c005400720061006a006500630074006f007200790020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000007800ffffff0000000100000166000004cffc0200000003fb0000001e0054006f006f006c002000500072006f00700065007200740069006500730100000041000000780000000000000000fb0000000a00560069006500770073000000006d000004cf0000012f00fffffffb0000001200530065006c0065006300740069006f006e010000025a000000b200000000000000000000000200000490000000a9fc0100000001fb0000000a00560069006500770073030000004e00000080000002e10000019700000003000004420000003efc0100000002fb0000000800540069006d00650100000000000004420000000000000000fb0000000800540069006d0065010000000000000450000000000000000000000698000004cf00000004000000040000000800000008fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000 Selection: collapsed: false Tool Properties: @@ -450,5 +401,5 @@ Window Geometry: Views: collapsed: false Width: 2307 - X: 436 - Y: 66 + X: 507 + Y: 315 diff --git a/rbs_bringup/launch/bringup.launch.py b/rbs_bringup/launch/bringup.launch.py index 3ee0c77..7e5fe2b 100644 --- a/rbs_bringup/launch/bringup.launch.py +++ b/rbs_bringup/launch/bringup.launch.py @@ -1,4 +1,4 @@ -from launch import LaunchDescription +from launch import LaunchDescription, condition from launch.actions import ( DeclareLaunchArgument, IncludeLaunchDescription, @@ -141,6 +141,16 @@ def generate_launch_description(): default_value="gazebo", description="Choose your harware_interface") ) + declared_arguments.append( + DeclareLaunchArgument("launch_controllers", + default_value="true", + description="Launch controllers?") + ) + declared_arguments.append( + DeclareLaunchArgument("gazebo_gui", + default_value="false", + description="Launch gazebo with gui?") + ) # Initialize Arguments rbs_robot_type = LaunchConfiguration("rbs_robot_type") # General arguments @@ -163,7 +173,8 @@ def generate_launch_description(): sim_gazebo = LaunchConfiguration("sim_gazebo") hardware = LaunchConfiguration("hardware") env_manager = LaunchConfiguration("env_manager") - + launch_controllers = LaunchConfiguration("launch_controllers") + gazebo_gui = LaunchConfiguration("gazebo_gui") initial_joint_controllers_file_path = PathJoinSubstitution( [FindPackageShare(description_package), "config", controllers_file] @@ -241,7 +252,8 @@ def generate_launch_description(): 'initial_joint_controller': initial_joint_controller, 'controllers_file': controllers_file, "cartesian_controllers": cartesian_controllers - }.items()) + }.items(), + condition=IfCondition(launch_controllers)) simulation = IncludeLaunchDescription( PythonLaunchDescriptionSource([ @@ -253,8 +265,10 @@ def generate_launch_description(): ]), launch_arguments={ 'sim_gazebo': sim_gazebo, + 'gazebo_gui': gazebo_gui, 'rbs_robot_type': rbs_robot_type, - 'env_manager': env_manager + 'env_manager': env_manager, + 'debugger': "false" }.items(), condition=IfCondition(launch_simulation)) -- 2.49.0 From 899805973d475e6fb58453a8cc1c6c7a3c5bc6b9 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Thu, 15 Feb 2024 19:48:48 +0300 Subject: [PATCH 09/15] add tree nodes model to other file ThreeNodesModels had move to general.xml which contain lib for groot --- .../bt_trees/example_skills/move_to_pose.xml | 4 +- .../bt_trees/nodes_interfaces/general.xml | 51 +++++++++++++++++++ rbs_bt_executor/bt_trees/test_tree.xml | 30 ++--------- 3 files changed, 58 insertions(+), 27 deletions(-) create mode 100644 rbs_bt_executor/bt_trees/nodes_interfaces/general.xml diff --git a/rbs_bt_executor/bt_trees/example_skills/move_to_pose.xml b/rbs_bt_executor/bt_trees/example_skills/move_to_pose.xml index 8715ab5..54db9b6 100644 --- a/rbs_bt_executor/bt_trees/example_skills/move_to_pose.xml +++ b/rbs_bt_executor/bt_trees/example_skills/move_to_pose.xml @@ -2,7 +2,7 @@ @@ -10,7 +10,7 @@ - + diff --git a/rbs_bt_executor/bt_trees/nodes_interfaces/general.xml b/rbs_bt_executor/bt_trees/nodes_interfaces/general.xml new file mode 100644 index 0000000..50d7f6d --- /dev/null +++ b/rbs_bt_executor/bt_trees/nodes_interfaces/general.xml @@ -0,0 +1,51 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rbs_bt_executor/bt_trees/test_tree.xml b/rbs_bt_executor/bt_trees/test_tree.xml index 79b71fa..6e59ee7 100644 --- a/rbs_bt_executor/bt_trees/test_tree.xml +++ b/rbs_bt_executor/bt_trees/test_tree.xml @@ -24,33 +24,13 @@ + + - - - - - - - - - - - - - - - - - - - - - - - - - + -- 2.49.0 From a211c198caaf07ff99e916f6592a358cc14b0c23 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Fri, 16 Feb 2024 15:21:59 +0300 Subject: [PATCH 10/15] rename default assembly config name in code --- env_manager/gz_enviroment/src/gz_enviroment.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/env_manager/gz_enviroment/src/gz_enviroment.cpp b/env_manager/gz_enviroment/src/gz_enviroment.cpp index 89432c7..0a8d3c6 100644 --- a/env_manager/gz_enviroment/src/gz_enviroment.cpp +++ b/env_manager/gz_enviroment/src/gz_enviroment.cpp @@ -41,7 +41,7 @@ CallbackReturn GzEnviroment::on_configure(const rclcpp_lifecycle::State &) { m_topic_name = std::string("/world/") + m_world_name + "/dynamic_pose/info"; m_service_spawn = std::string("/world/") + m_world_name + "/create"; m_config_loader = std::make_shared( - "asp-example2", getNode()); + "asp-example", getNode()); m_follow_frames = m_config_loader->getSceneModelNames(); // m_target_places = std::make_shared(); m_transforms = m_config_loader->getTfData("bishop"); @@ -92,8 +92,6 @@ CallbackReturn GzEnviroment::on_deactivate(const rclcpp_lifecycle::State &) { // TODO: Check to do this via EntityComponentManager void GzEnviroment::onGzPoseSub(const gz::msgs::Pose_V &pose_v) { - // TODO: Read from config - // m_follow_frames = {"box1", "box2", "box3", "box4", "box5", "box6"}; std::vector all_transforms{}; for (const auto &it : pose_v.pose()) { -- 2.49.0 From 5e14dc00a2d455767c7766defe57f80d157771c7 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Fri, 16 Feb 2024 15:22:34 +0300 Subject: [PATCH 11/15] clang-format move to pose array skill --- rbs_bt_executor/src/MoveToPoseArray.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rbs_bt_executor/src/MoveToPoseArray.cpp b/rbs_bt_executor/src/MoveToPoseArray.cpp index ed7a1ce..4d2ce81 100644 --- a/rbs_bt_executor/src/MoveToPoseArray.cpp +++ b/rbs_bt_executor/src/MoveToPoseArray.cpp @@ -30,7 +30,8 @@ public: goal.target_pose = target_pose_vec_.poses.at(0); target_pose_vec_.poses.erase(target_pose_vec_.poses.begin()); - setOutput("pose_vec_out", target_pose_vec_); + setOutput("pose_vec_out", + target_pose_vec_); } else { RCLCPP_WARN(_node->get_logger(), "Target pose vector empty"); } @@ -39,11 +40,10 @@ public: } static BT::PortsList providedPorts() { - return providedBasicPorts({ - BT::InputPort("robot_name"), - BT::InputPort("pose_vec_in"), - BT::OutputPort("pose_vec_out") - }); + return providedBasicPorts( + {BT::InputPort("robot_name"), + BT::InputPort("pose_vec_in"), + BT::OutputPort("pose_vec_out")}); } private: -- 2.49.0 From 77fa543e78d9105e60b1df40e7fd85d0095ca880 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Fri, 16 Feb 2024 15:23:20 +0300 Subject: [PATCH 12/15] improve gazebo arguments added debugger --- rbs_simulation/launch/simulation.launch.py | 79 ++++++++++++++-------- 1 file changed, 51 insertions(+), 28 deletions(-) diff --git a/rbs_simulation/launch/simulation.launch.py b/rbs_simulation/launch/simulation.launch.py index a3835ae..03efd4e 100644 --- a/rbs_simulation/launch/simulation.launch.py +++ b/rbs_simulation/launch/simulation.launch.py @@ -12,27 +12,38 @@ from ament_index_python.packages import get_package_share_directory def generate_launch_description(): declared_arguments = [] declared_arguments.append( - DeclareLaunchArgument("sim_gazebo", default_value="false", description="Gazebo Simulation") + DeclareLaunchArgument("sim_gazebo", + default_value="false", + description="Gazebo Simulation") ) declared_arguments.append( - DeclareLaunchArgument( - "rbs_robot_type", - description="Type of robot by name", - choices=["rbs_arm" ,"ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e"], - default_value="rbs_arm", - ) + DeclareLaunchArgument("rbs_robot_type", + description="Type of robot by name", + choices=["rbs_arm" ,"ur3", "ur3e", "ur5", "ur5e", "ur10", "ur10e", "ur16e"], + default_value="rbs_arm",) ) declared_arguments.append( - DeclareLaunchArgument("env_manager", default_value="false", description="Launch env_manager?") + DeclareLaunchArgument("env_manager", + default_value="false", + description="Launch env_manager?") ) declared_arguments.append( - DeclareLaunchArgument("gazebo_gui", default_value="false", description="Launch env_manager?") + DeclareLaunchArgument("gazebo_gui", + default_value="true", + description="Launch env_manager?") + ) + declared_arguments.append( + DeclareLaunchArgument("debugger", + default_value="false", + description="launch Gazebo with debugger?") ) sim_gazebo = LaunchConfiguration("sim_gazebo") rbs_robot_type = LaunchConfiguration("rbs_robot_type") env_manager_cond = LaunchConfiguration("env_manager") gazebo_gui = LaunchConfiguration("gazebo_gui") + debugger = LaunchConfiguration("debugger") + # FIXME: To args when we'll have different files # TODO: Use global variable to find world file in robossembler_db world_config_file = PathJoinSubstitution( @@ -44,31 +55,38 @@ def generate_launch_description(): PythonLaunchDescriptionSource( [os.path.join(get_package_share_directory('ros_gz_sim'), 'launch', 'gz_sim.launch.py')]), - launch_arguments=[('gz_args', [' -r ',world_config_file, " -s"])], + launch_arguments={ + 'gz_args': [' -r ',world_config_file, " -s"], + "debugger": debugger, + }.items(), condition=UnlessCondition(gazebo_gui)) gazebo = IncludeLaunchDescription( PythonLaunchDescriptionSource( [os.path.join(get_package_share_directory('ros_gz_sim'), 'launch', 'gz_sim.launch.py')]), - launch_arguments=[('gz_args', [' -r ',world_config_file])], + launch_arguments={ + 'gz_args': [' -r ',world_config_file], + "debugger": debugger, + }.items(), condition=IfCondition(gazebo_gui)) # Spawn robot - gazebo_spawn_robot = Node(package='ros_gz_sim', executable='create', - arguments=[ - '-name', rbs_robot_type, - '-x', '0.0', - '-z', '0.0', - '-y', '0.0', - '-topic', '/robot_description'], - output='screen', - condition=IfCondition(sim_gazebo)) + gazebo_spawn_robot = Node( + package='ros_gz_sim', + executable='create', + arguments=[ + '-name', rbs_robot_type, + '-x', '0.0', + '-z', '0.0', + '-y', '0.0', + '-topic', '/robot_description'], + output='screen', + condition=IfCondition(sim_gazebo)) env_manager = Node(package="env_manager", executable="run_env_manager", - condition=IfCondition(env_manager_cond) - ) - + condition=IfCondition(env_manager_cond)) + # Bridge rgbd_bridge_out = Node( package='ros_gz_bridge', @@ -80,8 +98,7 @@ def generate_launch_description(): '/outer_rgbd_camera/points@sensor_msgs/msg/PointCloud2@gz.msgs.PointCloudPacked' ], output='screen', - condition=IfCondition(sim_gazebo) - ) + condition=IfCondition(sim_gazebo)) rgbd_bridge_in = Node( package='ros_gz_bridge', @@ -93,9 +110,14 @@ def generate_launch_description(): '/inner_rgbd_camera/points@sensor_msgs/msg/PointCloud2@gz.msgs.PointCloudPacked' ], output='screen', - ) - + condition=IfCondition(sim_gazebo)) + clock_bridge = Node( + package='ros_gz_bridge', + executable='parameter_bridge', + arguments=['/clock@rosgraph_msgs/msg/Clock[ignition.msgs.Clock'], + output='screen', + condition=IfCondition(sim_gazebo)) nodes_to_start = [ gazebo, @@ -103,6 +125,7 @@ def generate_launch_description(): gazebo_spawn_robot, env_manager, rgbd_bridge_out, - rgbd_bridge_in + rgbd_bridge_in, + clock_bridge, ] return LaunchDescription(declared_arguments + nodes_to_start) -- 2.49.0 From 9cdd6d1d142363098a8f758293ead0b5a08556c6 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Fri, 16 Feb 2024 15:23:38 +0300 Subject: [PATCH 13/15] correct workspace inspercor behavior --- rbs_utils/src/rbs_utils.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/rbs_utils/src/rbs_utils.cpp b/rbs_utils/src/rbs_utils.cpp index 45db08f..ba92706 100644 --- a/rbs_utils/src/rbs_utils.cpp +++ b/rbs_utils/src/rbs_utils.cpp @@ -349,10 +349,10 @@ AssemblyConfigLoader::getWorkspaceInspectorTrajectory() { if (json.contains("workspace")) { auto workspace = readWorkspaceJson(json); for (auto &point : workspace.transforms) { - geometry_msgs::msg::Pose pose; - pose = transformTrajectory(point); + auto pose = transformTrajectory(point); pose_array.poses.push_back(pose); } + pose_array.poses.push_back(transformTrajectory(workspace.transforms[0])); } } return pose_array; @@ -361,9 +361,9 @@ AssemblyConfigLoader::getWorkspaceInspectorTrajectory() { geometry_msgs::msg::Pose AssemblyConfigLoader::transformTrajectory( const geometry_msgs::msg::TransformStamped &pose) { auto pose_eigen = tf2::transformToEigen(pose.transform); - Eigen::AngleAxisd rotation(M_PI, Eigen::Vector3d::UnitX()); + Eigen::AngleAxisd rotation(M_PI, Eigen::Vector3d::UnitY()); pose_eigen.rotate(rotation); - pose_eigen.translation().z() += 0.5; + pose_eigen.translation().z() += 0.35; auto pose_msg = tf2::toMsg(pose_eigen); return pose_msg; } -- 2.49.0 From ccd9fd9a75c1ee0de5eff96ff7254207c5230d4d Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Fri, 16 Feb 2024 20:09:05 +0300 Subject: [PATCH 14/15] move repos and update README --- README.md | 15 +++++++++++---- repos/cartesian_controllers.repos | 13 +++++++++++++ rbs.real.repos => repos/real.repos | 4 ---- repos/sim.rbs.repos | 13 +++++++++++++ rbs.sim.repos => repos/sim.ur.repos | 4 ---- 5 files changed, 37 insertions(+), 12 deletions(-) create mode 100644 repos/cartesian_controllers.repos rename rbs.real.repos => repos/real.repos (81%) create mode 100644 repos/sim.rbs.repos rename rbs.sim.repos => repos/sim.ur.repos (80%) diff --git a/README.md b/README.md index fd10f98..f3277de 100644 --- a/README.md +++ b/README.md @@ -26,20 +26,27 @@ Prepare workspace & install dependencies (So far only tested with UR robot arm) ```bash mkdir -p ~/robossembler_ws/src && cd ~/robossembler_ws/src git clone https://gitlab.com/robosphere/robossembler-ros2 -vcs import . < robossembler-ros2/rbs.sim.repos +vcs import . < robossembler-ros2/repos/sim.rbs.repos cd .. rosdep install -y -r -q --from-paths src --ignore-src --rosdistro humble colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --symlink-install ``` - + +Additionally, if you want to use Cartesian controllers, such as stiffness or others, you need to execute the following: +``` +# in directory robossembler_ws/src +vcs import . < robossembler-ros2/repos/cartesian_controllers.repos +``` +This will also install `ros2_control` and `gz_ros2_control` as packages, so it is recommended to delete global packages if they have been installed. ### Set Gazebo enviroment variables Replace `[WS_FOLDER]` with your workspace folder ```bash -echo "export IGN_GAZEBO_RESOURCE_PATH=${IGN_GAZEBO_RESOURCE_PATH}:~/[WS_FOLDER]/install/robotiq_description/share/:~/[WS_FOLDER]/install/rbs_simulation/share/rbs_simulation/" >> ~/.bashrc +echo "export IGN_GAZEBO_RESOURCE_PATH=${IGN_GAZEBO_RESOURCE_PATH}:~/[WS_FOLDER]/install/rbs_simulation/share/rbs_simulation/" >> ~/.bashrc +# or if you have alredy built the workspace +echo "export IGN_GAZEBO_RESOURCE_PATH=${IGN_GAZEBO_RESOURCE_PATH}:~/$(ros2 pkg prefix rbs_simulation)/share/rbs_simulation/" >> ~/.bashrc ``` - ### Examples Activate current ROS2 enviroment: ``` diff --git a/repos/cartesian_controllers.repos b/repos/cartesian_controllers.repos new file mode 100644 index 0000000..a7429cc --- /dev/null +++ b/repos/cartesian_controllers.repos @@ -0,0 +1,13 @@ +repositories: + cartesian-controllers: + type: git + url: https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers.git + version: ros2 + ros2_control: + type: git + url: https://github.com/solid-sinusoid/gz_ros2_control.git + version: gz-ros2-cartesian-controllers + gz_ros2_control: + type: git + url: https://github.com/solid-sinusoid/gz_ros2_control.git + version: pass-robot-description diff --git a/rbs.real.repos b/repos/real.repos similarity index 81% rename from rbs.real.repos rename to repos/real.repos index 8cc8183..7968965 100644 --- a/rbs.real.repos +++ b/repos/real.repos @@ -15,7 +15,3 @@ repositories: type: git url: https://gitlab.com/robossembler/arm-tools/urdf-model-shrunk-gripper-egp-40-n-n-b.git version: 2-add-ros2-control - gz_ros2_control: - type: git - url: https://github.com/solid-sinusoid/gz_ros2_control.git - version: ft-sensor-broadcaster \ No newline at end of file diff --git a/repos/sim.rbs.repos b/repos/sim.rbs.repos new file mode 100644 index 0000000..a875501 --- /dev/null +++ b/repos/sim.rbs.repos @@ -0,0 +1,13 @@ +repositories: + rbs_arm: + type: git + url: https://github.com/solid-sinusoid/rbs-arm.git + version: main + rbs_gripper: + type: git + url: https://github.com/solid-sinusoid/rbs-gripper.git + version: main + behavior_tree: + type: git + url: https://github.com/solid-sinusoid/behavior_tree.git + version: master diff --git a/rbs.sim.repos b/repos/sim.ur.repos similarity index 80% rename from rbs.sim.repos rename to repos/sim.ur.repos index 17cbd05..e939e90 100644 --- a/rbs.sim.repos +++ b/repos/sim.ur.repos @@ -15,7 +15,3 @@ repositories: type: git url: https://gitlab.com/robossembler/arm-tools/urdf-model-shrunk-gripper-egp-40-n-n-b.git version: 2-add-ros2-control - gz_ros2_control: - type: git - url: https://github.com/solid-sinusoid/gz_ros2_control.git - version: ft-sensor-broadcaster -- 2.49.0 From e6623c38123964c73bb68c09b010ffe7315e57a8 Mon Sep 17 00:00:00 2001 From: Bill Finger Date: Fri, 16 Feb 2024 22:18:52 +0300 Subject: [PATCH 15/15] update ci due to the repos file being moved --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 483fc04..307cb16 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -26,7 +26,7 @@ build-colcon-job: - mv * .src/robossembler-ros2 - mv .git .src/robossembler-ros2 - mv .src src - - vcs import src < src/robossembler-ros2/rbs.sim.repos + - vcs import src < src/robossembler-ros2/repos/sim.rbs.repos - rosdep install -y -r -q --from-paths src --ignore-src --rosdistro humble - colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release rules: -- 2.49.0