forked from Field-Robotics-Lab/dave
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[GSOC-46] Fuel model usage and migration to ROS 2 launch files #2
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
757435c
Added examples for launching models from fuel
rakeshv24 b3fc217
converted yaml to python files and added a hook for setting gazebo va…
rakeshv24 0bc6b25
universal trial
woensug-choi ff7746a
nop we need hooks
woensug-choi 1c27b13
typo fix
woensug-choi 8e4df54
updated README and minor code refactoring
rakeshv24 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(dave_demos) | ||
|
||
find_package(ament_cmake REQUIRED) | ||
|
||
install( | ||
DIRECTORY launch | ||
DESTINATION share/dave_demos | ||
) | ||
|
||
ament_package() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
## Examples | ||
|
||
### 1. Launching a Dave Model using Fuel URI | ||
|
||
To launch a Dave model directly from a Fuel URI, follow these steps: | ||
|
||
1. Build and source the workspace: | ||
```bash | ||
colcon build && source install/setup.bash | ||
``` | ||
2. Launch the model using the specified launch file: | ||
```bash | ||
ros2 launch dave_demos mossy_cinder_block.launch.yaml | ||
``` | ||
|
||
This method simplifies the process by pulling the model directly from Fuel, ensuring you always have the latest version without needing to manage local files. | ||
|
||
### 2. Launching a Dave Model using Downloaded Model Files | ||
|
||
If you prefer to use model files downloaded from Fuel, proceed as follows: | ||
|
||
1. Set the resource path to your local model files: | ||
```bash | ||
export GZ_SIM_RESOURCE_PATH=<Path-to-dave_ws>/src/dave/dave_model_description | ||
``` | ||
2. Build and source the workspace: | ||
```bash | ||
colcon build && source install/setup.bash | ||
``` | ||
3. Launch the model using the provided launch file: | ||
```bash | ||
ros2 launch dave_demos nortek_dvl500_300_bare_model.launch.yaml | ||
``` | ||
|
||
This approach gives you more control over the models you use, allowing for offline use and customization. It's especially useful when working in environments with limited internet connectivity or when specific model versions are required. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
launch: | ||
- arg: | ||
name: gazebo_world_file | ||
default: empty.sdf | ||
|
||
- arg: | ||
name: use_sim | ||
default: "true" | ||
|
||
- arg: | ||
name: model_name | ||
default: mossy_cinder_block | ||
|
||
- include: | ||
file: $(find-pkg-share ros_gz_sim)/launch/gz_sim.launch.py | ||
arg: | ||
- name: gz_args | ||
value: -v 4 -r $(var gazebo_world_file) | ||
|
||
- include: | ||
file: $(find-pkg-share dave_model_description)/launch/$(var model_name)/upload_$(var model_name).launch.yaml | ||
arg: | ||
- name: namespace | ||
value: $(var model_name) | ||
- name: use_sim | ||
value: $(var use_sim) |
26 changes: 26 additions & 0 deletions
26
dave_demos/launch/nortek_dvl500_300_bare_model.launch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
launch: | ||
- arg: | ||
name: gazebo_world_file | ||
default: empty.sdf | ||
|
||
- arg: | ||
name: use_sim | ||
default: "true" | ||
|
||
- arg: | ||
name: model_name | ||
default: nortek_dvl500_300_bare_model | ||
|
||
- include: | ||
file: $(find-pkg-share ros_gz_sim)/launch/gz_sim.launch.py | ||
arg: | ||
- name: gz_args | ||
value: -v 4 -r $(var gazebo_world_file) | ||
|
||
- include: | ||
file: $(find-pkg-share dave_model_description)/launch/$(var model_name)/upload_$(var model_name).launch.yaml | ||
arg: | ||
- name: namespace | ||
value: $(var model_name) | ||
- name: use_sim | ||
value: $(var use_sim) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
|
||
<name>dave_demos</name> | ||
<version>0.1.0</version> | ||
<description> A package for demo launch files.</description> | ||
|
||
<maintainer email="[email protected]">Rakesh Vivekanandan</maintainer> | ||
|
||
<license>MIT</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(dave_model_description) | ||
|
||
find_package(ament_cmake REQUIRED) | ||
|
||
install( | ||
DIRECTORY description launch meshes | ||
DESTINATION share/dave_model_description | ||
) | ||
|
||
ament_package() |
10 changes: 10 additions & 0 deletions
10
dave_model_description/description/mossy_cinder_block/model.sdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?xml version="1.0" ?> | ||
<sdf version="1.5"> | ||
<include> | ||
<name>mossy_cinder_block</name> | ||
<pose>0 0 0 0 0 0</pose> | ||
<uri> | ||
https://fuel.gazebosim.org/1.0/hmoyen/models/mossy_cinder_block | ||
</uri> | ||
</include> | ||
</sdf> |
97 changes: 97 additions & 0 deletions
97
dave_model_description/description/nortek_dvl500_300_bare_model/model.sdf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
<?xml version="1.0"?> | ||
<sdf version="1.6"> | ||
<model name="dvl500_300"> | ||
<link name="dvl500_base_link"> | ||
<pose>0 0 0 0 0 0</pose> | ||
<inertial> | ||
<pose>0 0 0 0 0 0</pose> | ||
<mass>3.5</mass> | ||
<inertia> | ||
<ixx>0.0195872</ixx> | ||
<ixy>0</ixy> | ||
<ixz>0</ixz> | ||
<iyy>0.0195872</iyy> | ||
<iyz>0</iyz> | ||
<izz>0.0151357</izz> | ||
</inertia> | ||
</inertial> | ||
<velocity_decay/> | ||
<gravity>1</gravity> | ||
<velocity_decay/> | ||
<!-- Removed sensor --> | ||
<self_collide>0</self_collide> | ||
<enable_wind>0</enable_wind> | ||
<kinematic>0</kinematic> | ||
<visual name="dvl500_base_link_visual"> | ||
<pose>0 0 0 0 0 3.14159</pose> | ||
<geometry> | ||
<mesh> | ||
<scale>1 1 1</scale> | ||
<!-- Mesh is actually for a Nortek DVL1000-4000m for now --> | ||
<uri>model://meshes/nortek_dvl500_300_bare_model/DVL500-300m.dae</uri> | ||
</mesh> | ||
</geometry> | ||
<transparency>0</transparency> | ||
<cast_shadows>1</cast_shadows> | ||
</visual> | ||
<collision name="dvl500_base_link_collision"> | ||
<laser_retro>0</laser_retro> | ||
<max_contacts>10</max_contacts> | ||
<pose>0 0 0 3.14159 0 0</pose> | ||
<geometry> | ||
<cylinder> | ||
<radius>0.093</radius> | ||
<length>0.203</length> | ||
</cylinder> | ||
</geometry> | ||
<surface> | ||
<friction> | ||
<ode> | ||
<mu>1</mu> | ||
<mu2>1</mu2> | ||
<fdir1>0 0 0</fdir1> | ||
<slip1>0</slip1> | ||
<slip2>0</slip2> | ||
</ode> | ||
<torsional> | ||
<coefficient>1</coefficient> | ||
<patch_radius>0</patch_radius> | ||
<surface_radius>0</surface_radius> | ||
<use_patch_radius>1</use_patch_radius> | ||
<ode> | ||
<slip>0</slip> | ||
</ode> | ||
</torsional> | ||
</friction> | ||
<bounce> | ||
<restitution_coefficient>0</restitution_coefficient> | ||
<threshold>1e+06</threshold> | ||
</bounce> | ||
<contact> | ||
<collide_without_contact>0</collide_without_contact> | ||
<collide_without_contact_bitmask>1</collide_without_contact_bitmask> | ||
<collide_bitmask>1</collide_bitmask> | ||
<ode> | ||
<soft_cfm>0</soft_cfm> | ||
<soft_erp>0.2</soft_erp> | ||
<kp>1e+13</kp> | ||
<kd>1</kd> | ||
<max_vel>0.01</max_vel> | ||
<min_depth>0</min_depth> | ||
</ode> | ||
<bullet> | ||
<split_impulse>1</split_impulse> | ||
<split_impulse_penetration_threshold>-0.01</split_impulse_penetration_threshold> | ||
<soft_cfm>0</soft_cfm> | ||
<soft_erp>0.2</soft_erp> | ||
<kp>1e+13</kp> | ||
<kd>1</kd> | ||
</bullet> | ||
</contact> | ||
</surface> | ||
</collision> | ||
</link> | ||
<static>0</static> | ||
<allow_auto_disable>1</allow_auto_disable> | ||
</model> | ||
</sdf> |
18 changes: 18 additions & 0 deletions
18
dave_model_description/launch/mossy_cinder_block/upload_mossy_cinder_block.launch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
launch: | ||
|
||
- arg: | ||
name: use_sim | ||
default: "true" | ||
|
||
- arg: | ||
name: model_name | ||
default: mossy_cinder_block | ||
|
||
- let: | ||
name: description_file | ||
value: $(find-pkg-share dave_model_description)/description/$(var model_name)/model.sdf | ||
|
||
- node: | ||
pkg: ros_gz_sim | ||
exec: create | ||
args: -name $(var model_name) -file $(var description_file) |
18 changes: 18 additions & 0 deletions
18
...ption/launch/nortek_dvl500_300_bare_model/upload_nortek_dvl500_300_bare_model.launch.yaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
launch: | ||
|
||
- arg: | ||
name: use_sim | ||
default: "true" | ||
|
||
- arg: | ||
name: model_name | ||
default: nortek_dvl500_300_bare_model | ||
|
||
- let: | ||
name: description_file | ||
value: $(find-pkg-share dave_model_description)/description/$(var model_name)/model.sdf | ||
|
||
- node: | ||
pkg: ros_gz_sim | ||
exec: create | ||
args: -name $(var model_name) -x 0 -y 0 -z 0 -file $(var description_file) |
115 changes: 115 additions & 0 deletions
115
dave_model_description/meshes/nortek_dvl500_300_bare_model/DVL500-300m.dae
Large diffs are not rendered by default.
Oops, something went wrong.
Binary file added
BIN
+262 KB
dave_model_description/meshes/nortek_dvl500_300_bare_model/tx-DVL500-300m.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> | ||
<package format="3"> | ||
|
||
<name>dave_model_description</name> | ||
<version>0.1.0</version> | ||
<description> Dave model description files are placed here. </description> | ||
|
||
<maintainer email="[email protected]">Rakesh Vivekanandan</maintainer> | ||
|
||
<license>MIT</license> | ||
|
||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
gazebosim/ros_gz#492 Could you try this to get rid of this step?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've no experience with
hooks
but it seems it's another alternativeReference: https://github.com/gazebosim/ros_gz/tree/ros2/ros_gz_sim_demos
Also... hard to ask, but with best wishes, it seems
ros_gz
's demo is now all in python. What do you think of working with python from this and now on? With power of chatgptThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All other parts worked fine! Thank you so much for investigating the previous dave structure and attempt to follow how it was done 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing, I'll make those changes!