Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dual arm tutorial for ROS2 #3

Draft
wants to merge 16 commits into
base: main
Choose a base branch
from

Conversation

ShahhhVihaan
Copy link

This draft PR addresses issue #1 regarding a dual arm example setup. It introduces three packages that perform the following functions:

  1. my_dual_robot_cell_description : Creates a custom workcell with two UR3 arms named alice and bob.
  2. my_dual_robot_cell_control: Contains launchfiles to start the communication and control of the robots. Uses one control manager handling controllers for both the arms.
  3. my_dual_robot_moveit_config: Sets up the moveit configuration with the help of MoveItSetupAssistant and MoveItConfigsBuilder.

This has been tested successfully on two UR3 arms. Here's the ROS graph for the same:
Dual arm with real hardware and moveit

I need to clean up the packages and write tutorial documentation before it is ready to merge.

ShahhhVihaan and others added 16 commits June 24, 2024 12:49
- Add ros2 control tags/parameters for each robot arm
- Some parameters are specific to each arm and some common to both
- Ports and IP different for each arm
- RTDE scripts, mock hardware, headless mode common to the arms
- Instantiates one controller manager for both arms and passes the controller configs and update rate
- Receives the robot_description param from the robot_description_topic (robot_state_publisher)
- Does not yet implement io_and_status_controller and forward_velocity_controller
- Has functionality to spawn and stop controllers for both arms
- Only works in simulation and not with real hardware
- Limited number of launch parameters as of now
@fmauch fmauch linked an issue Jul 4, 2024 that may be closed by this pull request
@eladpar
Copy link

eladpar commented Jul 4, 2024

First, Thank you for your contribution.
can you please share your setup? ( what ubuntu, ros2 , UR_driver & Description commits etc...)
iv'e been trying to deploy this on humble with a few adaptations with out much luck
(ur.ros2_control take from ur_description instead of ur_driver, change mock to fake, and take car of kinematics paramters_file)

@ShahhhVihaan
Copy link
Author

@eladpar I am working on a local Ubuntu 22.04 system, using ROS2 Rolling. I have installed the Universal Robots (UR) driver via source installation following the instructions provided here.

@ShahhhVihaan
Copy link
Author

@eladpar, I recommend ensuring you pass all the parameters for ros2_control for both arms in your description. In the Humble version of ur_description, the ur_macro.xacro contains the ros2_control tags, unlike in Rolling. Once you have configured these parameters, you can refer to the my_dual_robot_cell/my_dual_robot_cell_control/config/combined_controllers.yaml file, which defines controllers for both arms. In your driver launch file, try spawning the controllers using only the ros2_control_node (comment out everything else). Once that works, you can continue testing and gradually add all the other nodes and functions.

@ShahhhVihaan
Copy link
Author

@fmauch Once this PR has been merged do you think we can make a branch for humble? I'd be willing to make the tutorials.

@eladpar
Copy link

eladpar commented Jul 9, 2024

Tried today operating the 2 robots with ros2 rolling ubuntu 24.
seems like there might be an issue maybe because it e-series..

  1. I ran
ros2 launch my_dual_robot_cell_control  start_robots.launch.py  alice_ur_type:=ur16e bob_ur_type:=ur16e alice_robot_ip:=192.168.1.102 bob_robot_ip:=192.168.1.103 

