-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
67a271a
commit 1c0c1b8
Showing
3 changed files
with
1,555 additions
and
0 deletions.
There are no files selected for viewing
Empty file.
78 changes: 78 additions & 0 deletions
78
src/subjugator/simulation/subjugator_bringup/launch/gazebo.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,78 @@ | ||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.actions import IncludeLaunchDescription | ||
from launch.conditions import IfCondition | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution | ||
|
||
from launch_ros.actions import Node | ||
|
||
|
||
def generate_launch_description(): | ||
# Configure ROS nodes for launch | ||
|
||
# Setup project paths | ||
pkg_project_bringup = get_package_share_directory('subjugator_bringup') | ||
pkg_project_gazebo = get_package_share_directory('subjugator_gazebo') | ||
pkg_project_description = get_package_share_directory('subjugator_description') | ||
pkg_ros_gz_sim = get_package_share_directory('ros_gz_sim') | ||
|
||
# # Load the SDF file from "description" package | ||
# sdf_file = os.path.join(pkg_project_description, 'models', 'diff_drive', 'model.sdf') | ||
# with open(sdf_file, 'r') as infp: | ||
# robot_desc = infp.read() | ||
|
||
# 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': PathJoinSubstitution([ | ||
pkg_project_gazebo, | ||
'worlds', | ||
'robosub_2024.world' | ||
])}.items(), | ||
) | ||
|
||
# # Takes the description and joint angles as inputs and publishes the 3D poses of the robot links | ||
# robot_state_publisher = Node( | ||
# package='robot_state_publisher', | ||
# executable='robot_state_publisher', | ||
# name='robot_state_publisher', | ||
# output='both', | ||
# parameters=[ | ||
# {'use_sim_time': True}, | ||
# {'robot_description': robot_desc}, | ||
# ] | ||
# ) | ||
|
||
# # Visualize in RViz | ||
# rviz = Node( | ||
# package='rviz2', | ||
# executable='rviz2', | ||
# arguments=['-d', os.path.join(pkg_project_bringup, 'config', 'diff_drive.rviz')], | ||
# condition=IfCondition(LaunchConfiguration('rviz')) | ||
# ) | ||
|
||
# Bridge ROS topics and Gazebo messages for establishing communication | ||
# bridge = Node( | ||
# package='ros_gz_bridge', | ||
# executable='parameter_bridge', | ||
# parameters=[{ | ||
# 'config_file': os.path.join(pkg_project_bringup, 'config', 'ros_gz_example_bridge.yaml'), | ||
# 'qos_overrides./tf_static.publisher.durability': 'transient_local', | ||
# }], | ||
# output='screen' | ||
# ) | ||
|
||
return LaunchDescription([ | ||
gz_sim, | ||
# DeclareLaunchArgument('rviz', default_value='true', | ||
# description='Open RViz.'), | ||
# bridge, | ||
# robot_state_publisher, | ||
# rviz | ||
]) |
Oops, something went wrong.