Commit 0beafed9ad86c92db9ef890942b25fa7b128e86c

Authored by Ricardo Rico Uribe
1 parent 865620f8

modified to be able to work with vrx hosted at ensta - missing thruster

README.md
... ... @@ -5,27 +5,18 @@ Repository to simulate the Aquanaute boat in maritime conditions such as wind an
5 5 ## Installation
6 6  
7 7 * Clone this repo to a Catkin Workspace
8   -* Clone the VRX repo to the same Workspace (https://github.com/osrf/vrx)
9   -* In the path
10   - ```
11   - "workspace"/src/vrx/vrx_gazebo/launch/
12   - ```
13   - create a new launch file "name".launch and copy the code provided below
14   -* In the path
15   - ```
16   - "workspace"/src/vrx/vrx_gazebo/worlds/ocean.world.xacro
17   - ```
18   - delete the contents of the file and replace them with the code provided below
  8 +
  9 +* Clone the VRX repo (hosted at ensta) to the same Workspace (http://git-u2is.ensta.fr/ssh/vrx) and checkout to the branch "aquanaute"
19 10  
20 11 ## Usage
21 12 ### modify wind and waves
22   - in the ocean.world.xacro you have
  13 + in the ocean.world.xacro you have found in /vrx_gazebo/worlds
23 14 ```xml
24 15 <!--Waves-->
25 16 <xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
26 17 <xacro:ocean_waves gain="0.0" period="5" direction_x="-1.0" direction_y="0.0" angle="0.0"/>
27 18  
28   - <!--Wind for the WAM-V. Note, wind parameters are set in the plug.-->
  19 + <!--Wind-->
29 20 <xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/>
30 21 <xacro:usv_wind_gazebo direction="90" mean_vel="0" var_gain="5" var_time="1">
31 22 <wind_objs>
... ... @@ -49,149 +40,11 @@ in the workspace run the command at the beginning (and every time you change a p
49 40 then launch the file you created
50 41  
51 42 ```bash
52   - roslaunch vrx_gazebo name.launch
  43 + roslaunch aquanaute_gazebo world.launch
53 44 ```
54 45 ## Author
55 46 Ricardo RICO URIBE intern at U2IS in the summer of 2020
56 47  
57   -## Code
58   -### .launch
59   -```xml
60   -<?xml version="1.0"?>
61   -<launch>
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   - H = stern trusters on each hull
88   - T = H with a lateral thruster
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="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)
116   - -R $(arg R) -P $(arg P) -Y $(arg Y)
117   - -urdf -param $(arg namespace)/robot_description -model aquanaute"/>
118   -</launch>
119   -```
120   -### ocean.world.xacro
121   -```xml
122   -<?xml version="1.0" ?>
123   -<!--
124   - Copyright (C) 2019 Rhys Mainwaring
125   -
126   -
127   - Licensed under the Apache License, Version 2.0 (the "License");
128   - you may not use this file except in compliance with the License.
129   - You may obtain a copy of the License at
130   -
131   - http://www.apache.org/licenses/LICENSE-2.0
132   -
133   - Unless required by applicable law or agreed to in writing, software
134   - distributed under the License is distributed on an "AS IS" BASIS,
135   - WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
136   - See the License for the specific language governing permissions and
137   - limitations under the License.
138   -
139   --->
140   -<sdf version="1.6"
141   - xmlns:xacro="http://ros.org/wiki/xacro">
142   - <world name="ocean_world">
143   -
144   - <!-- GUI -->
145   - <gui>
146   - <plugin name="keyboard_gui_plugin" filename="libKeyboardGUIPlugin.so"/>
147   - <camera name='user_camera'>
148   - <pose frame=''>40 40 20 0 0.4 180</pose>
149   - <view_controller>orbit</view_controller>
150   - <projection_type>perspective</projection_type>
151   - </camera>
152   - </gui>
153   -
154   - <!-- Scene -->
155   - <scene>
156   - <sky>
157   - <time>10</time>
158   - <sunrise>6</sunrise>
159   - <sunset>18</sunset>
160   - <clouds>
161   - <speed>12</speed>
162   - <direction>1.57079</direction>
163   - </clouds>
164   - </sky>
165   - <grid>false</grid>
166   - <origin_visual>false</origin_visual>
167   - </scene>
168   -
169   - <!-- Lights -->
170   - <include>
171   - <uri>model://sun</uri>
172   - </include>
173   -
174   - <!--Waves-->
175   - <xacro:include filename="$(find wave_gazebo)/world_models/ocean_waves/model.xacro"/>
176   - <xacro:ocean_waves gain="0.0" period="5" direction_x="-1.0" direction_y="0.0" angle="0.0"/>
177   -
178   - <!--Wind for the WAM-V. Note, wind parameters are set in the plug.-->
179   - <xacro:include filename="$(find vrx_gazebo)/worlds/xacros/usv_wind_plugin.xacro"/>
180   - <xacro:usv_wind_gazebo direction="90" mean_vel="0.0" var_gain="5" var_time="1">
181   - <wind_objs>
182   - <wind_obj>
183   - <name>aquanaute</name>
184   - <link_name>base_link</link_name>
185   - <coeff_vector>0.5 0.5 0.33</coeff_vector>
186   - </wind_obj>
187   - </wind_objs>
188   - </xacro:usv_wind_gazebo>
189   - </world>
190   -</sdf>
191   -
192   -
193   -```
194   -
195 48 ## License
196 49  
197 50  
... ...
aquanaute_description/urdf/aquanaute_description.urdf.xacro
1 1 <?xml version="1.0"?>
2   -<robot xmlns:xacro="http://ros.org/wiki/xacro" name="aquanaute">
  2 +<robot xmlns:xacro="http://ros.org/wiki/xacro">
3 3  
4 4 <material name="blue">
5 5 <color rgba="0 0 0.8 1"/>
... ...
aquanaute_gazebo/launch/world.launch 0 → 100644
... ... @@ -0,0 +1,47 @@
  1 +<?xml version="1.0"?>
  2 +<launch>
  3 + <env name="ROSCONSOLE_CONFIG_FILE" value="$(find vrx_gazebo)/config/custom_rosconsole.conf"/>
  4 + <!-- Gazebo world to load -->
  5 + <arg name="world" default="$(find vrx_gazebo)/worlds/ocean.world" />
  6 + <!-- If true, run gazebo GUI -->
  7 + <arg name="gui" default="true" />
  8 + <!-- If true, run gazebo in verbose mode -->
  9 + <arg name="verbose" default="true"/>
  10 + <!-- If true, start in paused state -->
  11 + <arg name="paused" default="false"/>
  12 + <!-- Set various other gazebo arguments-->
  13 + <arg name="extra_gazebo_args" default=""/>
  14 + <!-- Start in a default namespace -->
  15 + <arg name="namespace" default="aquanaute"/>
  16 +
  17 + <!-- Initial USV location and attitude-->
  18 + <arg name="x" default="0" />
  19 + <arg name="y" default="0" />
  20 + <arg name="z" default="0.1" />
  21 + <arg name="P" default="0" />
  22 + <arg name="R" default="0" />
  23 + <arg name="Y" default="0" />
  24 +
  25 + <env name="VRX_DEBUG" value="true"/>
  26 +
  27 + <!-- Start Gazebo with the world file -->
  28 + <include file="$(find gazebo_ros)/launch/empty_world.launch">
  29 + <arg name="world_name" value="$(arg world)"/>
  30 + <arg name="verbose" value="$(arg verbose)"/>
  31 + <arg name="paused" value="$(arg paused)"/>
  32 + <arg name="use_sim_time" value="true"/>
  33 + <arg name="gui" value="$(arg gui)" />
  34 + <arg name="enable_ros_network" value="true"/>
  35 + <arg name="extra_gazebo_args" value="$(arg extra_gazebo_args)"/>
  36 + </include>
  37 +
  38 + <!-- Load robot model -->
  39 + <arg name="urdf" default="$(find aquanaute_gazebo)/urdf/aquanaute_gazebo.urdf.xacro"/>
  40 + <param name="$(arg namespace)/robot_description" command="$(find xacro)/xacro '$(arg urdf)'"/>
  41 +
  42 + <!-- Spawn model in Gazebo, script depending on non_competition_mode -->
  43 + <node name="spawn_model" pkg="gazebo_ros" type="spawn_model" args="-x $(arg x) -y $(arg y) -z $(arg z)
  44 + -R $(arg R) -P $(arg P) -Y $(arg Y)
  45 + -urdf -param $(arg namespace)/robot_description -model aquanaute"/>
  46 +</launch>
  47 +
... ...
aquanaute_gazebo/urdf/aquanaute_gazebo.urdf.xacro
1 1 <?xml version="1.0"?>
2 2 <!-- Basic WAM-V with gazebo plugins for dynamics -->
3   -<robot xmlns:xacro="http://ros.org/wiki/xacro" name="aquanaute">
  3 +<robot xmlns:xacro="http://ros.org/wiki/xacro">
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" name="aquanaute"/>
  7 + <xacro:include filename="$(find aquanaute_description)/urdf/aquanaute_description.urdf.xacro"/>
8 8 <!-- Attach hydrodynamics plugin -->
9 9 <xacro:usv_dynamics_gazebo name="aquanaute_dynamics_plugin"/>
10 10 </robot>
... ...