forked from carla-simulator/ros-bridge
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcarla_ad_demo_with_scenario.launch
94 lines (82 loc) · 4.94 KB
/
carla_ad_demo_with_scenario.launch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<!-- -->
<launch>
<!-- carla parameter -->
<arg name='host' default='localhost'/> <!-- host the carla server is running on -->
<arg name='port' default='2000'/> <!-- port of the carla server -->
<arg name="town" default="Town01"/> <!-- the carla town to load-->
<arg name='timeout' default='10'/> <!-- the carla timeout for server communication -->
<arg name='synchronous_mode' default='True'/> <!-- should the synchronous mode be used? Enable to get reproducible results independent of the system workload -->
<arg name='synchronous_mode_wait_for_vehicle_control_command' default='False'/><!-- should the ros bridge wait for a vehicle control command before proceeding with the next tick -->
<arg name='fixed_delta_seconds' default='0.05'/><!-- frequency of the carla ticks -->
<!-- scenario runner parameter -->
<arg name='scenario_runner_path' default='$(env SCENARIO_RUNNER_PATH)'/><!-- path to scenario runner -->
<!-- ego vehicle parameter -->
<arg name="role_name" default="ego_vehicle"/> <!-- role name of the ego vehicle (used for identification in many nodes) -->
<arg name="vehicle_filter" default="vehicle.tesla.model3"/> <!-- which vehicle type to use for the ego. See blueprint library for others -->
<arg name="avoid_risk" default="True"/> <!-- should the agent avoid crashs and respect red traffic lights? -->
<!-- spectator camera parameter -->
<arg name='resolution_x' default='800'/> <!-- width of the spectator camera image -->
<arg name='resolution_y' default='600'/> <!-- height of the spectator camera image -->
<arg name='fov' default='50'/> <!-- field of view of the spectator camera. -->
<!-- ===================================================== -->
<!-- The ros bridge -->
<include file="$(find carla_ros_bridge)/launch/carla_ros_bridge.launch">
<arg name='host' value='$(arg host)'/>
<arg name='port' value='$(arg port)'/>
<arg name='town' value='$(arg town)'/>
<arg name='timeout' value='$(arg timeout)'/>
<arg name='synchronous_mode' value='$(arg synchronous_mode)'/>
<arg name='synchronous_mode_wait_for_vehicle_control_command' value='$(arg synchronous_mode_wait_for_vehicle_control_command)'/>
<arg name='fixed_delta_seconds' value='$(arg fixed_delta_seconds)'/>
</include>
<!-- the ego vehicle, that will be controlled by the carla_ad_agent -->
<include file="$(find carla_ego_vehicle)/launch/carla_example_ego_vehicle.launch">
<arg name='host' value='$(arg host)'/>
<arg name='port' value='$(arg port)'/>
<arg name='timeout' value='$(arg timeout)'/>
<arg name="vehicle_filter" value='$(arg vehicle_filter)'/>
<arg name="sensor_definition_file" default="$(find carla_ad_demo)/config/sensors.json"/>
<arg name='role_name' value='$(arg role_name)'/>
</include>
<!-- Provide a route and access to the CARLA waypoint API (required by carla_ad_agent) -->
<include file="$(find carla_waypoint_publisher)/launch/carla_waypoint_publisher.launch">
<arg name='host' value='$(arg host)'/>
<arg name='port' value='$(arg port)'/>
<arg name='timeout' value='$(arg timeout)'/>
<arg name='role_name' value='$(arg role_name)'/>
</include>
<!-- a spectator camera that is attached to the ego vehicle and be controlled from within rviz -->
<include file="$(find carla_spectator_camera)/launch/carla_spectator_camera.launch">
<arg name='host' value='$(arg host)'/>
<arg name='port' value='$(arg port)'/>
<arg name='timeout' value='$(arg timeout)'/>
<arg name="role_name" value="$(arg role_name)"/>
<arg name="resolution_x" value="$(arg resolution_x)"/>
<arg name="resolution_y" value="$(arg resolution_y)"/>
<arg name="fov" value="$(arg fov)"/>
</include>
<!-- To be able to maneuver with rviz, this node converts twist to vehicle control commands -->
<node pkg="carla_twist_to_control" type="carla_twist_to_control.py" name="carla_twist_to_control">
<remap from="/carla/$(arg role_name)/vehicle_control_cmd" to="/carla/$(arg role_name)/vehicle_control_cmd_manual"/>
<param name="role_name" value="$(arg role_name)"/>
</node>
<!-- Scenario Runner and an example scenario-->
<node pkg="rostopic" type="rostopic" name="publish_scenarios"
args="pub /carla/available_scenarios carla_ros_scenario_runner_types/CarlaScenarioList '{ 'scenarios':
[
{
'name': 'FollowLeadingVehicle',
'scenario_file': '$(find carla_ad_demo)/config/FollowLeadingVehicle.xosc'
}
]
}' -l"/>
<include file="$(find carla_ros_scenario_runner)/launch/carla_ros_scenario_runner.launch">
<arg name='host' value='$(arg host)'/>
<arg name='port' value='$(arg port)'/>
<arg name="role_name" value="$(arg role_name)"/>
<arg name="scenario_runner_path" value="$(arg scenario_runner_path)"/>
<arg name="wait_for_ego" value="True"/>
</include>
<!-- Rviz visualization-->
<node pkg="rviz" type="rviz" name="rviz" args="-d $(find carla_ad_demo)/config/carla_ad_demo.rviz" required="true" output="screen"/>
</launch>