-
Notifications
You must be signed in to change notification settings - Fork 3
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
Showing
4 changed files
with
143 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
import os | ||
import sys | ||
|
||
import launch | ||
import launch_ros.actions | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from launch.actions import DeclareLaunchArgument | ||
from launch.substitutions import LaunchConfiguration | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
|
||
def generate_launch_description(): | ||
|
||
pybullet_render_launch_arg = DeclareLaunchArgument( | ||
name='pybullet_render', | ||
default_value='false' | ||
) | ||
|
||
sim_mode_launch_arg = DeclareLaunchArgument( | ||
name='sim_mode', | ||
default_value='realistic' | ||
) | ||
|
||
simulation_config = os.path.join( | ||
get_package_share_directory('rktl_sim'), | ||
'config', | ||
'simulation.yaml' | ||
) | ||
|
||
urdf_ball_param = os.path.join( | ||
get_package_share_directory('rktl_sim'), | ||
'urdf', | ||
'ball.urdf' | ||
) | ||
|
||
urdf_car_param = os.path.join( | ||
get_package_share_directory('rktl_sim'), | ||
'urdf', | ||
'car.urdf' | ||
) | ||
|
||
urdf_goal_param = os.path.join( | ||
get_package_share_directory('rktl_sim'), | ||
'urdf', | ||
'goal.urdf' | ||
) | ||
|
||
urdf_sidewall_param = os.path.join( | ||
get_package_share_directory('rktl_sim'), | ||
'urdf', | ||
'sidewall.urdf' | ||
) | ||
|
||
urdf_backwall_param = os.path.join( | ||
get_package_share_directory('rktl_sim'), | ||
'urdf', | ||
'backwall.urdf' | ||
) | ||
|
||
urdf_plane_param = os.path.join( | ||
get_package_share_directory('rktl_sim'), | ||
'urdf', | ||
'plane.urdf' | ||
) | ||
|
||
simulator_node = Node( | ||
package='rktl_sim', | ||
executable='simulator', | ||
name='simulator', | ||
parameters=[ | ||
simulation_config, | ||
{ | ||
'mode' : LaunchConfiguration('sim_mode'), | ||
'render' : LaunchConfiguration('pybullet_render'), | ||
'urdf/ball' : urdf_ball_param, | ||
'urdf/car' : urdf_car_param, | ||
'urdf/goal' : urdf_goal_param, | ||
'urdf/sidewall' : urdf_sidewall_param, | ||
'urdf/backwall' : urdf_backwall_param, | ||
'urdf/plane' : urdf_plane_param | ||
} | ||
] | ||
|
||
) | ||
|
||
|
||
return LaunchDescription([ | ||
pybullet_render_launch_arg, | ||
sim_mode_launch_arg, | ||
simulator_node | ||
]) | ||
|
||
if __name__ == '__main__': | ||
generate_launch_description() |
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