Commit 865620f8525409a42eadff9ed4e9470a8a28a240

Authored by Ricardo Rico Uribe
1 parent d4c095dd

spawn of aquanate correct with wind and waves - missing thruster input

README.md
... ... @@ -19,34 +19,38 @@ Repository to simulate the Aquanaute boat in maritime conditions such as wind an
19 19  
20 20 ## Usage
21 21 ### modify wind and waves
22   - in the ocean.world.xacro you have
23   - ```xml
24   - <!--Waves-->
25   - <xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
26   - <xacro:ocean_waves gain="0.0" period="5" direction_x="-1.0" direction_y="0.0" angle="0.0"/>
  22 + in the ocean.world.xacro you have
  23 + ```xml
  24 + <!--Waves-->
  25 + <xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
  26 + <xacro:ocean_waves gain="0.0" period="5" direction_x="-1.0" direction_y="0.0" angle="0.0"/>
  27 +
  28 + <!--Wind for the WAM-V. Note, wind parameters are set in the plug.-->
  29 + <xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/>
  30 + <xacro:usv_wind_gazebo direction="90" mean_vel="0" var_gain="5" var_time="1">
  31 + <wind_objs>
  32 + <wind_obj>
  33 + <name>wamv</name>
  34 + <link_name>base_link</link_name>
  35 + <coeff_vector>0.5 0.5 0.33</coeff_vector>
  36 + </wind_obj>
  37 + </wind_objs>
  38 + </xacro:usv_wind_gazebo>
  39 + ```
  40 + it is configured to have no waves and no wind, also the wind and the waves move in the same direction, to activate wind and waves change the "mean_vel" and "gain" parameters respectively (recomended values are smaller than 1.0).
27 41  
28   - <!--Wind for the WAM-V. Note, wind parameters are set in the plug.-->
29   - <xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/>
30   - <xacro:usv_wind_gazebo direction="90" mean_vel="0" var_gain="5" var_time="1">
31   - <wind_objs>
32   - <wind_obj>
33   - <name>wamv</name>
34   - <link_name>base_link</link_name>
35   - <coeff_vector>0.5 0.5 0.33</coeff_vector>
36   - </wind_obj>
37   - </wind_objs>
38   - </xacro:usv_wind_gazebo>
39   - ```
40   - it is configured to have no waves and no wind, also the wind and the waves move in the same direction, to activate wind and waves change the "mean_vel" and "gain" parameters respectively (recomended values are smaller than 1.0)
41 42 ### run
42 43 in the workspace run the command at the beginning (and every time you change a parameter)
43   -```bash
44   -catkin_make
45   -```
  44 +
  45 + ```bash
  46 + catkin_make
  47 + ```
  48 +
46 49 then launch the file you created
47   -```bash
48   -roslaunch vrx_gazebo name.launch
49   -```
  50 +
  51 + ```bash
  52 + roslaunch vrx_gazebo name.launch
  53 + ```
