-
Notifications
You must be signed in to change notification settings - Fork 1
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
2f5e4bb
commit 982262e
Showing
14 changed files
with
2,697 additions
and
0 deletions.
There are no files selected for viewing
88 changes: 88 additions & 0 deletions
88
simulator/simulator/launch/gazebo_simulator_active_caster.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,88 @@ | ||
import os.path as osp | ||
from launch import LaunchDescription | ||
from launch_ros.actions import Node | ||
from launch.actions import ( | ||
DeclareLaunchArgument, IncludeLaunchDescription, ExecuteProcess | ||
) | ||
from launch.substitutions import LaunchConfiguration | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
def generate_launch_description(): | ||
VEHICLE_NAME = "ai_car_active_caster" | ||
launch_args = ( | ||
DeclareLaunchArgument( | ||
"world_name", | ||
default_value="shihou_course", | ||
description="World Name", | ||
), | ||
DeclareLaunchArgument( | ||
"vehicle_name", | ||
default_value="ai_car_active_caster", | ||
description="Vehicle Name", | ||
), | ||
DeclareLaunchArgument( | ||
"world_path", | ||
default_value=[ | ||
osp.join(get_package_share_directory("simulator"), "worlds", ""), | ||
LaunchConfiguration("world_name"), "/", | ||
LaunchConfiguration("vehicle_name"), ".model" | ||
], | ||
description="Path to world file.", | ||
), | ||
DeclareLaunchArgument( | ||
"use_sim_time", | ||
default_value="true", | ||
description="If true, use simulation (Gazebo) clock", | ||
), | ||
) | ||
|
||
tf_static_publisher = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
osp.join(get_package_share_directory("vehicle"), | ||
"launch/extrinsic_tfstatic_broadcaster_no_namespace.launch.py"), | ||
), | ||
launch_arguments={ | ||
"vehicle_name": VEHICLE_NAME, | ||
"use_sim_time": LaunchConfiguration("use_sim_time"), | ||
}.items(), | ||
) | ||
# ExecuteProcess( | ||
# cmd=["export", "GAZEBO_MODEL_PATH=$(ros2 pkg prefix vehicle)/share/vehicle/xacro"], | ||
# shell=True), | ||
gzserver = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
osp.join(get_package_share_directory("gazebo_ros"), | ||
"launch/gzserver.launch.py"), | ||
), | ||
launch_arguments={ | ||
"world": LaunchConfiguration("world_path"), | ||
"world_name": LaunchConfiguration("world_name"), | ||
}.items(), | ||
) | ||
gzclient = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
osp.join(get_package_share_directory("gazebo_ros"), | ||
"launch/gzclient.launch.py"), | ||
), | ||
) | ||
set_use_sim_time = ExecuteProcess( | ||
cmd=['ros2', 'param', 'set', '/gazebo', | ||
'use_sim_time', LaunchConfiguration("use_sim_time")], | ||
output='screen' | ||
) | ||
|
||
return LaunchDescription([ | ||
*launch_args, | ||
tf_static_publisher, | ||
gzserver, | ||
gzclient, | ||
set_use_sim_time, | ||
Node( | ||
package='controller_manager', | ||
executable='spawner.py', | ||
arguments=['position_controller'], | ||
output='screen' | ||
) | ||
]) |
81 changes: 81 additions & 0 deletions
81
simulator/simulator/launch/gazebo_simulator_caster_trail.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,81 @@ | ||
import os.path as osp | ||
from launch import LaunchDescription | ||
from launch.actions import ( | ||
DeclareLaunchArgument, IncludeLaunchDescription, ExecuteProcess | ||
) | ||
from launch.substitutions import LaunchConfiguration | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from ament_index_python.packages import get_package_share_directory | ||
|
||
|
||
def generate_launch_description(): | ||
VEHICLE_NAME = "ai_car_caster_trail" | ||
launch_args = ( | ||
DeclareLaunchArgument( | ||
"world_name", | ||
default_value="shihou_course", | ||
description="World Name", | ||
), | ||
DeclareLaunchArgument( | ||
"vehicle_name", | ||
default_value="ai_car_caster_trail", | ||
description="Vehicle Name", | ||
), | ||
DeclareLaunchArgument( | ||
"world_path", | ||
default_value=[ | ||
osp.join(get_package_share_directory("simulator"), "worlds", ""), | ||
LaunchConfiguration("world_name"), "/", | ||
LaunchConfiguration("vehicle_name"), ".model" | ||
], | ||
description="Path to world file.", | ||
), | ||
DeclareLaunchArgument( | ||
"use_sim_time", | ||
default_value="true", | ||
description="If true, use simulation (Gazebo) clock", | ||
), | ||
) | ||
|
||
tf_static_publisher = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
osp.join(get_package_share_directory("vehicle"), | ||
"launch/extrinsic_tfstatic_broadcaster_no_namespace.launch.py"), | ||
), | ||
launch_arguments={ | ||
"vehicle_name": VEHICLE_NAME, | ||
"use_sim_time": LaunchConfiguration("use_sim_time"), | ||
}.items(), | ||
) | ||
# ExecuteProcess( | ||
# cmd=["export", "GAZEBO_MODEL_PATH=$(ros2 pkg prefix vehicle)/share/vehicle/xacro"], | ||
# shell=True), | ||
gzserver = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
osp.join(get_package_share_directory("gazebo_ros"), | ||
"launch/gzserver.launch.py"), | ||
), | ||
launch_arguments={ | ||
"world": LaunchConfiguration("world_path"), | ||
"world_name": LaunchConfiguration("world_name"), | ||
}.items(), | ||
) | ||
gzclient = IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource( | ||
osp.join(get_package_share_directory("gazebo_ros"), | ||
"launch/gzclient.launch.py"), | ||
), | ||
) | ||
set_use_sim_time = ExecuteProcess( | ||
cmd=['ros2', 'param', 'set', '/gazebo', | ||
'use_sim_time', LaunchConfiguration("use_sim_time")], | ||
output='screen' | ||
) | ||
|
||
return LaunchDescription([ | ||
*launch_args, | ||
tf_static_publisher, | ||
gzserver, | ||
gzclient, | ||
set_use_sim_time, | ||
]) |
11 changes: 11 additions & 0 deletions
11
simulator/simulator/models/ai_car_active_caster/controller_position.yaml
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 @@ | ||
controller_manager: | ||
ros__parameters: | ||
update_rate: 30 # Hz | ||
|
||
position_controller: | ||
type: position_controllers/JointGroupPositionController | ||
|
||
position_controller: | ||
ros__parameters: | ||
joints: | ||
- caster_back_steering_joint |
16 changes: 16 additions & 0 deletions
16
simulator/simulator/models/ai_car_active_caster/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,16 @@ | ||
<?xml version="1.0"?> | ||
|
||
<model> | ||
<name>ai_car_active_caster</name> | ||
<version>2.0</version> | ||
<sdf version="1.5">model.sdf</sdf> | ||
|
||
<author> | ||
<name>Masaya Okada</name> | ||
<email>[email protected]</email> | ||
</author> | ||
|
||
<description> | ||
ai_car_active_caster | ||
</description> | ||
</model> |
Oops, something went wrong.