Commit 865620f8 authored by Ricardo Rico Uribe's avatar Ricardo Rico Uribe
Browse files

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

parent d4c095dd
...@@ -19,34 +19,38 @@ Repository to simulate the Aquanaute boat in maritime conditions such as wind an ...@@ -19,34 +19,38 @@ Repository to simulate the Aquanaute boat in maritime conditions such as wind an
## Usage ## Usage
### modify wind and waves ### modify wind and waves
in the ocean.world.xacro you have in the ocean.world.xacro you have
```xml ```xml
<!--Waves--> <!--Waves-->
<xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/> <xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
<xacro:ocean_waves gain="0.0" period="5" direction_x="-1.0" direction_y="0.0" angle="0.0"/> <xacro:ocean_waves gain="0.0" period="5" direction_x="-1.0" direction_y="0.0" angle="0.0"/>
<!--Wind for the WAM-V. Note, wind parameters are set in the plug.-->
<xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/>
<xacro:usv_wind_gazebo direction="90" mean_vel="0" var_gain="5" var_time="1">
<wind_objs>
<wind_obj>
<name>wamv</name>
<link_name>base_link</link_name>
<coeff_vector>0.5 0.5 0.33</coeff_vector>
</wind_obj>
</wind_objs>
</xacro:usv_wind_gazebo>
```
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).
<!--Wind for the WAM-V. Note, wind parameters are set in the plug.-->
<xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/>
<xacro:usv_wind_gazebo direction="90" mean_vel="0" var_gain="5" var_time="1">
<wind_objs>
<wind_obj>
<name>wamv</name>
<link_name>base_link</link_name>
<coeff_vector>0.5 0.5 0.33</coeff_vector>
</wind_obj>
</wind_objs>
</xacro:usv_wind_gazebo>
```
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)
### run ### run
in the workspace run the command at the beginning (and every time you change a parameter) in the workspace run the command at the beginning (and every time you change a parameter)
```bash
catkin_make ```bash
``` catkin_make
```
then launch the file you created then launch the file you created
```bash
roslaunch vrx_gazebo name.launch ```bash
``` roslaunch vrx_gazebo name.launch
```
## Author ## Author
Ricardo RICO URIBE intern at U2IS in the summer of 2020 Ricardo RICO URIBE intern at U2IS in the summer of 2020
...@@ -55,80 +59,62 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020 ...@@ -55,80 +59,62 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020
```xml ```xml
<?xml version="1.0"?> <?xml version="1.0"?>
<launch> <launch>
<env name="ROSCONSOLE_CONFIG_FILE" value="$(find vrx_gazebo)/config/custom_rosconsole.conf"/> <env name="ROSCONSOLE_CONFIG_FILE" value="$(find vrx_gazebo)/config/custom_rosconsole.conf"/>
<!-- Gazebo world to load --> <!-- Gazebo world to load -->
<arg name="world" default="$(find vrx_gazebo)/worlds/ocean.world" /> <arg name="world" default="$(find vrx_gazebo)/worlds/ocean.world" />
<!-- If true, run gazebo GUI --> <!-- If true, run gazebo GUI -->
<arg name="gui" default="true" /> <arg name="gui" default="true" />
<!-- If true, run gazebo in verbose mode --> <!-- If true, run gazebo in verbose mode -->
<arg name="verbose" default="true"/> <arg name="verbose" default="true"/>
<!-- If true, start in paused state --> <!-- If true, start in paused state -->
<arg name="paused" default="false"/> <arg name="paused" default="false"/>
<!-- Set various other gazebo arguments--> <!-- Set various other gazebo arguments-->
<arg name="extra_gazebo_args" default=""/> <arg name="extra_gazebo_args" default=""/>
<!-- Start in a default namespace --> <!-- Start in a default namespace -->
<arg name="namespace" default="wamv"/> <arg name="namespace" default="aquanaute"/>
<!-- Initial USV location and attitude--> <!-- Initial USV location and attitude-->
<arg name="x" default="0" /> <arg name="x" default="0" />
<arg name="y" default="0" /> <arg name="y" default="0" />
<arg name="z" default="0.1" /> <arg name="z" default="0.1" />
<arg name="P" default="0" /> <arg name="P" default="0" />
<arg name="R" default="0" /> <arg name="R" default="0" />
<arg name="Y" default="0" /> <arg name="Y" default="0" />
<!-- If true, show non-competition ROS topics (/gazebo/model_states, /vrx/debug/wind/direction, etc.)--> <env name="VRX_DEBUG" value="true"/>
<arg name="non_competition_mode" default="true"/>
<arg name="enable_ros_network" value="$(arg non_competition_mode)"/> <!-- Allow user specified thruster configurations
<env name="VRX_DEBUG" value="$(arg non_competition_mode)"/>
<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)"/>
<!-- Allow user specified thruster configurations
H = stern trusters on each hull H = stern trusters on each hull
T = H with a lateral thruster T = H with a lateral thruster
X = "holonomic" configuration --> X = "holonomic" configuration -->
<arg name="thrust_config" default="H" /> <arg name="thrust_config" default="H" />
<!-- Do you want to enable sensors? --> <!-- Do you want to enable sensors? -->
<arg name="camera_enabled" default="false" /> <arg name="camera_enabled" default="false" />
<arg name="gps_enabled" default="false" /> <arg name="gps_enabled" default="false" />
<arg name="imu_enabled" default="false" /> <arg name="imu_enabled" default="false" />
<arg name="lidar_enabled" default="false" /> <arg name="lidar_enabled" default="false" />
<arg name="ground_truth_enabled" default="false" /> <arg name="ground_truth_enabled" default="false" />
<!-- Start Gazebo with the world file --> <!-- Start Gazebo with the world file -->
<include file="$(find gazebo_ros)/launch/empty_world.launch"> <include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world)"/> <arg name="world_name" value="$(arg world)"/>
<arg name="verbose" value="$(arg verbose)"/> <arg name="verbose" value="$(arg verbose)"/>
<arg name="paused" value="$(arg paused)"/> <arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="true"/> <arg name="use_sim_time" value="true"/>
<arg name="gui" value="$(arg gui)" /> <arg name="gui" value="$(arg gui)" />
<arg name="enable_ros_network" value="$(arg enable_ros_network)"/> <arg name="enable_ros_network" value="true"/>
<arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/> <arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/>
</include> </include>
<!-- Load robot model --> <!-- Load robot model -->
<arg name="urdf" default="$(find wamv_gazebo)/urdf/wamv_gazebo.urdf.xacro"/> <arg name="urdf" default="$(find aquanaute_gazebo)/urdf/aquanaute_gazebo.urdf.xacro"/>
<param name="$(arg namespace)/robot_description" <param name="$(arg namespace)/robot_description" command="$(find xacro)/xacro '$(arg urdf)'"/>
command="$(find xacro)/xacro &#x002D;&#x002D;inorder '$(arg urdf)'
thruster_config:=$(arg thrust_config) <!-- Spawn model in Gazebo, script depending on non_competition_mode -->
camera_enabled:=$(arg camera_enabled) <node name="spawn_model" pkg="gazebo_ros" type="spawn_model" args="-x $(arg x) -y $(arg y) -z $(arg z)
gps_enabled:=$(arg gps_enabled)
imu_enabled:=$(arg imu_enabled)
lidar_enabled:=$(arg lidar_enabled)
ground_truth_enabled:=$(arg ground_truth_enabled)
namespace:=$(arg namespace) "/>
<!-- Spawn model in Gazebo, script depending on non_competition_mode -->
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model" if="$(arg non_competition_mode)"
args="-x $(arg x) -y $(arg y) -z $(arg z)
-R $(arg R) -P $(arg P) -Y $(arg Y) -R $(arg R) -P $(arg P) -Y $(arg Y)
-urdf -param $(arg namespace)/robot_description -model wamv"/> -urdf -param $(arg namespace)/robot_description -model aquanaute"/>
<node name="spawn_wamv" pkg="vrx_gazebo" type="spawn_wamv.bash" unless="$(arg non_competition_mode)"
args="-x $(arg x) -y $(arg y) -z $(arg z)
-R $(arg R) -P $(arg P) -Y $(arg Y)
--urdf $(arg urdf) --model wamv"/>
</launch> </launch>
``` ```
### ocean.world.xacro ### ocean.world.xacro
...@@ -191,10 +177,10 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020 ...@@ -191,10 +177,10 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020
<!--Wind for the WAM-V. Note, wind parameters are set in the plug.--> <!--Wind for the WAM-V. Note, wind parameters are set in the plug.-->
<xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/> <xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/>
<xacro:usv_wind_gazebo direction="90" mean_vel="0" var_gain="5" var_time="1"> <xacro:usv_wind_gazebo direction="90" mean_vel="0.0" var_gain="5" var_time="1">
<wind_objs> <wind_objs>
<wind_obj> <wind_obj>
<name>wamv</name> <name>aquanaute</name>
<link_name>base_link</link_name> <link_name>base_link</link_name>
<coeff_vector>0.5 0.5 0.33</coeff_vector> <coeff_vector>0.5 0.5 0.33</coeff_vector>
</wind_obj> </wind_obj>
...@@ -203,6 +189,7 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020 ...@@ -203,6 +189,7 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020
</world> </world>
</sdf> </sdf>
``` ```
## License ## License
......
...@@ -159,7 +159,7 @@ ...@@ -159,7 +159,7 @@
<joint name="platform_base_joint" type="fixed"> <joint name="platform_base_joint" type="fixed">
<parent link="base_link"/> <parent link="base_link"/>
<child link="platform_link"/> <child link="platform_link"/>
<origin xyz="0 0 0" rpy="0 0 0"/> <origin xyz="0 0 0.35" rpy="0 0 0"/>
</joint> </joint>
<joint name="right_hull_platform_joint" type="fixed"> <joint name="right_hull_platform_joint" type="fixed">
...@@ -175,13 +175,13 @@ ...@@ -175,13 +175,13 @@
</joint> </joint>
<joint name="motor_platform_joint" type="fixed"> <joint name="motor_platform_joint" type="fixed">
<parent link="base_link"/> <parent link="platform_link"/>
<child link="motor_link"/> <child link="motor_link"/>
<origin xyz="-0.91 0.0 -0.09" rpy="0 0 0"/> <origin xyz="-0.91 0.0 -0.09" rpy="0 0 0"/>
</joint> </joint>
<joint name="sensor_frame_platform_joint" type="fixed"> <joint name="sensor_frame_platform_joint" type="fixed">
<parent link="base_link"/> <parent link="platform_link"/>
<child link="sensor_frame_link"/> <child link="sensor_frame_link"/>
<origin xyz="-0.55 0.0 0.0" rpy="0 0 0"/> <origin xyz="-0.55 0.0 0.0" rpy="0 0 0"/>
</joint> </joint>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
<!-- Include macros for dynamics plugins --> <!-- Include macros for dynamics plugins -->
<xacro:include filename="$(find aquanaute_gazebo)/urdf/macros.xacro" /> <xacro:include filename="$(find aquanaute_gazebo)/urdf/macros.xacro" />
<!-- Defines the base vehicle --> <!-- Defines the base vehicle -->
<xacro:include filename="$(find aquanaute_description)/urdf/aquanaute_description.urdf.xacro" /> <xacro:include filename="$(find aquanaute_description)/urdf/aquanaute_description.urdf.xacro" name="aquanaute"/>
<!-- Attach hydrodynamics plugin --> <!-- Attach hydrodynamics plugin -->
<xacro:usv_dynamics_gazebo name="aquanaute_dynamics_plugin"/> <xacro:usv_dynamics_gazebo name="aquanaute_dynamics_plugin"/>
</robot> </robot>
<?xml version="1.0"?>
<robot xmlns:xacro="http://ros.org/wiki/xacro">
<xacro:macro name="aquanaute_gazebo">
<!-- Include macros for dynamics plugins -->
<xacro:include filename="$(find aquanaute_gazebo)/urdf/macros.xacro" />
<!-- Defines the base vehicle -->
<xacro:include filename="$(find aquanaute_description)/urdf/aquanaute_description.urdf.xacro" />
<!-- Attach hydrodynamics plugin -->
<xacro:usv_dynamics_gazebo name="aquanaute_dynamics_plugin"/>
</xacro:macro>
</robot>
...@@ -9,9 +9,9 @@ ...@@ -9,9 +9,9 @@
<waterLevel>0</waterLevel> <waterLevel>0</waterLevel>
<waterDensity>997.8</waterDensity> <waterDensity>997.8</waterDensity>
<!-- Added mass --> <!-- Added mass -->
<xDotU>0.0</xDotU> <xDotU>10.0</xDotU>
<yDotV>0.0</yDotV> <yDotV>10.0</yDotV>
<nDotR>0.0</nDotR> <nDotR>25.0</nDotR>
<!-- Linear and quadratic drag --> <!-- Linear and quadratic drag -->
<xU>51.3</xU> <xU>51.3</xU>
<xUU>72.4</xUU> <xUU>72.4</xUU>
...@@ -24,9 +24,9 @@ ...@@ -24,9 +24,9 @@
<nRR>0.0</nRR> <nRR>0.0</nRR>
<!-- General dimensions --> <!-- General dimensions -->
<!--<boatArea>2.2</boatArea>--> <!--<boatArea>2.2</boatArea>-->
<hullRadius>0.19</hullRadius> <hullRadius>0.18</hullRadius>
<boatWidth>2</boatWidth> <boatWidth>1.8</boatWidth>
<boatLength>3</boatLength> <boatLength>3.0</boatLength>
<!-- Length discretization, AKA, "N" --> <!-- Length discretization, AKA, "N" -->
<length_n>10</length_n> <length_n>10</length_n>
<!-- Wave model --> <!-- Wave model -->
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment