Skip to content

Commit

Permalink
Add heightmap terrain
Browse files Browse the repository at this point in the history
  • Loading branch information
mmattamala committed Jan 15, 2024
1 parent e34fc27 commit 0644e8d
Show file tree
Hide file tree
Showing 7 changed files with 349 additions and 9 deletions.
1 change: 1 addition & 0 deletions wild_visual_navigation_sim/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ catkin_package(
# scripts/rosbag_play.sh
# DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION})

message(${CATKIN_PACKAGE_SHARE_DESTINATION})
install(DIRECTORY launch Media worlds
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}
)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions wild_visual_navigation_sim/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,16 @@ Simulation environment to test Wild Visual Navigation (WVN). We use a modified C
## Requirements

```sh
sudo apt install ros-noetic-jackal-simulator
$ sudo apt update
$ sudo apt install -y \
ros-noetic-jackal-simulator \
ros-noetic-jackal-desktop \
ros-noetic-teleop-twist-keyboard \
ros-noetic-rqt-robot-steering \
```

## Running

```sh
roslaunch wild_visual_navigation_sim sim.launch
$ roslaunch wild_visual_navigation_sim sim.launch
```
7 changes: 2 additions & 5 deletions wild_visual_navigation_sim/launch/sim.launch
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,8 @@
<arg name="use_sim_time" default="true" />
<arg name="gui" default="true" />
<arg name="headless" default="false" />
<arg name="world_name" default="$(find wild_visual_navigation_sim)/worlds/scenario.world" />
<arg name="world_name" default="$(find wild_visual_navigation_sim)/worlds/outdoor.world" />
<arg name="jackal_config" value="front_flea3" /> <!-- add camera -->

<!-- Optionally enable teleop for the simulation -->
<arg name="joystick" default="false" />

<!-- Launch Gazebo with the specified world -->
<include file="$(find gazebo_ros)/launch/empty_world.launch">
Expand All @@ -30,7 +27,7 @@
<arg name="z" value="1.0" />
<arg name="yaw" value="0" />
<arg name="config" value="$(arg jackal_config)" />
<arg name="joystick" value="$(arg joystick)" />
<arg name="joystick" value="false" />
</include>


Expand Down
1 change: 1 addition & 0 deletions wild_visual_navigation_sim/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,6 @@
<exec_depend>gazebo_ros</exec_depend>
<export>
<gazebo_ros gazebo_media_path="${prefix}"/>
<gazebo_ros gazebo_model_path="${prefix}/models"/>
</export>
</package>
336 changes: 336 additions & 0 deletions wild_visual_navigation_sim/worlds/outdoor.world
Original file line number Diff line number Diff line change
@@ -0,0 +1,336 @@
<?xml version="1.0"?>
<sdf version='1.6'>
<world name='small_outdoor'>
<scene>
<ambient>0.2 0.2 0.2 1</ambient>
<shadows>1</shadows>
<grid>0</grid>
<sky>
<clouds>
<speed>4</speed>
</clouds>
</sky>
<background>0.7 0.7 0.7 1</background>
</scene>
<physics type="ode">
<ode>
<solver>
<type>quick</type>
<iters>10</iters>
<sor>1.3</sor>
</solver>
<constraints>
<cfm>0.0</cfm>
<erp>0.2</erp>
<contact_max_correcting_vel>10</contact_max_correcting_vel>
<contact_surface_layer>0.001</contact_surface_layer>
</constraints>
</ode>
<max_step_size>0.001</max_step_size>
</physics>
<gravity>0 0 -9.81</gravity>
<light name='sun' type='directional'>
<cast_shadows>1</cast_shadows>
<pose frame=''>0 0 100 0 -0 0</pose>
<diffuse>0.8 0.8 0.8 1</diffuse>
<specular>0.9 0.9 0.9 1</specular>
<attenuation>
<range>1000</range>
<constant>0.1</constant>
<linear>0.01</linear>
<quadratic>0.001</quadratic>
</attenuation>
<direction>0.2 0.2 -0.9</direction>
</light>
<model name='heightmap_terrain'>
<static>1</static>
<link name='link'>
<collision name='collision'>
<geometry>
<heightmap>
<uri>
file://heightmap.png</uri>
<size>30 30 12</size>
<pos>0 0 -1</pos>
<texture>
<size>10</size>
<diffuse>__default__</diffuse>
<normal>__default__</normal>
</texture>
<blend>
<min_height>0</min_height>
<fade_dist>0</fade_dist>
</blend>
</heightmap>
</geometry>
<max_contacts>10</max_contacts>
<surface>
<contact>
<ode />
</contact>
<bounce />
<friction>
<torsional>
<ode />
</torsional>
<ode />
</friction>
</surface>
</collision>
<visual name='visual'>
<geometry>
<heightmap>
<texture>
<diffuse>file://media/materials/textures/dirt_diffusespecular.png</diffuse>
<normal>file://media/materials/textures/flat_normal.png</normal>
<size>7</size>
</texture>
<texture>
<diffuse>file://media/materials/textures/grass_diffusespecular.png</diffuse>
<normal>file://media/materials/textures/flat_normal.png</normal>
<size>3</size>
</texture>
<texture>
<diffuse>file://media/materials/textures/fungus_diffusespecular.png</diffuse>
<normal>file://media/materials/textures/flat_normal.png</normal>
<size>4</size>
</texture>
<blend>
<min_height>0</min_height>
<fade_dist>0.05</fade_dist>
</blend>
<blend>
<min_height>-1</min_height>
<fade_dist>7</fade_dist>
</blend>
<uri>
file://heightmap.png</uri>
<size>30 30 12</size>
<pos>0 0 -1</pos>
</heightmap>
</geometry>
</visual>
<self_collide>0</self_collide>
<enable_wind>0</enable_wind>
<kinematic>0</kinematic>
</link>
</model>

