Skip to content

Commit

Permalink
Merge pull request #70 from clubcapra/aws-small-house
Browse files Browse the repository at this point in the history
add aws small house from to rove
  • Loading branch information
SimonR99 authored Nov 20, 2024
2 parents 4c49b88 + 24304cf commit cc822c6
Show file tree
Hide file tree
Showing 5 changed files with 68 additions and 28 deletions.
6 changes: 5 additions & 1 deletion rove.repos
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,8 @@ repositories:
gz_ros2_control:
type: git
url: https://github.com/clubcapra/gz_ros2_control.git
version: iron
version: iron
aws_robomaker_small_house_world:
type: git
url: https://github.com/clubcapra/aws-robomaker-small-house-world.git
version: capra-fix
48 changes: 37 additions & 11 deletions src/rove_bringup/launch/sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,33 +2,58 @@

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.actions import (
DeclareLaunchArgument,
IncludeLaunchDescription,
SetEnvironmentVariable,
)
from launch.conditions import IfCondition, UnlessCondition
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command
from launch.substitutions import Command, LaunchConfiguration
from launch_ros.actions import Node
from launch_ros.parameter_descriptions import ParameterValue


def generate_launch_description():
# Declare launch arguments
declare_small_house_arg = DeclareLaunchArgument(
"small_house",
default_value="false",
description='Set to "true" to use the small house world.',
)

# Get the launch directory
pkg_rove_bringup = get_package_share_directory("rove_bringup")
pkg_rove_description = get_package_share_directory("rove_description")
pkg_ros_gz_sim = get_package_share_directory("ros_gz_sim")
pkg_ovis = get_package_share_directory("ovis_bringup")
pkg_aws_house = get_package_share_directory("aws_robomaker_small_house_world")

# Get simulation file
world_file_name = "worlds/base_world.world"
world = os.path.join(pkg_rove_description, world_file_name)
walls_file_path = os.path.join(pkg_rove_description, "worlds", "walls.sdf")
actor_file_path = os.path.join(pkg_rove_description, "worlds", "actor.sdf")
world_file_path = os.path.join(pkg_rove_description, "worlds", "base_world.world")
small_house_file_path = os.path.join(pkg_aws_house, "worlds", "small_house.world")

model_path = os.path.join(pkg_aws_house, "models")

# Setup to launch the simulator and Gazebo world
gz_sim = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, "launch", "gz_sim.launch.py")
),
launch_arguments={"gz_args": "-v 4 -r " + world}.items(),
launch_arguments={"gz_args": "-v 4 -r " + world_file_path}.items(),
condition=UnlessCondition(LaunchConfiguration("small_house")),
)

gz_sim_house = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ros_gz_sim, "launch", "gz_sim.launch.py")
),
launch_arguments={"gz_args": "-v 4 -r " + small_house_file_path}.items(),
condition=IfCondition(LaunchConfiguration("small_house")),
)

walls_file_path = os.path.join(pkg_rove_description, "worlds", "walls.sdf")
spawn_walls = Node(
package="ros_gz_sim",
executable="create",
Expand All @@ -44,10 +69,10 @@ def generate_launch_description():
"-z",
"0",
],
condition=UnlessCondition(LaunchConfiguration("small_house")),
output="screen",
)

actor_file_path = os.path.join(pkg_rove_description, "worlds", "actor.sdf")
spawn_actor = Node(
package="ros_gz_sim",
executable="create",
Expand All @@ -63,6 +88,7 @@ def generate_launch_description():
"-z",
"0.06",
],
condition=UnlessCondition(LaunchConfiguration("small_house")),
output="screen",
)

Expand Down Expand Up @@ -118,23 +144,23 @@ def generate_launch_description():
}.items(),
)


ovis = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_ovis, "launch", "sim.launch.py"),
),
launch_arguments={
"with_rove": "true",
"with_joy": "false",
"ovis_base_origin": "0.22 0 0.34 0 0 3.14",
"ovis_base_origin": "0.24 0 0.38 0 0 3.14",
}.items(),
)



return LaunchDescription(
[
SetEnvironmentVariable("GZ_SIM_RESOURCE_PATH", model_path),
declare_small_house_arg,
gz_sim,
gz_sim_house,
bridge,
spawn_walls,
spawn_actor,
Expand Down
35 changes: 21 additions & 14 deletions src/rove_description/urdf/gazebo.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,24 @@


<plugin name="gz::sim::systems::TrackedVehicle" filename="gz-sim-tracked-vehicle-system">
<left_track><link>track_l</link></left_track>
<left_track><link>flipper_fl</link></left_track>
<left_track><link>flipper_rl</link></left_track>
<right_track><link>track_r</link></right_track>
<right_track><link>flipper_fr</link></right_track>
<right_track><link>flipper_rr</link></right_track>
<left_track>
<link>track_l</link>
</left_track>
<left_track>
<link>flipper_fl</link>
</left_track>
<left_track>
<link>flipper_rl</link>
</left_track>
<right_track>
<link>track_r</link>
</right_track>
<right_track>
<link>flipper_fr</link>
</right_track>
<right_track>
<link>flipper_rr</link>
</right_track>

<!-- TODO PUT ACTUAL VALUES -->
<tracks_separation>0.63</tracks_separation>
Expand All @@ -30,17 +42,12 @@

<topic>cmd_vel</topic>
<odom_topic>odom</odom_topic>
<frame_id>odom</frame_id>
<frame_id>odom</frame_id>
<child_frame_id>base_link</child_frame_id>
</plugin>

<plugin
filename="gz-sim-sensors-system"
name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>

<plugin filename="gz-sim-navsat-system" name="gz::sim::systems::NavSat"/>
<plugin filename="gz-sim-navsat-system" name="gz::sim::systems::NavSat" />

<gazebo reference="friction_plate_base">
<material>Gazebo/Grey</material>
Expand All @@ -50,4 +57,4 @@
<kd>1.0</kd>
</gazebo>
</gazebo>
</robot>
</robot>
2 changes: 1 addition & 1 deletion src/rove_description/urdf/rove.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<joint name="friction_plate_base_joint" type="fixed">
<parent link="base_link" />
<child link="friction_plate_base" />
<origin xyz="0.22 0 0.2" rpy="0 0 0" />
<origin xyz="0.24 0 0.2" rpy="0 0 0" />
</joint>

<!-- <xacro:rove_ros2_control/> -->
Expand Down
5 changes: 4 additions & 1 deletion src/rove_description/worlds/base_world.world
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,10 @@
<plugin name='gz::sim::systems::UserCommands' filename='gz-sim-user-commands-system' />
<plugin name='gz::sim::systems::SceneBroadcaster' filename='gz-sim-scene-broadcaster-system' />
<plugin name='gz::sim::systems::Contact' filename='gz-sim-contact-system' />

<plugin
filename="gz-sim-sensors-system" name="gz::sim::systems::Sensors">
<render_engine>ogre2</render_engine>
</plugin>

<include>
<pose>3.5 0 0 0 0 3.14</pose>
Expand Down

0 comments on commit cc822c6

Please sign in to comment.