complex urdf files
How do most people end up creating their complex urdf and sdf files? Most of the tutorials I see edit the xml in their text editor of choice.
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
How do most people end up creating their complex urdf and sdf files? Most of the tutorials I see edit the xml in their text editor of choice.
I would recommend either using the ros1 xacro (a bit clanky in my opinion) or to use some templating language like Jinja2 or empy, both of which are independent of ros/ros2. The advantages of using jinja2 or empy are that you can specify templates with parameters, and then use those templates as many times as you want. You can also include other template files into a new template.
Using a robotic arm for example, you could create a single "segment" template that creates a hing, with a rigid arm on the other end. The "segment" template would need to be parameterized such that you can specify where to attach the hing, and how long the segment is, etc. Then you can create a new "Arm" template that pulls in multiple "segment" templates to build up a arm with several segments.
Once you have a template, you can write a python script that renders the urdf, and spits it out to be spawned by gazebo.
The "segment" template would need to be parameterized such that you can specify where to attach the hing, and how long the segment is, etc. Then you can create a new "Arm" template that pulls in multiple "segment" templates to build up a arm with several segments.
like how xacro
does this, you mean ? ;)
As an example of using empy
, see the way (the) O(S)R(F) created the worlds and parts for the ARIAC challenge: osrf/ariac/src/osrf_gear/worlds/gear.world.template. It's just one example, but does illustrate the idea.
Correct. I've used Jinja2 in the past to create urdfs where each sensor type (gps, imu, camera, etc) was it's own template. When I needed to test a new sensor configuration, I could just include that template, and pass it the correct parameters of where to mount the sensor, frequency to publish data, topic to publish on, noise parameters, etc. It worked quite well.
Which again is exactly how it works with xacro
:)
Not saying using something else cannot be beneficial, just making sure it's clear that that is not much different from how xacro
works. See ubi-agni/human_hand/model/human_hand.urdf.xacro for an example.
I'm surprised that everyone seems to prefer defining their models in code
you have a sample size of 2 here (at least here on ROS Answers).
And this is coming from a community that consists of a lot of programmers.
rather than using some CAD tool that exports the model to the format of choice.
that would be nice, but:
..
I'm not dismissing using more high-level modeling tools for this (and in fact, they are being used, see fi sw_urdf_exporter and dfki-ric/phobos), it's just that in an environment that is so code heavy/centric, being able to generate models from parametric descriptions fits the overall development workflow a bit better.
All in my opinion of course.
Asked: 2019-07-11 11:10:32 -0500
Seen: 396 times
Last updated: Jul 12 '19
Is there a release date of ros 2 or more informations about it?
Is the planned ROS1 to ROS2/DDS bridge available yet?
ROS2: content-based topic subscriptions?
Building Ros 2.0 without OpenCV?
ros2 rttest example build error
ROS 2 Alpha 2 ros1_bridge using DDS between two computers