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
## Usage
### modify wind and waves
in the ocean.world.xacro you have
```xml
<!--Waves-->
<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"/>
in the ocean.world.xacro you have
```xml
<!--Waves-->
<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"/>
<!--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
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
```bash
roslaunch vrx_gazebo name.launch
```
```bash
roslaunch vrx_gazebo name.launch
```
## Author
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 version="1.0"?>
<launch>
<env name="ROSCONSOLE_CONFIG_FILE" value="$(find vrx_gazebo)/config/custom_rosconsole.conf"/>
<!-- Gazebo world to load -->
<arg name="world" default="$(find vrx_gazebo)/worlds/ocean.world" />
<!-- If true, run gazebo GUI -->
<arg name="gui" default="true" />
<!-- If true, run gazebo in verbose mode -->
<arg name="verbose" default="true"/>
<!-- If true, start in paused state -->
<arg name="paused" default="false"/>
<!-- Set various other gazebo arguments-->
<arg name="extra_gazebo_args" default=""/>
<!-- Start in a default namespace -->
<arg name="namespace" default="wamv"/>
<!-- Initial USV location and attitude-->
<arg name="x" default="0" />
<arg name="y" default="0" />
<arg name="z" default="0.1" />
<arg name="P" default="0" />
<arg name="R" default="0" />
<arg name="Y" default="0" />
<!-- If true, show non-competition ROS topics (/gazebo/model_states, /vrx/debug/wind/direction, etc.)-->
<arg name="non_competition_mode" default="true"/>
<arg name="enable_ros_network" value="$(arg non_competition_mode)"/>
<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
<env name="ROSCONSOLE_CONFIG_FILE" value="$(find vrx_gazebo)/config/custom_rosconsole.conf"/>
<!-- Gazebo world to load -->
<arg name="world" default="$(find vrx_gazebo)/worlds/ocean.world" />
<!-- If true, run gazebo GUI -->
<arg name="gui" default="true" />
<!-- If true, run gazebo in verbose mode -->
<arg name="verbose" default="true"/>
<!-- If true, start in paused state -->
<arg name="paused" default="false"/>
<!-- Set various other gazebo arguments-->
<arg name="extra_gazebo_args" default=""/>
<!-- Start in a default namespace -->
<arg name="namespace" default="aquanaute"/>
<!-- Initial USV location and attitude-->
<arg name="x" default="0" />
<arg name="y" default="0" />
<arg name="z" default="0.1" />
<arg name="P" default="0" />
<arg name="R" default="0" />
<arg name="Y" default="0" />
<env name="VRX_DEBUG" value="true"/>
<!-- Allow user specified thruster configurations
H = stern trusters on each hull
T = H with a lateral thruster
X = "holonomic" configuration -->
<arg name="thrust_config" default="H" />
<!-- Do you want to enable sensors? -->
<arg name="camera_enabled" default="false" />
<arg name="gps_enabled" default="false" />
<arg name="imu_enabled" default="false" />
<arg name="lidar_enabled" default="false" />
<arg name="ground_truth_enabled" default="false" />
<!-- Start Gazebo with the world file -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world)"/>
<arg name="verbose" value="$(arg verbose)"/>
<arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="$(arg gui)" />
<arg name="enable_ros_network" value="$(arg enable_ros_network)"/>
<arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/>
</include>
<!-- Load robot model -->
<arg name="urdf" default="$(find wamv_gazebo)/urdf/wamv_gazebo.urdf.xacro"/>
<param name="$(arg namespace)/robot_description"
command="$(find xacro)/xacro &#x002D;&#x002D;inorder '$(arg urdf)'
thruster_config:=$(arg thrust_config)
camera_enabled:=$(arg camera_enabled)
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)
<arg name="thrust_config" default="H" />
<!-- Do you want to enable sensors? -->
<arg name="camera_enabled" default="false" />
<arg name="gps_enabled" default="false" />
<arg name="imu_enabled" default="false" />
<arg name="lidar_enabled" default="false" />
<arg name="ground_truth_enabled" default="false" />
<!-- Start Gazebo with the world file -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
<arg name="world_name" value="$(arg world)"/>
<arg name="verbose" value="$(arg verbose)"/>
<arg name="paused" value="$(arg paused)"/>
<arg name="use_sim_time" value="true"/>
<arg name="gui" value="$(arg gui)" />
<arg name="enable_ros_network" value="true"/>
<arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/>
</include>
<!-- Load robot model -->
<arg name="urdf" default="$(find aquanaute_gazebo)/urdf/aquanaute_gazebo.urdf.xacro"/>
<param name="$(arg namespace)/robot_description" command="$(find xacro)/xacro '$(arg urdf)'"/>
<!-- Spawn model in Gazebo, script depending on non_competition_mode -->
<node name="spawn_model" pkg="gazebo_ros" type="spawn_model" args="-x $(arg x) -y $(arg y) -z $(arg z)
-R $(arg R) -P $(arg P) -Y $(arg Y)
-urdf -param $(arg namespace)/robot_description -model wamv"/>
<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"/>
-urdf -param $(arg namespace)/robot_description -model aquanaute"/>
</launch>
```
### ocean.world.xacro
......@@ -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.-->
<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_obj>
<name>wamv</name>
<name>aquanaute</name>
<link_name>base_link</link_name>
<coeff_vector>0.5 0.5 0.33</coeff_vector>
</wind_obj>
......@@ -203,6 +189,7 @@ Ricardo RICO URIBE intern at U2IS in the summer of 2020
</world>
</sdf>
```
## License
......
......@@ -159,7 +159,7 @@
<joint name="platform_base_joint" type="fixed">
<parent link="base_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 name="right_hull_platform_joint" type="fixed">
......@@ -175,13 +175,13 @@
</joint>
<joint name="motor_platform_joint" type="fixed">
<parent link="base_link"/>
<parent link="platform_link"/>
<child link="motor_link"/>
<origin xyz="-0.91 0.0 -0.09" rpy="0 0 0"/>
</joint>
<joint name="sensor_frame_platform_joint" type="fixed">
<parent link="base_link"/>
<parent link="platform_link"/>
<child link="sensor_frame_link"/>
<origin xyz="-0.55 0.0 0.0" rpy="0 0 0"/>
</joint>
......
......@@ -4,7 +4,7 @@
<!-- 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" />
<xacro:include filename="$(find aquanaute_description)/urdf/aquanaute_description.urdf.xacro" name="aquanaute"/>
<!-- Attach hydrodynamics plugin -->
<xacro:usv_dynamics_gazebo name="aquanaute_dynamics_plugin"/>
</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 @@
<waterLevel>0</waterLevel>
<waterDensity>997.8</waterDensity>
<!-- Added mass -->
<xDotU>0.0</xDotU>
<yDotV>0.0</yDotV>
<nDotR>0.0</nDotR>
<xDotU>10.0</xDotU>
<yDotV>10.0</yDotV>
<nDotR>25.0</nDotR>
<!-- Linear and quadratic drag -->
<xU>51.3</xU>
<xUU>72.4</xUU>
......@@ -24,9 +24,9 @@
<nRR>0.0</nRR>
<!-- General dimensions -->
<!--<boatArea>2.2</boatArea>-->
<hullRadius>0.19</hullRadius>
<boatWidth>2</boatWidth>
<boatLength>3</boatLength>
<hullRadius>0.18</hullRadius>
<boatWidth>1.8</boatWidth>
<boatLength>3.0</boatLength>
<!-- Length discretization, AKA, "N" -->
<length_n>10</length_n>
<!-- 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