Skip to content

Commit

Permalink
init commit
Browse files Browse the repository at this point in the history
Signed-off-by: ismetatabay <[email protected]>
  • Loading branch information
ismetatabay committed Oct 16, 2023
1 parent 130b4dc commit 3da39fd
Show file tree
Hide file tree
Showing 7 changed files with 232 additions and 38 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
266 changes: 228 additions & 38 deletions docs/how-to-guides/integrating-autoware/launch-autoware/index.md
Original file line number Diff line number Diff line change
@@ -1,87 +1,277 @@
# Launch Autoware

!!! warning
This section explains how to run your vehicle with Autoware.
We will explain how to run and launch autoware with these modules:

- Vehicle
- System
- Map
- Sensing
- Localization
- Perception
- Planning
- Control

## Pre-requirements of launching Autoware with real vehicle

Please complete these steps for integration Autoware on your vehicle:

- [Create your Autoware meta-repository](../creating-your-autoware-meta-repository/creating-autoware-meta-repository.md).
- [Create your vehicle and sensor model](../creating-vehicle-and-sensor-description/creating-vehicle-and-sensor-description.md).
- [Calibrate your sensors](../creating-vehicle-and-sensor-description/calibrating-sensors.md).
- [Create your Autoware compatible vehicle interface](../creating-vehicle-interface-package/creating-a-vehicle-interface-for-an-ackermann-kinematic-model.md).
- [Create your environment map](../creating-maps).

After the completion of these steps according to your individual vehicle,
you are ready to use Autoware.

## autoware_launch package

