Skip to content

Commit

Permalink
create sim and real + readme
Browse files Browse the repository at this point in the history
  • Loading branch information
SimonR99 committed May 10, 2024
1 parent 438ec4e commit b659cf2
Show file tree
Hide file tree
Showing 5 changed files with 54 additions and 14 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ Do these commands to run the gazebo simulation with physics enabled
```bash
colcon build --symlink-install
source install/setup.bash
ros2 launch rove_description sim.launch.py
ros2 launch rove_bringup sim.launch.py
```
OR Do these commands to only run the rviz simulation (with joints control)
```bash
Expand Down
11 changes: 6 additions & 5 deletions src/rove_bringup/launch/autonomy.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
from launch.actions import IncludeLaunchDescription

from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command
from launch_ros.actions import Node
from launch_ros.parameter_descriptions import ParameterValue
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
from launch.conditions import IfCondition


def generate_launch_description():
Expand All @@ -17,6 +15,8 @@ def generate_launch_description():
pkg_rove_nav = get_package_share_directory('rove_navigation')
slam_pkg_path = get_package_share_directory("slam_toolbox")

use_slam3d = LaunchConfiguration('use_slam3d')

slam = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(slam_pkg_path, "launch", "online_async_launch.py"),
Expand All @@ -37,6 +37,7 @@ def generate_launch_description():
"use_sim_time": "true",
"deskewing": "true",
}.items(),
condition=IfCondition(use_slam3d)
)

nav = IncludeLaunchDescription(
Expand All @@ -48,6 +49,6 @@ def generate_launch_description():

return LaunchDescription([
slam,
#slam3d,
slam3d,
nav,
])
13 changes: 13 additions & 0 deletions src/rove_bringup/launch/common.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

def generate_launch_description():
# Get the launch directory
pkg_rove_bringup = get_package_share_directory('rove_bringup')
pkg_rove_description = get_package_share_directory('rove_description')
pkg_rove_slam = get_package_share_directory('rove_slam')
bringup_pkg_path = get_package_share_directory('rove_bringup')
Expand Down Expand Up @@ -86,11 +87,23 @@ def generate_launch_description():
),
)

autonomy = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_rove_bringup, "launch", "autonomy.launch.py"),
),
launch_arguments={
"use_sim_time": "true",
"deskewing": "true",
"use_slam3d": "false",
}.items(),
)

return LaunchDescription([
robot_state_publisher,
robot_localization_node_local,
robot_localization_node_global,
navsat_transform,
rviz,
teleop,
autonomy,
])
34 changes: 34 additions & 0 deletions src/rove_bringup/launch/real.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import os

from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription

from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import Command
from launch_ros.actions import Node
from launch_ros.parameter_descriptions import ParameterValue


def generate_launch_description():
# Get the launch directory
pkg_rove_bringup = get_package_share_directory('rove_bringup')

common = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_rove_bringup, "launch", "common.launch.py"),
),
)


###### Sensor ######
vectornav = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_rove_bringup, "launch", "vectornav.launch.py"),
),
)

return LaunchDescription([
common,
vectornav,
])
8 changes: 0 additions & 8 deletions src/rove_bringup/launch/sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,18 +74,10 @@ def generate_launch_description():
),
)


autonomy = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(pkg_rove_bringup, "launch", "autonomy.launch.py"),
),
)

return LaunchDescription([
gz_sim,
bridge,
robot_state_publisher,
create,
common,
autonomy,
])

0 comments on commit b659cf2

Please sign in to comment.