Skip to content

Conversation

@benediktkreis
Copy link

@benediktkreis benediktkreis commented Feb 11, 2022

Hi,

this is my first contribution to ROS2. So please forgive me if I have made any mistakes.

I have tried to run ros2 launch ur_simulation_ignition ur_sim_moveit.launch.py, but it did not work. The following command is working in my setup with the following code changes.

My setup

ROS2 version: Galactic
Ignition version: Fortress
Moveit2 version: Binary install for ROS2 Galactic

Command

Example command to launch Moveit and Ignition with UR5e model:
ros2 launch ur_simulation_ignition ur_sim_moveit.launch.py ur_type:=ur5e

Code changes

  • ur_moveit.launch.py was added from ur_bringup, because there is no launch file with this name in the ur_moveit_config and to set use_sim_time=True in the parameters of the move_group_node. I am not sure why this package was changed in #1
  • update_rate in ur_controllers.yaml was set to 1000 Hz to get rid of Ignition warning: "Desired controller update period (0.002 s) is slower than the gazebo simulation period (0.001 s).".
  • Position control with ign_ros2_control only works with the galactic branch (see bug fix #29).
  • delay_rviz_after_joint_state_broadcaster_spawner in ur_sim_control.launch.py caused the launching of 2 RVIZ windows. So I have removed it.

Output

UR5e_Ignition_Moveit

Copy link
Contributor

@destogl destogl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for testing this repository and for your contribution!

We are currently having a PR with a changed MoveIt file in the "Driver" repository open. Sorry I was too fast with merging changes when I was enabling MoveIt. I testing this directly with the mentioned branch.

To have Ignition correctly working with MoveIt I had to fix the following in MoveIt2.

I am not sure why is this working for you at all. Nevertheless, it is great first step to make this repo nice and clean. Please consider my comments below.

@@ -0,0 +1,377 @@
# Copyright (c) 2021 PickNik, Inc.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should use file from the "Driver" repository. It will get merged here: UniversalRobots/Universal_Robots_ROS2_Driver#278

It would be great if you could also test this repos with that PR and give us a feedback there if it worked for you.

Copy link
Author

@benediktkreis benediktkreis Feb 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've tested the update-simplify-moveit-file branch. In general it works, but I had to do some modifications, because it doesn't work with the scaled_joint_trajectory_controller. The joint_trajectory_controller has to be set as default in the controllers.yaml. I guess the scaled one is not supported by the ign_ros2_control plugin. That is why I've copied the ur_moveit.launch.py and the controllers.yaml with the one from your branch and modified them accordingly. Furthermore, without the robot_description_planning in ur_moveit.launch.py it isn't possible to plan a path using the drag function ("virtual ball" at the end effector) in RVIZ, I could just plan using predefined goal states like "home", "up" and "test_configuration".

Hint: I didn't use your Moveit2 branch #1014, because I had problems building it. That's why I've sticked to the binary version for Galactic.

ign_ros2_control:
type: git
url: https://github.com/ignitionrobotics/ign_ros2_control.git
version: main
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No problem :)

],
)

# ros_ign_bridge (clock -> ROS 2)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this needed?

Copy link
Author

@benediktkreis benediktkreis Feb 15, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Otherwise the /clock topic isn't populated which is used e.g. by the robot_state_publisher (see attached screenshot from rqt_graph) resulting in an error message such as this one:
[rviz2-9] [WARN] [1644917311.649767236] [moveit_ros.planning_scene_monitor.planning_scene_monitor]: Maybe failed to update robot state, time diff: 1644917299.652s

rqt_graph_clock_cropped

The solution is inspired by Andrej Orsula's repository panda_ign_moveit2

ur_moveit_launch = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
[FindPackageShare("ur_moveit_config"), "/launch", "/ur_moveit.launch.py"]
[FindPackageShare("ur_simulation_ignition"), "/launch", "/ur_moveit.launch.py"]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please test with the above-mentioned branch.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has been tested, see other comment.

@benediktkreis
Copy link
Author

Hi @destogl, what do you think about my last commits and comments? Are further adjustments required?

@fmauch
Copy link

fmauch commented Apr 15, 2024

Hi, we haven't been giving this repository a lot of attention recently. We are currently in the process of making things work again. Currently, Humble and Iron (Provided the description is built from source ATM) should be working, the version from #7 should work on Rolling. All tested with the default GZ version.

Therefore, I would go ahead and close this, as I guess this would be included / supersed by the latest changes. Feel free to comment / reopen if you think otherwise.

@fmauch fmauch closed this Apr 15, 2024
mrjogo pushed a commit to mrjogo/Universal_Robots_ROS2_GZ_Simulation that referenced this pull request May 11, 2024
* Updating ur_robot_driver include guards and namespaces

* Compile the ros_control plugin, inherit from components::SystemInterface

* Do away with intermediate SystemInterface class

* Implement configure()

* Add controller_manager launch file

* Cleanup and clang format
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants