[UUV Simulator] Including robot into a Gazebo world
Hey everyone,
(I'm a beginner to ROS, Gazebo and UUV Simulator) I am doing the tutorial of UUV Simulator and in the section "Configuring the thruster manager for a new vehicle" I am getting the following error when I try to include my vehicle into the world:
baqueiro@baqueiro-Latitude-E6430:~/catkin_ws$ roslaunch baqtronic_description upload.launch
... logging to /home/baqueiro/.ros/log/136ecaac-5522-11e8-9ca6-f01faf1d30a4/roslaunch-baqueiro-Latitude-E6430-12866.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.
xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
XML parsing error: not well-formed (invalid token): line 4, column 8
when processing file: /home/baqueiro/catkin_ws/src/baqtronic_description/urdf/snippets.xacro
included from: /home/baqueiro/catkin_ws/src/baqtronic_description/urdf/base.xacro
included from: /home/baqueiro/catkin_ws/src/baqtronic_description/robots/default.xacro
Check that:
- Your XML is well-formed
- You have the xacro xmlns declaration: xmlns:xacro="http://www.ros.org/wiki/xacro"
Invalid <param> tag: Cannot load command parameter [robot_description]: command [/opt/ros/kinetic/share/xacro/xacro.py '/home/baqueiro/catkin_ws/src/baqtronic_description/robots/default.xacro' debug:=0 namespace:=baqtronic] returned with code [2].
Param xml is <param command="$(find xacro)/xacro.py '$(find baqtronic_description)/robots/$(arg mode).xacro' debug:=$(arg debug) namespace:=$(arg namespace)" name="robot_description"/>
The traceback for the exception was written to the log file
I'm using ROS Kinetic and Gazebo 9. Can anyone help me? Thanks in advance :)
Edit: Below my snippets.xacro:
<?xml version="1.0"?>
<!--------------------------------------------------------------------------> <!-- MACRO FOR THRUSTER UNITS --> <!-------------------------------------------------------------------------->
<!-- Provide the propeller mesh in a separate file with the rotation axis
over propeller's frame X-axis in DAE (Collada) or STL format.
-->
<!--
Thruster macro with integration of joint and link. The thrusters should
be initialized in the actuators.xacro file.
-->
<!--
Dummy link as place holder for the thruster frame,
since thrusters can often be inside the collision geometry
of the vehicle and may cause internal collisions if set otherwise
-->
<link name="${robot_namespace}/thruster_${thruster_id}">
<visual>
<geometry>
<mesh filename="${prop_mesh_file}" scale="1 1 1" />
</geometry>
</visual>
<inertial>
<mass value="0.001" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<inertia ixx="0.000000017" ixy="0.0" ixz="0.0"
iyy="0.000000017" iyz="0.0"
izz="0.000000017" />
</inertial>
</link>
<!-- Joint between thruster link and vehicle base link -->
<joint name="${robot_namespace}/thruster_${thruster_id}_joint" type="continuous">
<xacro:insert_block name="origin" />
<axis xyz="1 0 0" />
<parent link="${robot_namespace}/base_link" />
<child link="${robot_namespace}/thruster_${thruster_id}" />
</joint>
<gazebo>
<!-- Thruster ROS plugin -->
<plugin name="${robot_namespace}_${thruster_id}_thruster_model" filename="libthruster_ros_plugin.so">
<!-- Name of the thruster link -->
<linkName>${robot_namespace}/thruster_${thruster_id}</linkName>
<!-- Name of the joint between thruster and vehicle base link -->
<jointName>${robot_namespace}/thruster_${thruster_id}_joint</jointName>
<!-- Make the thruster aware of its id -->
<thrusterID>${thruster_id}</thrusterID>
<!-- Gain of the input command signal -->
<gain>1</gain>
<!-- Maximum allowed input value for the input signal for thruster unit -->
<clampMax>0</clampMax>
<!-- Minimum allowed value for the input signal for thruster unit -->
<clampMin>0</clampMin>
<!-- Minimum and maximum thrust force output allowed -->
<thrustMin>0</thrustMin>
<thrustMax>0</thrustMax>
<!--
Value from 0 to 1 to set the efficiency of the output thrust force
Default value is 1.0
-->
<thrust_efficiency>1</thrust_efficiency>
<!--
Value from 0 to 1 to set the efficiency of the propeller as a factor
to be multiplied to the current value of the state variable at each
iteration.
Default value is 1.0
-->
<propeller_efficiency>1</propeller_efficiency>
<!--
----------------------------------------------------
----------------------------------------------------
Choose one of the propeller dynamics models below for your implementation
This will describe the dynamic model for the state variable of your thruster unit,
which can be, e.g., the angular velocity of the propeller.
----------------------------------------------------
---------------------------------------------------->
<!-- 1) Simple zero-order model -->
<dynamics>
<type>ZeroOrder</type>
</dynamics>
<!-- 2) First order model -->
<dynamics>
<type>FirstOrder</type>
<timeConstant>0.0</timeConstant>
</dynamics>
<!-- 3) Yoerger's nonlinear dynamic model
For information on the model description:
[1] D. R. Yoerger, J. G. Cooke, and J.-J. E. Slotine, “The influence of
thruster dynamics on underwater vehicle behavior and their incorporation
into control system design,” IEEE Journal of Oceanic Engineering, vol. 15,
no. 3, pp. 167–178, Jul. 1990.
-->
<dynamics>
<type>Yoerger</type>
<alpha>0.0</alpha>
<beta>0.0</beta>
</dynamics>
<!-- 4) Bessa's nonlinear dynamic model
For information on the model description:
[2] Bessa, Wallace Moreira, Max Suell Dutra, and Edwin Kreuzer. "Thruster
dynamics compensation for the positioning of underwater robotic vehicles
through a fuzzy sliding mode based approach." ABCM Symposium Series in
Mechatronics. Vol. 2. 2006.
-->
<dynamics>
<type>Bessa</type>
<Jmsp>0.0</Jmsp>
<Kv1>0.0</Kv1>
<Kv2>0.0</Kv2>
<Kt>0.0</Kt>
<Rm>0.0</Rm>
</dynamics>
<!--
----------------------------------------------------
----------------------------------------------------
Choose one of the model for the steady-state curve describing the
relationship between the state variable and the output thrust force
----------------------------------------------------
---------------------------------------------------->
<!-- 1) Basic curve
Input: x
Output: thrust
Function: thrust = rotorConstant * x * abs(x)
-->
<conversion>
<type>Basic</type>
<rotorConstant>0.0</rotorConstant>
</conversion>
<!-- 2) Dead-zone nonlinearity described in Bessa, 2006
Input: x
Output: thrust
Function:
thrust = rotorConstantL * (x * abs(x) - deltaL), if x * abs(x) <= deltaL
thrust = 0, if deltaL < x * abs(x) < deltaR
thrust = rotorConstantR * (x * abs(x) - deltaR), if x * abs(x) >= deltaL
-->
<conversion>
<type>Bessa</type>
<rotorConstantL>0.0</rotorConstantL>
<rotorConstantR>0.0</rotorConstantR>
<deltaL>0.0</deltaL>
<deltaR>0.0</deltaR>
</conversion>
<!-- 3) Linear interpolation
If you have access to the thruster's data sheet, for example,
you can enter samples of the curve's input and output values
and the thruster output will be found through linear interpolation
of the given samples.
-->
<conversion>
<type>LinearInterp</type>
<inputValues>0 1 2 3</inputValues>
<outputValues>0 1 2 3</outputValues>
</conversion>
</plugin>
</gazebo>
<gazebo reference="${robot_namespace}/thruster_${thruster_id}">
<selfCollide>false</selfCollide>
</gazebo>
<!--------------------------------------------------------------------------> <!-- MACRO FOR FIN/RUDDER UNITS --> <!-------------------------------------------------------------------------->
<!-- This macro can be used to add fins to the body of the vehicle, the fins should be initialized in the actuators.xacro file. If you vehicle has no fins, you can erase the macro below. -->
<!-- A separate mesh for the fin should be stored in the meshes folder -->
<!-- Fin joint limits -->
<link name="${namespace}/fin${fin_id}">
<inertial>
<mass value="0.001" />
<origin xyz="0 0 0" rpy="0 0 0"/>
<inertia ixx="0.000000017" ixy="0.0" ixz="0.0"
iyy="0.000000017" iyz="0.0"
izz="0.000000017" />
</inertial>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
<geometry>
<mesh filename="${fin_mesh_file}" scale="1 1 1"/>
</geometry>
</visual>
</link>
<gazebo>
<plugin name="${namespace}_fin${fin_id}_model" filename="libfin_ros_plugin.so">
<!--
----------------------------------------------------
----------------------------------------------------
First order dynamics model for the fin joint dynamics,
replace an appropriate time constant
----------------------------------------------------
----------------------------------------------------
-->
<dynamics>
<type>FirstOrder</type>
<timeConstant>0.0</timeConstant>
</dynamics>
<!--
----------------------------------------------------
----------------------------------------------------
Definition of the lift and drag model, choose ONE of the models
below according to the model you want to use.
----------------------------------------------------
----------------------------------------------------
-->
<!--
1) References for the two line lift and drag model:
[1] https://en.wikipedia.org/wiki/Lift_coefficient
[2] http://gazebosim.org/tutorials?tut=aerodynamics&cat=plugins
-->
<liftdrag>
<type>TwoLines</type>
<area>${replace here the value for the area of the fin's cross section}</area>
<fluid_density>0.0</fluid_density>
<a0>0.0</a0>
<alpha_stall>0.0</alpha_stall>
<cla>0.0</cla><!-- ^= 0.244 when using deg -->
<cla_stall>0.0</cla_stall>
<cda>0.0</cda>
<cda_stall>0.0</cda_stall>
</liftdrag>
<!--
2) Reference for the quadratic lift and drag model:
[1] Engelhardtsen, Oystein. 3D AUV Collision Avoidance.
MS thesis. Institutt for teknisk kybernetikk, 2007.
https://brage.bibsys.no/xmlui/handle/11250/259834
-->
<liftdrag>
<type>Quadratic</type>
<lift_constant>0.0</lift_constant>
<drag_constant>0.0</drag_constant>
</liftdrag>
<!--
----------------------------------------------------
----------------------------------------------------
Further parameters necessary for the lift and drag plugin
----------------------------------------------------
----------------------------------------------------
-->
<!-- Current velocity topic -->
<current_velocity_topic>/hydrodynamics/current_velocity</current_velocity_topic>
<!-- Name of the correspodent fin link and joint -->
<link_name>${namespace}/fin${fin_id}</link_name>
<joint_name>${namespace}/fin${fin_id}_joint</joint_name>
<!-- Output topic to publish the current angle of the fin joint -->
<output_topic>${namespace}/fins/${fin_id}/output</output_topic>
<input_topic>${namespace}/fins/${fin_id}/input</input_topic>
<wrench_topic>${namespace}/fins/${fin_id}/wrench_topic</wrench_topic>
</plugin>
</gazebo>
Asked by hbaqueiro on 2018-05-11 13:05:41 UTC
Answers
You've included your prop_mesh_file incorrectly. So do the following change:
<xacro:property name="prop_mesh_file" value="file://$(find baqtronic_description)/meshes/propeller.dae"/>
Change it to:
<xacro:property name="prop_mesh_file" value="package://baqtronic_description/meshes/propeller.dae"/>
EDIT:
I think the $(find.. should work too, it's just the file:// that breaks it, it's not needed at all. So you can also try:
<xacro:property name="prop_mesh_file" value="$(find baqtronic_description)/meshes/propeller.dae"/>
Asked by Raskkii on 2018-05-14 09:05:44 UTC
Comments
They don't work. It turns out that the file baqtronic_description/meshes/propeller.dae doesn't exist. It is not created by the command rosrun uuv_assistants create_new_robot_model --robot_name baqtronic. The folder structure is as shown in the tutorial: https://uuvsimulator.github.io/tutorials/create_new_vehicle.html Do you have other thoughts?
Asked by hbaqueiro on 2018-05-14 10:56:05 UTC
In that case you need to obtain (or create) the mesh file yourself. Take note that the mesh is only used for the visual so it doesn't affect the physics in any way, meaning the visual doesn't even have to look good if that's not important to you. So technically you could just insert a simple cylinder in that visual slot without needing any .dae file. Here's a .dae file i found though: https://github.com/uuvsimulator/uuv_simulator/blob/master/uuv_descriptions/models/rexrov/mesh/prop.dae
Asked by Raskkii on 2018-07-17 07:28:27 UTC
Comments
Could you add your snippets.xacro file to the question?
Asked by Raskkii on 2018-05-14 02:12:08 UTC
I've edited the question to add the snippets.xacro
Asked by hbaqueiro on 2018-05-14 08:57:43 UTC