<!-- Trees!!! -->
<model name="tree1">
<static>true</static>
<link name="tree1_link">
<pose>3 3 0.6 0 0 0</pose>
<collision name="tree1_collision">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree1_visual">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>

<model name="tree2">
<static>true</static>
<link name="tree2_link">
<pose>5 6 0.7 0 0 0.3</pose>
<collision name="tree2_collision">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree2_visual">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>

<model name="tree3">
<static>true</static>
<link name="tree3_link">
<pose>1 8 0.9 0 0 0</pose>
<collision name="tree3_collision">
<geometry>
<mesh>
<uri>file://OliveTree2.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree3_visual">
<geometry>
<mesh>
<uri>file://OliveTree2.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>

<model name="tree4">
<static>true</static>
<link name="tree4_link">
<pose>-5 4 0.8 0 0 0.1</pose>
<collision name="tree4_collision">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree4_visual">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>

<model name="tree5">
<static>true</static>
<link name="tree5_link">
<pose>-10 -3 1.1 0 0 0.3</pose>
<collision name="tree5_collision">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree5_visual">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>

<model name="tree6">
<static>true</static>
<link name="tree6_link">
<pose>-6 -1 1.02 0 0 0.5</pose>
<collision name="tree6_collision">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree6_visual">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>

<model name="tree7">
<static>true</static>
<link name="tree7_link">
<pose>-1 1 0.8 0 0 0.2</pose>
<collision name="tree7_collision">
<geometry>
<mesh>
<uri>file://OliveTree2.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree7_visual">
<geometry>
<mesh>
<uri>file://OliveTree2.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>

<model name="tree8">
<static>true</static>
<link name="tree8_link">
<pose>9 -4 0.5 0 0 0.5</pose>
<collision name="tree8_collision">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree8_visual">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>

<model name="tree9">
<static>true</static>
<link name="tree9_link">
<pose>6 -0.5 0.8 0 0 0.5</pose>
<collision name="tree9_collision">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
</collision>
<visual name="tree9_visual">
<geometry>
<mesh>
<uri>file://OliveTree1.dae</uri>
<scale>1 1 1</scale>
</mesh>
</geometry>
<cast_shadows>false</cast_shadows>
</visual>
</link>
</model>
</world>
</sdf>
Loading

0 comments on commit 0644e8d

Please sign in to comment.