The [autoware_launch](https://github.com/autowarefoundation/autoware_launch) package starts the initiation of Autoware software stack launch files.
The [autoware.launch.xml](https://github.com/autowarefoundation/autoware_launch) launch file enables the invocation of these module launches
by enabling the following launch arguments:

```xml
<arg name="launch_vehicle" default="true" description="launch vehicle"/>
<arg name="launch_system" default="true" description="launch system"/>
<arg name="launch_map" default="true" description="launch map"/>
<arg name="launch_sensing" default="true" description="launch sensing"/>
<arg name="launch_sensing_driver" default="true" description="launch sensing driver"/>
<arg name="launch_localization" default="true" description="launch localization"/>
<arg name="launch_perception" default="true" description="launch perception"/>
<arg name="launch_planning" default="true" description="launch planning"/>
<arg name="launch_control" default="true" description="launch control"/>
```

Under Construction
For example, if you don't need to launch perception, planning,
and control for localization debug, you can disable these modules like the following:

This section explains how to run your vehicle with Autoware.
```diff
- <arg name="launch_perception" default="true" description="launch perception"/>
+ <arg name="launch_perception" default="false" description="launch perception"/>
- <arg name="launch_planning" default="true" description="launch planning"/>
+ <arg name="launch_planning" default="false" description="launch planning"/>
- <arg name="launch_control" default="true" description="launch control"/>
+ <arg name="launch_control" default="false" description="launch control"/>
```

Also, it is possible to specify which components to launch using command-line arguments.

```bash
ros2 launch autoware_launch autoware.launch.xml vehicle_model:=YOUR_VEHICLE sensor_kit:=YOUR_SENSOR_KIT map_path:=/PATH/TO/YOUR/MAP \
launch_perception:=false \
launch_planning:=false \
launch_control:=false
```

Also, `autoware_launch`
package includes autoware modules parameter files under the `config` directory.

```diff
<YOUR-OWN-AUTOWARE-DIR>/
└─ src/
└─ launcher/
└─ autoware_launch/
├─ config/
├─ ├─ control/
├─ ├─ localization/
├─ ├─ map/
├─ ├─ perception/
├─ ├─ planning/
├─ ├─ simulator/
├─ └─ system/
├─launch/
└─ rviz/
```

So, if we change any parameter in `config` directory,
it will override the original parameter values
since `autoware_launch` parameter file path is used for parameter loading.

<figure markdown>
![autoware_launch](images/autoware_launch_overview.svg){ align=center }
<figcaption>
autoware_launch package launching and parameter migrating diagram
</figcaption>
</figure>

## Configure `autoware.launch.xml`

As we mentioned above,
we can enable or disable Autoware modules
to launch by modifying `autoware.launch.xml` or using command-line arguments.
Also, we have some arguments for specifying our Autoware configurations.
Here are some basic configurations for the autoware.launch.xml launch file:
(Additionally, you can use them as command-line arguments, as we mentioned before)

### Vehicle

In the Vehicle section, you can choose whether the vehicle interface will be launched or not.
For example, if you disable it, then `vehicle_interface.launch.xml` will not be called:

```diff
- <arg name="launch_vehicle_interface" default="true" description="launch vehicle interface"/>
+ <arg name="launch_vehicle_interface" default="false" description="launch vehicle interface"/>
```

## Install Autoware
Please be sure your vehicle interface driver included in `vehicle_interface.launch.xml`,
for more information you can refer the [creating vehicle interface](../creating-vehicle-interface-package/creating-a-vehicle-interface-for-an-ackermann-kinematic-model.md#3-prepare-a-launch-file) page.

Follow the [installation steps of Autoware](../../../installation/).
### Map

If your point cloud and lanelet2 map names are different from pointcloud_map.pcd and lanelet2_map.osm,
you will need to update these map file name arguments:

```diff
- <arg name="lanelet2_map_file" default="lanelet2_map.osm" description="lanelet2 map file name"/>
+ <arg name="lanelet2_map_file" default="<YOUR-LANELET2-MAP-FILE-NAME>" description="lanelet2 map file name"/>
- <arg name="pointcloud_map_file" default="pointcloud_map.pcd" description="pointcloud map file name"/>
+ <arg name="pointcloud_map_file" default="<YOUR-POINTCLOUD-MAP-FILE-NAME>" description="pointcloud map file name"/>
```

### Perception

Also, you can change your perception method here.
The Autoware provides `camera-lidar-radar fusion`,
`camera-lidar fusion`, `lidar-radar fusion`, `lidar only` and `radar only` perception modes.
The default perception method is `lidar only` mode,
but if you want to use `camera-lidar fusion` you need to change your perception mode:

```diff
- <arg name="perception_mode" default="lidar" description="select perception mode. camera_lidar_radar_fusion, camera_lidar_fusion, lidar_radar_fusion, lidar, radar"/>
+ <arg name="perception_mode" default="camera_lidar_fusion" description="select perception mode. camera_lidar_radar_fusion, camera_lidar_fusion, lidar_radar_fusion, lidar, radar"/>
```

If you want to use traffic light recognition and visualization,
you can set `traffic_light_recognition/enable_fine_detection` as true (default).
Please check
[traffic_light_fine_detector](https://autowarefoundation.github.io/autoware.universe/main/perception/traffic_light_fine_detector/)
page for more information.
If you don't want to use traffic light classifier, then you can disable it:

```diff
- <arg name="traffic_light_recognition/enable_fine_detection" default="true" description="enable traffic light fine detection"/>
+ <arg name="traffic_light_recognition/enable_fine_detection" default="false" description="enable traffic light fine detection"/>
```

## Launch Autoware

Launch Autoware with the following command:

```bash
ros2 launch autoware_launch autoware.launch.xml vehicle_model:=YOUR_VEHICLE sensor_kit:=YOUR_SENSOR_KIT map_path:=/PATH/TO/YOUR/MAP
ros2 launch autoware_launch autoware_launch.launch.xml map_path:=<YOUR-MAP-PATH> vehicle_model:=<YOUR-VEHICLE-MODEL> sensor_model:=<YOUR-SENSOR-MODEL> vehicle_id:=<YOUR-VEHICLE-ID>
```

It is possible to specify which components to launch using command-line arguments.
For example, if you don't need to launch perception, planning, and control for localization debug, you can launch the following:

```bash
ros2 launch autoware_launch autoware.launch.xml vehicle_model:=YOUR_VEHICLE sensor_kit:=YOUR_SENSOR_KIT map_path:=/PATH/TO/YOUR/MAP \
ros2 launch autoware_launch autoware_launch.launch.xml map_path:=<YOUR-MAP-PATH> vehicle_model:=<YOUR-VEHICLE-MODEL> sensor_model:=<YOUR-SENSOR-MODEL> vehicle_id:=<YOUR-VEHICLE-ID> \
launch_perception:=false \
launch_planning:=false \
launch_control:=false
```

The basic command-line options are documented in [autoware.launch.xml](https://github.com/autowarefoundation/autoware_launch/blob/main/autoware_launch/launch/autoware.launch.xml).
After launching Autoware, we need to initialize our vehicle on our map.
If you set [gnss_poser](https://autowarefoundation.github.io/autoware.universe/main/sensing/gnss_poser/) for your GNSS/INS sensor at `gnss.launch.xml`,
then gnss_poser will send pose for initialization.
If you don't have a GNSS sensor, then you need to set initial pose manually.

There are options available to switch between different methods for some component.
For example, by specifying `pose_source`/`twist_source` or `perception_mode`, you can switch localization and perception methods, respectively.
These options allow you to choose the desired algorithms or sensor configurations for the respective functionalities.
### Set initial pose

For options on eagleye component, please refer to the sub-pages.

- [localization-mode](localization-methods/index.md)
- [perception-mode](perception.md)
If not or if the automatic initialization returns an incorrect position, you need to set the initial pose using the RViz GUI.

## Set initial pose
- Click the 2D Pose estimate button in the toolbar, or hit the P key

If GNSS is available, Autoware automatically initializes the vehicle's pose.
<figure markdown>
![2D Pose estimate](images/2d_pose_estimate.png){ align=center }
<figcaption>
2D Pose estimate with RViz
</figcaption>
</figure>

If not or if the automatic initialization returns an incorrect position, you need to set the initial pose using the RViz GUI.
- In the 3D View panel, click and hold the left mouse button, and then drag to set the direction for the initial pose.

1. Click the 2D Pose estimate button in the toolbar, or hit the P key
<figure markdown>
![Giving 2D Pose](images/give_2d_pose.png){ align=center }
<figcaption>
Setting 2D Pose estimate with RViz
</figcaption>
</figure>

![2D Pose estimate](images/2d_pose_estimate.png)
- After that, the vehicle will be initialized. You will then observe both your vehicle and Autoware outputs.

2. In the 3D View pane, click and hold the left mouse button, and then drag to set the direction for the initial pose.
<figure markdown>
![Initialization](images/2d_pose_initialization.png){ align=center }
<figcaption>
Initialization of the vehicle
</figcaption>
</figure>

## Set goal pose
### Set goal pose

Set a goal pose for the ego vehicle.

1. Click the 2D Nav Goal button in the toolbar, or hit the G key
- Click the 2D Nav Goal button in the toolbar, or hit the G key

![2D Pose estimate](images/2d_goal_pose.png)
<figure markdown>
![Initialization](images/2d_goal_pose.png){ align=center }
<figcaption>
Initialization of the vehicle
</figcaption>
</figure>

2. In the 3D View pane, click and hold the left mouse button, and then drag to set the direction for the goal pose.
If successful, you will see the calculated planning path on RViz.
- In the 3D View pane, click and hold the left mouse button,
and then drag to set the direction for the goal pose.

![route planning](images/route_planning_is_complete.png){width="800"}
<figure markdown>
![Initialization](images/give_2d_goal_pose.png){ align=center }
<figcaption>
Initialization of the vehicle
</figcaption>
</figure>

## Engage
- If successful, you will see the calculated planning path on RViz.

In your terminal, execute the following command.
<figure markdown>
![path-output](images/planning_path_output.png){ align=center }
<figcaption>
Planned path on RViz
</figcaption>
</figure>

```bash
source ~/autoware.YOURS/install/setup.bash
ros2 topic pub /autoware.YOURS/engage autoware_auto_vehicle_msgs/msg/Engage "engage: true" -1
```
### Engage

You can also engage via RViz with "AutowareStatePanel".
The panel can be found in `Panels > Add New Panel > tier4_state_rviz_plugin > AutowareStatePanel`.
There are two options for engage:

Once the route is computed, the "AUTO" button becomes active. Pressing the AUTO button engages the autonomous driving mode.
- Firstly, you can use `AutowareStatePanel`,
it is included in Autoware RViz configuration file,
but it can be found in `Panels > Add New Panel > tier4_state_rviz_plugin > AutowareStatePanel`.

![autoware state panel](images/autoware_state_panel_before.png)
Once the route is computed, the "AUTO" button becomes active.
Pressing the AUTO button engages the autonomous driving mode.

<figure markdown>
![autoware-state-panel](images/autoware_state_panel_before.png){ align=center }
<figcaption>
Autoware state panel (STOP operation mode)
</figcaption>
</figure>

- Secondly, you can engage with ROS 2 topic. In your terminal, execute the following command.

```bash
source ~/<YOUR-AUTOWARE-DIR>/install/setup.bash
ros2 topic pub /<YOUR-AUTOWARE-DIR>/engage autoware_auto_vehicle_msgs/msg/Engage "engage: true" -1
```

Now the vehicle should drive along the calculated path!

During the autonomous driving, the StatePanel appears as shown in the image below. Pressing the "STOP" button allows you to stop the vehicle.

![autoware state panel](images/autoware_state_panel_after.png)
<figure markdown>
![autoware-state-panel](images/autoware_state_panel_after.png){ align=center }
<figcaption>
Autoware state panel (AUTO operation mode)
</figcaption>
</figure>

0 comments on commit 3da39fd

Please sign in to comment.