forked from Field-Robotics-Lab/dave
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from IOES-Lab/dave-sensor
Moved nortek_dvl500_300 to separate package dave_sensor_models
- Loading branch information
Showing
17 changed files
with
217 additions
and
23 deletions.
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
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
79 changes: 79 additions & 0 deletions
79
examples/dave_demos/launch/sensor_in_empty_world.launch.py
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,79 @@ | ||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription | ||
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.conditions import IfCondition | ||
from launch_ros.substitutions import FindPackageShare | ||
|
||
|
||
def generate_launch_description(): | ||
use_sim = LaunchConfiguration("use_sim") | ||
sensor_name = LaunchConfiguration("sensor_name") | ||
gazebo_world_file = LaunchConfiguration("gazebo_world_file") | ||
|
||
# Declare the launch arguments with default values | ||
args = [ | ||
DeclareLaunchArgument( | ||
"gazebo_world_file", | ||
default_value="empty.sdf", | ||
description="Gazebo world file to launch", | ||
), | ||
DeclareLaunchArgument( | ||
"use_sim", | ||
default_value="true", | ||
description="Flag to indicate whether to use simulation", | ||
), | ||
DeclareLaunchArgument( | ||
"sensor_name", | ||
default_value="nortek_dvl500_300", | ||
description="Name of the model to load", | ||
), | ||
] | ||
|
||
# Include the first launch file | ||
gz_sim_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
[ | ||
PathJoinSubstitution( | ||
[ | ||
FindPackageShare("ros_gz_sim"), | ||
"launch", | ||
"gz_sim.launch.py", | ||
] | ||
) | ||
] | ||
), | ||
launch_arguments=[ | ||
( | ||
"gz_args", | ||
[ | ||
"-r ", | ||
gazebo_world_file, | ||
], | ||
), | ||
], | ||
condition=IfCondition(use_sim), | ||
) | ||
|
||
# Include the second launch file with model name | ||
model_launch = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
[ | ||
PathJoinSubstitution( | ||
[ | ||
FindPackageShare("dave_sensor_models"), | ||
"launch", | ||
"upload_sensor.launch.py", | ||
] | ||
) | ||
] | ||
), | ||
launch_arguments={ | ||
"sensor_name": sensor_name, | ||
"use_sim": use_sim, | ||
}.items(), | ||
) | ||
|
||
include = [gz_sim_launch, model_launch] | ||
|
||
return LaunchDescription(args + include) |
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
11 changes: 11 additions & 0 deletions
11
models/dave_object_models/description/mossy_cinder_block/model.config
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 @@ | ||
<?xml version='1.0'?> | ||
|
||
<model> | ||
<name>mossy_cinder_block</name> | ||
<version>1.0</version> | ||
<sdf version="1.7">model.sdf</sdf> | ||
|
||
<description> | ||
A mossy cinder block | ||
</description> | ||
</model> |
2 changes: 1 addition & 1 deletion
2
models/dave_object_models/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
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
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?><package format="3"> | ||
<name>dave_object_models</name> | ||
<version>0.1.0</version> | ||
<description>Dave model description files are placed here.</description> | ||
<description>Dave object model description files are placed here.</description> | ||
<maintainer email="[email protected]">Rakesh Vivekanandan</maintainer> | ||
<license>MIT</license> | ||
<buildtool_depend>ament_cmake</buildtool_depend> | ||
|
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 @@ | ||
<?xml version='1.0'?> | ||
|
||
<model> | ||
<name>rexrov</name> | ||
<version>1.0</version> | ||
<sdf version="1.7">model.sdf</sdf> | ||
|
||
<description> | ||
Rexrov underwater vehicle | ||
</description> | ||
</model> |
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,14 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(dave_sensor_models) | ||
|
||
find_package(ament_cmake REQUIRED) | ||
|
||
install( | ||
DIRECTORY description launch meshes | ||
DESTINATION share/dave_sensor_models | ||
) | ||
|
||
ament_environment_hooks( | ||
"${CMAKE_CURRENT_SOURCE_DIR}/hooks/${PROJECT_NAME}.dsv.in") | ||
|
||
ament_package() |
11 changes: 11 additions & 0 deletions
11
models/dave_sensor_models/description/nortek_dvl500_300/model.config
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 @@ | ||
<?xml version='1.0'?> | ||
|
||
<model> | ||
<name>dvl500_300</name> | ||
<version>1.0</version> | ||
<sdf version="1.7">model.sdf</sdf> | ||
|
||
<description> | ||
Nortek DVL500-300m | ||
</description> | ||
</model> |
2 changes: 1 addition & 1 deletion
2
...s/description/nortek_dvl500_300/model.sdf → ...s/description/nortek_dvl500_300/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
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 @@ | ||
prepend-non-duplicate;GZ_SIM_RESOURCE_PATH;@CMAKE_INSTALL_PREFIX@/share/@PROJECT_NAME@ |
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,53 @@ | ||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument, RegisterEventHandler, LogInfo | ||
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution | ||
from launch.conditions import IfCondition | ||
from launch_ros.substitutions import FindPackageShare | ||
from launch.event_handlers import OnProcessExit | ||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
sensor_name = LaunchConfiguration("sensor_name") | ||
use_sim = LaunchConfiguration("use_sim") | ||
|
||
args = [ | ||
DeclareLaunchArgument( | ||
"sensor_name", | ||
default_value="", | ||
description="Name of the sensor to load", | ||
), | ||
DeclareLaunchArgument( | ||
"use_sim", | ||
default_value="true", | ||
description="Flag to indicate whether to use simulation", | ||
), | ||
] | ||
|
||
description_file = PathJoinSubstitution( | ||
[ | ||
FindPackageShare("dave_sensor_models"), | ||
"description", | ||
sensor_name, | ||
"model.sdf", | ||
] | ||
) | ||
|
||
gz_spawner = Node( | ||
package="ros_gz_sim", | ||
executable="create", | ||
arguments=["-name", sensor_name, "-file", description_file], | ||
output="both", | ||
condition=IfCondition(use_sim), | ||
parameters=[{"use_sim_time": use_sim}], | ||
) | ||
|
||
nodes = [gz_spawner] | ||
|
||
event_handlers = [ | ||
RegisterEventHandler( | ||
OnProcessExit(target_action=gz_spawner, on_exit=LogInfo(msg="Model Uploaded")) | ||
) | ||
] | ||
|
||
return LaunchDescription(args + nodes + event_handlers) |
File renamed without changes.
File renamed without changes
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,14 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?><package format="3"> | ||
<name>dave_sensor_models</name> | ||
<version>0.1.0</version> | ||
<description>Dave sensor 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> | ||
<!-- This doesn't work yet https://github.com/gazebosim/ros_gz/pull/492 --> | ||
<!-- <gazebo_ros gazebo_model_path="${prefix}/meshes"/> --> | ||
</export> | ||
</package> |