Skip to content

add z launch argument - #130

Open
v8p1197 wants to merge 2 commits into
UniversalRobots:ros2from
unisa-acg:ros2
Open

add z launch argument#130
v8p1197 wants to merge 2 commits into
UniversalRobots:ros2from
unisa-acg:ros2

Conversation

@v8p1197

@v8p1197 v8p1197 commented Apr 27, 2026

Copy link
Copy Markdown

This PR introduces a new launch argument to spawn the robot in Gazebo at a custom z height.

@urfeex

urfeex commented Apr 28, 2026

Copy link
Copy Markdown
Member

Could you elaborate a bit on the motivation and effects of this, please?

@v8p1197

v8p1197 commented Apr 28, 2026

Copy link
Copy Markdown
Author

@urfeex Hi, thank you for the quick comment.

This parameter allows to spawn the robot at a certain height in Gazebo, so that users can build a custom scene in which the robot moves below its base.

In the basic usage of the modified launch file (i.e., when this parameter is not specified), the robot spawns on the Gazebo ground as it was before.

Without this PR, AFAIK users cannot set this manually via Gazebo GUI or services, so the parameter is necessary to do what described.

Look, for instance, what happens with this video or this one.
This PR makes it possible to build such scenes in Gazebo.

Please let me know if you have any additional questions :)

@urfeex

urfeex commented Apr 28, 2026

Copy link
Copy Markdown
Member

But wouldn't you usually do that using a custom URDF to put the robot to another place wrt the world?

image

Using the z argument of spawning the xacro in GZ will effectively make the ROS environment and GZ environment diverge:
image

@v8p1197

v8p1197 commented Apr 28, 2026

Copy link
Copy Markdown
Author

Yes, but wouldn't this require to re-define from scratch the whole URDF?
Honestly this would be quite uncomfortable, and modularity would be compromised.
The original URDF file hardcodes the origin w.r.t. world to be the identity, as seen here.
Would it be better to add new xyz/rpy URDF arguments to let the users re-define only the origin w.r.t. world?

@urfeex

urfeex commented Apr 28, 2026

Copy link
Copy Markdown
Member

The URDF in this repository should be seen as an example. A robot in an empty world. With real-world applications, users should specify their own URDF.

Given the use-case you provided, you also would not like the robot to learn a policy where it can reach beneath itself, where in real world there would be a pillar.

@v8p1197

v8p1197 commented Apr 28, 2026

Copy link
Copy Markdown
Author

The URDF in this repository should be seen as an example. A robot in an empty world. With real-world applications, users should specify their own URDF.

I agree on this.
I was just suggesting that introducing arguments to let the users choose the origin w.r.t. a parent link would make this task easier.

Given the use-case you provided, you also would not like the robot to learn a policy where it can reach beneath itself, where in real world there would be a pillar.

True.
This would be solved with the solution above, i.e. defining new arguments in the base UR macro, thus creating a new modular URDF.

In case you find this useful, I can re-target this PR to implement this.

@urfeex

urfeex commented Apr 28, 2026

Copy link
Copy Markdown
Member

As written above, we see this package's URDF as an example. Therefore, I would like to avoid opening up paths repurposing this URDF in scenarios that it is not designed for. I'll discuss that in the team, though.

@v8p1197

v8p1197 commented Apr 28, 2026

Copy link
Copy Markdown
Author

Thank you for your feedback, @urfeex.

I'll discuss that in the team, though.

Great! If possible, I'll be glad to receive updates on this here.

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.

2 participants