Hello all,
I'm working on a gazebo simulation for multiple husky robots and I'm running into some problems with my tf tree.
To set up the simulation, I'm launching each robot in a unique namespace with a matching tf prefix. This works great for separating out ROS topics and most of the transforms, however, I'm having issues with the plugins for my odometry and IMU. The issues I'm having seem to be because the frame_id of the plugins called from the .xacro file do not inherit the tf_prefix of the launch file that called them.
Here's an example:
For the default simulation with one robot, the topic **imu/data** is broadcast and has the **frame_id: base_link**. When wrapped in the namespace and tf_prefix, I can edit the parameter to make the topic **huksy1/imu/data**. But I can't seem to change the frame id to be **frame_id: husky1/base_link**.
Does anyone have an idea on how this could be done?
Thanks all!
↧
Changing tf_prefix for a gazebo plugin?
↧
Clearpath Husky customized configuration not showing up
So I followed http://wiki.ros.org/husky_bringup/Tutorials/Customize%20Husky%20Configuration. I and ended up with this file **husky_customization/husky_custom_description/urdf/custom_description.urdf.xacro**:
The visualization works just fine if I run everything on my laptop via **roslaunch husky_viz view_robot.launch**. It DOES NOT work on the actual Husky. The arch and the camera do not show up. I see that **base.launch** calls **description.launch** which references the **HUSKY_DESCRIPTION** var. Strangely enough, this var is set correctly:
$ echo $HUSKY_DESCRIPTION
/src/husky_customization/husky_custom_description/urdf/custom_description.urdf.xacro
But when I call **rosparam get /robot_description** the returned URDF does not contain my custom description. There is no transform published for the arch/camera and the arch does not show up in rviz. What am I doing wrong?
↧
↧
create a laser in xacro
Who can give me a simple example my_robot.xacro file that creat a robot which has a laser.
I donot knoe how to add a laser and I try to use the .gazebo/models/hoyuko(model),but it is sdf,it maybe cannot use in xacro.
Thank you very much.
This is the robot.xacro without a laser.Gazebo/Green false Gazebo/Blue Gazebo/Black Gazebo/Black Gazebo/Black Gazebo/Black
↧
Creating world file for Gazebo with xacro
I'm trying to generate random boxes in a world file for Gazebo simulator. I know how to create a model sdf, and how to include it from the world file.
Now I want to create different sizes of boxes in the world file using xacro and width/height parameters.
I can't get it work. Please help :)
↧
Problem with urdf_tutorial
Hi All,
I am going through the urdf [tutorials](http://wiki.ros.org/urdf/Tutorials/Building%20a%20Visual%20Robot%20Model%20with%20URDF%20from%20Scratch) but have run into a problem. I got to Materials before running into this error:
Traceback (most recent call last):
File "/opt/ros/indigo/share/xacro/xacro.py", line 62, in
xacro.main()
File "/opt/ros/indigo/lib/python2.7/dist-packages/xacro/__init__.py", line 673, in main
f = open(args[0])
IOError: [Errno 2] No such file or directory: 'urdf/04-materials.urdf'
Invalid tag: Cannot load command parameter [robot_description]: command [/opt/ros/indigo/share/xacro/xacro.py urdf/04-materials.urdf] returned with code [1].
Param xml is
The traceback for the exception was written to the log file
The file does exist and I'm not even using xacro yet. The weirdest part is I was able to get the first 3 files to work (myfirst, multiple, and origins) without this issue, but now they give me the same error and won't run. I've seen a few similar issues here and people say to go through the xml in the xacro file, but as I've said I don't have one. Anyone know why this is happening?
[EDIT] After finding that the master and indigo branches of the urdf_tutorial package are different on github, I deleted the master and downloaded the indigo version. This got rid of the xacro issue but still tells me that the file doesn't exist. This happens with both `roslaunch urdf_tutorial display.launch model:=urdf/04-materials.urdf` from the package path as shown in the tutorial and when using `roslaunch urdf_tutorial display.launch model:='$(find urdf_tutorial)/urdf/04-materials.urdf'`. The full error message is shown below:
Traceback (most recent call last):
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/__init__.py", line 307, in main
p.start()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 268, in start
self._start_infrastructure()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 217, in _start_infrastructure
self._load_config()
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/parent.py", line 132, in _load_config
roslaunch_strs=self.roslaunch_strs, verbose=self.verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/config.py", line 451, in load_config_default
loader.load(f, config, verbose=verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 730, in load
self._load_launch(launch, ros_config, is_core=core, filename=filename, argv=argv, verbose=verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 702, in _load_launch
self._recurse_load(ros_config, launch.childNodes, self.root_context, None, is_core, verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 646, in _recurse_load
self._param_tag(tag, context, ros_config, verbose=verbose)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 95, in call
return f(*args, **kwds)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/xmlloader.py", line 264, in _param_tag
value = self.param_value(verbose, name, ptype, *vals)
File "/opt/ros/indigo/lib/python2.7/dist-packages/roslaunch/loader.py", line 463, in param_value
with open(textfile, 'r') as f:
IOError: [Errno 2] No such file or directory: u'/home/ros/catkin_ws/src/urdf_tutorial-indigo/urdf/04-materials.urdf'
↧
↧
Variable object's position in .world file- Gazebo
Hi, I would like to specify the position of an object in a scene from a text file. Let's say I want a beer at position x,y,z, > beer: x,y,z
Consider the following world file which creates a ground plane, the sun, a gaz station and a beer.
**mybot.world**
model://ground_plane model://sun model://beer beer -10 -8 0 0 0 0 model://gas_station gas_station -2.0 7.0 0 0 0 0
This is my launch file **benz_empty.launch**
The launch command:
> roslaunch mybot_gazebo benz_empty.launch
How do I use variables in a .world file?
↧
For URDF files what alternatives to xml are there?
I find that working directly with XML is unpleasant at best. What alternatives exist for creating URDF files either graphically or otherwise?
What I have found so far:
- [SimMechanics to
URDF](https://github.com/robotology/simmechanics-to-urdf)
- [SW URDF](http://wiki.ros.org/sw_urdf_exporter)
↧
How to view xacro in graphiz
You can use urdf_to_graphiz to quickly check your URDF's links. How do you do this directly with an Xacro file?
Currently, you have to directly convert it first, but this is a little clunky:
rosrun xacro xacro.py -o mybot.urdf mybot.urdf.xacro
urdf_to_graphiz mybot.urdf
↧
How to create Omniwheel base URDF
Hello all,
for my project i had to create a robotic base for manipulators equipped with the omniwheels (the same of the youbot base for example), i create the cad in Adobe Inventor and extract the stl file. Now I want to create the Urdf then the xacro for using it in rviz and gazebo. I read some tutorials but is not really clear how i have to do for creating a model working in ros.
is some one who can help and suggest me some good tricks ??
thanks in advance

↧
↧
How to use conditional includes in xacro?
Hi all!
When I'm using if-conditions in xacro like the example below, the substitution macro ($(find.... )) of the xacro:include statement will be evaluated independent of the if-result causing errors when the package is missing.
I intend to have optional packages included which are not available by default. For this purpose I expected to use xacro:if analogously as the if-statement in launch files to enable or disable parts of the xacro file.
Is there a proper way to model such things?
(I'm using ROS Indigo with Ubuntu 14.04.)
Thanks!
↧
Calculating inertial matrix for Gazebo
I am having issues following the [tutorial](http://gazebosim.org/tutorials?tut=inertia&cat=build_robot) to calculate the inertial matrix for my [gripper](http://imgur.com/TqhzRGy). [This](https://youtu.be/ptbETRjvyqc) is the behaviour I see. I am able to successfully create a config package with PR2 gripper, so I am pretty sure it is because of the inertial matrix.
In Meshlab, following are the values I get at no-scale:
Mesh Bounding Box Size 0.164416 0.063248 0.077500
Mesh Bounding Box Diag 0.192456
Mesh Volume is 0.000214
Mesh Surface is 0.089074
Thin shell barycenter -0.040913 -0.000254 0.039031
Center of Mass is -0.041006 -0.000043 0.037458
Inertia Tensor is :
| 0.000000 -0.000000 0.000000 |
| -0.000000 0.000001 0.000000 |
| 0.000000 0.000000 0.000000 |
Principal axes are :
| 0.938629 0.011849 0.344725 |
| 0.004914 0.998849 -0.047710 |
| -0.344893 0.046476 0.937491 |
axis momenta are :
| 0.000000 0.000001 0.000001 |
For a scale of 100, following are the values I get :
Mesh Bounding Box Size 16.441637 6.324847 7.750000
Mesh Bounding Box Diag 19.245613
Mesh Volume is 214.333633
Mesh Surface is 890.744385
Thin shell barycenter -4.091284 -0.025389 3.903062
Center of Mass is -4.100575 -0.004325 3.745764
Inertia Tensor is :
| 1597.194946 -17.950985 1307.758423 |
| -17.950985 5213.373047 9.511752 |
| 1307.758423 9.511752 4675.780273 |
Principal axes are :
| 0.938629 0.011848 0.344725 |
| 0.004914 0.998849 -0.047710 |
| -0.344893 0.046475 0.937491 |
axis momenta are :
| 1116.573364 5213.602539 5156.172363 |
How do I use these values? I didn't quite understand the scaling part of the tutorial.
Also, ideally, shouldn't the simulation work when I consider the gripper to be almost weightless?
A unity matrix or the above value as well gives the same behaviour as in the video.
**Edit 1:**
I have tested the macro mentioned by @Stefan Kohlbrecher. Also, I divided the inertia matrix given by Meshlab by volume which gives me :
Still I observe the same behaviour. Does Gazebo need the inertia matrix wrt origin or wrt center of mass?
**Edit 2:**
@MarioSelvaggio 's solution seems to work perfectly fine. The arm is stable and I am also able to plan and execute trajectories. But the solution only works when in my final urdf file I translate the gripper :
Observe that the sign of `origin xyz` has been inverted. Here's how it looks: http://i.imgur.com/7hE8OdD.png
For rest of the cases, the simulation remains unstable. What is happening here?
**Edit 3:**
OK some trial and error later, I almost got it working. http://i.imgur.com/yycvWKE.png. There's still a small misalignment, but for now I can live with that.
↧
Composing complex robots: xacro or static_tf_publisher?
I am composing a robot that consists of several independent parts (for example, a robot hand mounted on an arm).
So far, my "assembly" procedure has been a mix of two approaches:
1. Create a single xacro file that includes other xacro files (for each robot), and define a link between them. This results in a single `/robot_description` parameter
2. Load two robots into their own namespaces (e.g., `arm/robot_description` and `hand/robot_description`), then define a transform using `static_transform_publisher`.
What is considered the best style for doing a complex assemblage of robots? Note that here I'm talking about linking multiple components into a single robot, not multiple independent robots.
↧
What is wrong with my xacro file that I can't see the color of the box in gazebo?
Here is my xacro file:0 0
I want box to be of yellow color but I can't see in Yellow color in gazebo. How should I fix it?
↧
↧
Loading SDF instead of URDF with ROS Packages (like robot_description)
Using ROS Indigo and Gazebo 2.2 on Ubuntu 14.04
I have created a model for a robot that is similar to Clearpath's Jackal. What I am trying to do is have the already-created Jackal packages apply to my robot model. In other words, I am trying to substitute the model of Clearpath's Jackal with my robot model so that Clearpath's Jackal packages can apply to my model.
The robot I made is in SDF while the packages for Clearpath's jackal reference and use URDF/XACRO. Does anyone know if it is possible to implement the SDF files and/or remove the URDF/XACRO files from the packages so that the Clearpath's Jackal's packages would apply to my model? If it is possible, what would be the best implementation process?
↧
Making a graph of the robot links of Xacro file
Hello,
I would like to know if there is a way to make a graph like [this](http://wiki.ros.org/urdf?action=AttachFile&do=get&target=graphiz.png) from a Xacro file. It is explained that it is possible from URDF with the URDF_to_graphiz. However, it doesn't work with Xacro.
I tried converting it to a URDF file, but that left me with nothing but transmissions from ROS control. Is there any way that is it possible?
↧
Can't use slidebar of joint_state_publisher window in Rviz
I've created a xacro file for my robot arm and successfully visualized it in Rviz with the display.launch launchfile from the urdf_tutorials package. However, i can't slide left or right with the slidebar to control the joint movements in the joint_state_publisher GUI window, the only thing I can click is the randomize button below the slide bars. The robot is then moving accordingly, so I think there is no problem with my xacro file.
I have to mention though that I haven't included collision and inertia tags in the xacro file yet, could this be the reason?
Can anyone tell me why I can't use those slidebars, or how I can fix this problem?
Thanks a lot!! :)
↧
Parse error when using a xacro property loaded through a yaml file.
Environment: Ubuntu 16, ROS Kinetic.
I have a robot_parameters.yaml file with robot parameters:
wheel_separation : 0.235
PI : 3.142
In a xacro file I have:
When I do a --check-order on the xacro, I get the following error:
unsupported operand type(s) for /: 'dict' and 'int'
when evaluating expression 'PI/2'
XacroException(None,)
How would I use an imported name(in this case, PI) via yaml and use it for xacro calculations.
↧
↧
Adding revolute joint makes the wheels disappear
Hello,
I am trying to create a 2 wheel mobile robot using xacro file.. I followed the tutorials when using SDF and I convert it to xacro and I have two links for the wheels and two joints of type revolute. when I add the revolute joints and I run the launch file I cant see the wheels on gazebo .. I have the following tags for the joints ?? is there any thing wrong ?? also, is it the right way to have a revolute joints of 2 wheels robot ??
↧
ros-by-example vol2. roslaunch in CH4 xacro error
*ros-by-example vol2.*
*CH4 CREATING A URDF MODEL FOR YOUR ROBOT*
**The command line is shown below:**
$ roslaunch rbx2_description box_robot_base_only.launch
**The error message is shown below:**
root@ShawnVM:~/catkin_ws/src/rbx2/rbx2_dynamixels# roslaunch rbx2_description box_robot_base_only.launch
... logging to /root/.ros/log/0d82b658-a196-11e6-9533-000c290a3fdb/roslaunch-ShawnVM-48840.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
Invalid tag: xacro
ROS path [0]=/opt/ros/indigo/share/ros
ROS path [1]=/root/catkin_ws/src
ROS path [2]=/opt/ros/indigo/share
ROS path [3]=/opt/ros/indigo/stacks.
Arg xml is
The traceback for the exception was written to the log file
↧
Why there are two origin in defining xacro:macro link
Hi,
I am following the tutorial about urdf. In example 08-xacro, I don't understand why when defining the xacro:macro for a link/visual tag, there are two origin tags before and after geometry tags.
Thank you very much for your help.
↧