50 54 ## Author
51 55 Ricardo RICO URIBE intern at U2IS in the summer of 2020
52 56  
... ... @@ -55,80 +59,62 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020
55 59 ```xml
56 60 <?xml version="1.0"?>
57 61 <launch>
58   - <env name="ROSCONSOLE_CONFIG_FILE" value="$(find vrx_gazebo)/config/custom_rosconsole.conf"/>
59   - <!-- Gazebo world to load -->
60   - <arg name="world" default="$(find vrx_gazebo)/worlds/ocean.world" />
61   - <!-- If true, run gazebo GUI -->
62   - <arg name="gui" default="true" />
63   - <!-- If true, run gazebo in verbose mode -->
64   - <arg name="verbose" default="true"/>
65   - <!-- If true, start in paused state -->
66   - <arg name="paused" default="false"/>
67   - <!-- Set various other gazebo arguments-->
68   - <arg name="extra_gazebo_args" default=""/>
69   - <!-- Start in a default namespace -->
70   - <arg name="namespace" default="wamv"/>
71   -
72   - <!-- Initial USV location and attitude-->
73   - <arg name="x" default="0" />
74   - <arg name="y" default="0" />
75   - <arg name="z" default="0.1" />
76   - <arg name="P" default="0" />
77   - <arg name="R" default="0" />
78   - <arg name="Y" default="0" />
79   -
80   - <!-- If true, show non-competition ROS topics (/gazebo/model_states, /vrx/debug/wind/direction, etc.)-->
81   - <arg name="non_competition_mode" default="true"/>
82   - <arg name="enable_ros_network" value="$(arg non_competition_mode)"/>
83   - <env name="VRX_DEBUG" value="$(arg non_competition_mode)"/>
84   - <env unless="$(arg non_competition_mode)" name="GAZEBO_MODEL_PATH" value="$(find vrx_gazebo)/models:$(find wamv_gazebo)/models:$(find wamv_description)/models:$(optenv GAZEBO_MODEL_PATH)"/>
85   -
86   - <!-- Allow user specified thruster configurations
  62 + <env name="ROSCONSOLE_CONFIG_FILE" value="$(find vrx_gazebo)/config/custom_rosconsole.conf"/>
  63 + <!-- Gazebo world to load -->
  64 + <arg name="world" default="$(find vrx_gazebo)/worlds/ocean.world" />
  65 + <!-- If true, run gazebo GUI -->
  66 + <arg name="gui" default="true" />
  67 + <!-- If true, run gazebo in verbose mode -->
  68 + <arg name="verbose" default="true"/>
  69 + <!-- If true, start in paused state -->
  70 + <arg name="paused" default="false"/>
  71 + <!-- Set various other gazebo arguments-->
  72 + <arg name="extra_gazebo_args" default=""/>
  73 + <!-- Start in a default namespace -->
  74 + <arg name="namespace" default="aquanaute"/>
  75 +
  76 + <!-- Initial USV location and attitude-->
  77 + <arg name="x" default="0" />
  78 + <arg name="y" default="0" />
  79 + <arg name="z" default="0.1" />
  80 + <arg name="P" default="0" />
  81 + <arg name="R" default="0" />
  82 + <arg name="Y" default="0" />
  83 +
  84 + <env name="VRX_DEBUG" value="true"/>
  85 +
  86 + <!-- Allow user specified thruster configurations
87 87 H = stern trusters on each hull
88 88 T = H with a lateral thruster
89 89 X = "holonomic" configuration -->
90   - <arg name="thrust_config" default="H" />
91   -
92   - <!-- Do you want to enable sensors? -->
93   - <arg name="camera_enabled" default="false" />
94   - <arg name="gps_enabled" default="false" />
95   - <arg name="imu_enabled" default="false" />
96   - <arg name="lidar_enabled" default="false" />
97   - <arg name="ground_truth_enabled" default="false" />
98   -
99   - <!-- Start Gazebo with the world file -->
100   - <include file="$(find gazebo_ros)/launch/empty_world.launch">
101   - <arg name="world_name" value="$(arg world)"/>
102   - <arg name="verbose" value="$(arg verbose)"/>
103   - <arg name="paused" value="$(arg paused)"/>
104   - <arg name="use_sim_time" value="true"/>
105   - <arg name="gui" value="$(arg gui)" />
106   - <arg name="enable_ros_network" value="$(arg enable_ros_network)"/>
107   - <arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/>
108   - </include>
109   -
110   - <!-- Load robot model -->
111   - <arg name="urdf" default="$(find wamv_gazebo)/urdf/wamv_gazebo.urdf.xacro"/>
112   - <param name="$(arg namespace)/robot_description"
113   - command="$(find xacro)/xacro &#x002D;&#x002D;inorder '$(arg urdf)'
114   - thruster_config:=$(arg thrust_config)
115   - camera_enabled:=$(arg camera_enabled)
116   - gps_enabled:=$(arg gps_enabled)
117   - imu_enabled:=$(arg imu_enabled)
118   - lidar_enabled:=$(arg lidar_enabled)
119   - ground_truth_enabled:=$(arg ground_truth_enabled)
120   - namespace:=$(arg namespace) "/>
121   -
122   - <!-- Spawn model in Gazebo, script depending on non_competition_mode -->
123   - <node name="spawn_model" pkg="gazebo_ros" type="spawn_model" if="$(arg non_competition_mode)"
124   - args="-x $(arg x) -y $(arg y) -z $(arg z)
  90 + <arg name="thrust_config" default="H" />
  91 +
  92 + <!-- Do you want to enable sensors? -->
  93 + <arg name="camera_enabled" default="false" />
  94 + <arg name="gps_enabled" default="false" />
  95 + <arg name="imu_enabled" default="false" />
  96 + <arg name="lidar_enabled" default="false" />
  97 + <arg name="ground_truth_enabled" default="false" />
  98 +
  99 + <!-- Start Gazebo with the world file -->
  100 + <include file="$(find gazebo_ros)/launch/empty_world.launch">
  101 + <arg name="world_name" value="$(arg world)"/>
  102 + <arg name="verbose" value="$(arg verbose)"/>
  103 + <arg name="paused" value="$(arg paused)"/>
  104 + <arg name="use_sim_time" value="true"/>
  105 + <arg name="gui" value="$(arg gui)" />
  106 + <arg name="enable_ros_network" value="true"/>
  107 + <arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/>
  108 + </include>
  109 +
  110 + <!-- Load robot model -->
  111 + <arg name="urdf" default="$(find aquanaute_gazebo)/urdf/aquanaute_gazebo.urdf.xacro"/>
  112 + <param name="$(arg namespace)/robot_description" command="$(find xacro)/xacro '$(arg urdf)'"/>
  113 +
  114 + <!-- Spawn model in Gazebo, script depending on non_competition_mode -->
  115 + <node name="spawn_model" pkg="gazebo_ros" type="spawn_model" args="-x $(arg x) -y $(arg y) -z $(arg z)
125 116 -R $(arg R) -P $(arg P) -Y $(arg Y)
126   - -urdf -param $(arg namespace)/robot_description -model wamv"/>
127   -
128   - <node name="spawn_wamv" pkg="vrx_gazebo" type="spawn_wamv.bash" unless="$(arg non_competition_mode)"
129   - args="-x $(arg x) -y $(arg y) -z $(arg z)
130   - -R $(arg R) -P $(arg P) -Y $(arg Y)
131   - --urdf $(arg urdf) --model wamv"/>
  117 + -urdf -param $(arg namespace)/robot_description -model aquanaute"/>
132 118 </launch>
133 119 ```
134 120 ### ocean.world.xacro
... ... @@ -191,10 +177,10 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020
191 177  
192 178 <!--Wind for the WAM-V. Note, wind parameters are set in the plug.-->
193 179 <xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/>
194   - <xacro:usv_wind_gazebo direction="90" mean_vel="0" var_gain="5" var_time="1">
  180 + <xacro:usv_wind_gazebo direction="90" mean_vel="0.0" var_gain="5" var_time="1">