but seems like when I try to run the program on the UR pendent It gets stuck at starting program, and this is the messege I get on pc:
Screenshot from 2024-07-09 12-57-24
Screenshot from 2024-07-09 12-57-34

  1. I ran with headless mode and one of the robot starts to move suddenly ( and the moveit isn't really executing trajectories..)
ros2 launch my_dual_robot_cell_control  start_robots.launch.py  alice_ur_type:=ur16e bob_ur_type:=ur16e alice_robot_ip:=192.168.1.102 bob_robot_ip:=192.168.1.103 headless_mode:=true

@ShahhhVihaan
Copy link
Author

ShahhhVihaan commented Jul 10, 2024

@eladpar Do the external control custom ports match the script sender ports in here?

On a side note for my curiosity: did the controllers launch correctly? You can look at my rqt_graph above to compare.

@ShahhhVihaan
Copy link
Author

@fmauch Can you suggest how I can write the docs (reST documentation). Do you have a Sphinx workflow for the same?

Copy link
Collaborator

@fmauch fmauch left a comment

Choose a reason for hiding this comment

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

Sorry for not coming back on this earlier. I appreciate your efforts very much @ShahhhVihaan. I'll review this bit by bit in order to make it easier to find time slots for reviewing.

So far, I have been looking a the description which looks very good, overall. Please see my comments on suggestions for improvements.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I think it might be good, to re-use the files from the custom_workcell. Simply add a dependency on my_custom_workcell and reference the files from there.

<!-- The UR background wall (meshes/ur_background.jpg)constitutes “Graphical Documentation” the use of which is subject to and governed by our “Terms and Conditions for use of Graphical Documentation”, which can be found here: https://www.universal-robots.com/legal/terms-and-conditions/terms_and_conditions_for_use_of_graphical_documentation.txt -->
<license file="UR_LICENSE.txt">Universal Robots A/S’ Terms and Conditions for Use of Graphical Documentation</license>

<author email="[email protected]">Felix Durchdewald</author>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe you would like to add yourself there, instead of Felix Durchdewald ;-)

<joint name="base_to_alice_robot_mount" type="fixed">
<parent link="table"/>
<child link="alice_robot_mount"/>
<origin xyz="0.3 0.85 0" rpy="0 0 ${pi}" />
Copy link
Collaborator

Choose a reason for hiding this comment

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

Maybe the placement isn't ideal since it is right behind the computer screen on the table.

@fmauch
Copy link
Collaborator

fmauch commented Sep 18, 2024

@fmauch Can you suggest how I can write the docs (reST documentation). Do you have a Sphinx workflow for the same?

Basically, I think you can do things similar to the my_robot_cell package. I'll try to fix building the doc in this package, also for CI so you can use that.


Edit: See #7

@fmauch fmauch self-requested a review September 25, 2024 19:58
Copy link
Collaborator

@fmauch fmauch left a comment

Choose a reason for hiding this comment

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

Second round of reviewing, this time the control package.

Comment on lines +3 to +7
alice_joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

bob_joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
Copy link
Collaborator

Choose a reason for hiding this comment

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

Only one joint_state_broadcaster should be sufficient.

Suggested change
alice_joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
bob_joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster
joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

@@ -0,0 +1,3 @@
controller_manager:
ros__parameters:
update_rate: 125 # Hz
Copy link
Collaborator

Choose a reason for hiding this comment

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

Could we please default to an e-series robot?

Suggested change
update_rate: 125 # Hz
update_rate: 500 # Hz

"ur20",
"ur30",
],
default_value="ur3",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
default_value="ur3",
default_value="ur3e",

"ur20",
"ur30",
],
default_value="ur3",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
default_value="ur3",
default_value="ur3e",

DeclareLaunchArgument(
"alice_robot_ip",
default_value="192.168.0.101",
description="IP address by which the robot can be reached.",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
description="IP address by which the robot can be reached.",
description="IP address by which alice can be reached.",

DeclareLaunchArgument(
"bob_mock_sensor_commands",
default_value="false",
description="Enable mock command interfaces for sensors used for simple simulations. "
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
description="Enable mock command interfaces for sensors used for simple simulations. "
description="Enable mock command interfaces for bob's sensors used for simple simulations. "

condition=UnlessCondition(bob_use_mock_hardware),
)

alice_controller_stopper_node = Node(
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should probably contain all controllers from the other robot, well?

Comment on lines +163 to +164
"alice_joint_state_broadcaster",
"bob_joint_state_broadcaster",
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
"alice_joint_state_broadcaster",
"bob_joint_state_broadcaster",
"joint_state_broadcaster",

return nodes_to_start


def generate_launch_description():
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please see rsp.launch.py for comments on launch arguments.

<name>my_dual_robot_cell_control</name>
<version>1.0.0</version>
<description>ros2_control setup</description>
<maintainer email="[email protected]">Felix Durchdewald</maintainer>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please add yourself as an author and use me as a maintainer.

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.

Write multi (dual) arm tutorial for ROS 2
3 participants