195 181 <wind_objs>
196 182 <wind_obj>
197   - <name>wamv</name>
  183 + <name>aquanaute</name>
198 184 <link_name>base_link</link_name>
199 185 <coeff_vector>0.5 0.5 0.33</coeff_vector>
200 186 </wind_obj>
... ... @@ -203,6 +189,7 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020
203 189 </world>
204 190 </sdf>
205 191  
  192 +
206 193 ```
207 194  
208 195 ## License
... ...
aquanaute_description/urdf/aquanaute_description.urdf.xacro
... ... @@ -159,7 +159,7 @@
159 159 <joint name="platform_base_joint" type="fixed">
160 160 <parent link="base_link"/>
161 161 <child link="platform_link"/>
162   - <origin xyz="0 0 0" rpy="0 0 0"/>
  162 + <origin xyz="0 0 0.35" rpy="0 0 0"/>
163 163 </joint>
164 164  
165 165 <joint name="right_hull_platform_joint" type="fixed">
... ... @@ -175,13 +175,13 @@
175 175 </joint>
176 176  
177 177 <joint name="motor_platform_joint" type="fixed">
178   - <parent link="base_link"/>
  178 + <parent link="platform_link"/>
179 179 <child link="motor_link"/>
180 180 <origin xyz="-0.91 0.0 -0.09" rpy="0 0 0"/>
181 181 </joint>
182 182  
183 183 <joint name="sensor_frame_platform_joint" type="fixed">
184   - <parent link="base_link"/>
  184 + <parent link="platform_link"/>
185 185 <child link="sensor_frame_link"/>
186 186 <origin xyz="-0.55 0.0 0.0" rpy="0 0 0"/>
187 187 </joint>
... ...
aquanaute_gazebo/urdf/aquanaute_gazebo.urdf.xacro
... ... @@ -4,7 +4,7 @@
4 4 <!-- Include macros for dynamics plugins -->
5 5 <xacro:include filename="$(find aquanaute_gazebo)/urdf/macros.xacro" />
6 6 <!-- Defines the base vehicle -->
7   - <xacro:include filename="$(find aquanaute_description)/urdf/aquanaute_description.urdf.xacro" />
  7 + <xacro:include filename="$(find aquanaute_description)/urdf/aquanaute_description.urdf.xacro" name="aquanaute"/>
8 8 <!-- Attach hydrodynamics plugin -->
9 9 <xacro:usv_dynamics_gazebo name="aquanaute_dynamics_plugin"/>
10 10 </robot>
... ...
aquanaute_gazebo/urdf/aquanaute_gazebo.xacro deleted
... ... @@ -1,11 +0,0 @@
1   -<?xml version="1.0"?>
2   -<robot xmlns:xacro="http://ros.org/wiki/xacro">
3   - <xacro:macro name="aquanaute_gazebo">
4   - <!-- Include macros for dynamics plugins -->
5   - <xacro:include filename="$(find aquanaute_gazebo)/urdf/macros.xacro" />
6   - <!-- Defines the base vehicle -->
7   - <xacro:include filename="$(find aquanaute_description)/urdf/aquanaute_description.urdf.xacro" />
8   - <!-- Attach hydrodynamics plugin -->
9   - <xacro:usv_dynamics_gazebo name="aquanaute_dynamics_plugin"/>
10   - </xacro:macro>
11   -</robot>
aquanaute_gazebo/urdf/dynamics/aquanaute_gazebo_dynamics_plugin.xacro
... ... @@ -9,9 +9,9 @@
9 9 <waterLevel>0</waterLevel>
10 10 <waterDensity>997.8</waterDensity>
11 11 <!-- Added mass -->
12   - <xDotU>0.0</xDotU>
13   - <yDotV>0.0</yDotV>
14   - <nDotR>0.0</nDotR>
  12 + <xDotU>10.0</xDotU>
  13 + <yDotV>10.0</yDotV>
  14 + <nDotR>25.0</nDotR>
15 15 <!-- Linear and quadratic drag -->
16 16 <xU>51.3</xU>
17 17 <xUU>72.4</xUU>
... ... @@ -24,9 +24,9 @@
24 24 <nRR>0.0</nRR>
25 25 <!-- General dimensions -->
26 26 <!--<boatArea>2.2</boatArea>-->
27   - <hullRadius>0.19</hullRadius>
28   - <boatWidth>2</boatWidth>
29   - <boatLength>3</boatLength>
  27 + <hullRadius>0.18</hullRadius>
  28 + <boatWidth>1.8</boatWidth>
  29 + <boatLength>3.0</boatLength>
30 30 <!-- Length discretization, AKA, "N" -->
31 31 <length_n>10</length_n>
32 32 <!-- Wave model -->
... ...