Skip to content

Commit

Permalink
Navigation mode (ApolloAuto#4598)
Browse files Browse the repository at this point in the history
* made the navigation document consistent and grammatically correct

* language, grammar and formatting changes to first 5 How-to docs

* update

* update

* changes to grammar and formatting of how-to docs
  • Loading branch information
natashadsouza authored and jinghaomiao committed Jun 20, 2018
1 parent 0db49ad commit 9bb66cd
Show file tree
Hide file tree
Showing 9 changed files with 116 additions and 102 deletions.
26 changes: 13 additions & 13 deletions docs/howto/how_to_build_and_release.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ Build and Release
* [4. Test](#test)

## <span id="docker">Install Docker</span>
The system requirement for building Apollo is Ubuntu 14.04. Docker container is the simplest way to set up the build environment for Apollo project. Detailed docker tutorial is [here](https://docs.docker.com/).
The system requirement for building Apollo is Ubuntu 14.04. Using a Docker container is the simplest way to set up the build environment for Apollo project. A Detailed docker tutorial can be found [here](https://docs.docker.com/).

To install, you may refer to
[official guide to install the docker-ce](https://docs.docker.com/install/linux/docker-ce/ubuntu).
Don't forget the
To install docker, you may refer to
[Official guide to install the Docker-ce](https://docs.docker.com/install/linux/docker-ce/ubuntu).
Don't forget to test it using
[post-installation steps for Linux](https://docs.docker.com/install/linux/linux-postinstall).

## <span id="build_release">Build and Release</span>
### Start container
We provide a build image named *dev-latest*. Container will mount your local apollo repo to */apollo*.
We provide a build image named *dev-latest*. The Container will mount your local apollo repo to */apollo*.
```bash
bash docker/scripts/dev_start.sh
```
### Get into container
### Get into the container
```bash
bash docker/scripts/dev_into.sh
```
### Build modules
```bash
bash apollo.sh build
```
If the computer is very slow, you can enter the following command to limit the CPU.
`Note:` If your computer is very slow, you can enter the following command to limit the CPU.

```
bash apollo.sh build --local_resources 2048,1.0,1.0
Expand All @@ -39,22 +39,22 @@ bash apollo.sh build --local_resources 2048,1.0,1.0
```bash
bash apollo.sh release
```
This will generate a release directory, which contains ROS environment, running scripts, binaries and dependent shared libraries (.so files).
This command will generate a release directory, which contains the ROS environment, running scripts, binaries and dependent shared libraries (.so files).

To create a release excluding proprietary software (such as ESD CAN library), do:
To create a release excluding proprietary software (such as ESD CAN library), use:
```bash
bash apollo.sh release_noproprietary
```
### Generate release image
```bash
bash apollo_docker.sh gen
```
This will create a new docker image with the release directory. The release image will be named as *release-yyyymmdd_hhmm*. Meanwhile, your most recent built image will be tagged as *release-latest*. **The docker_release needed to be executed outside of container.**
This will create a new docker image with the release directory. The release image will be named as *release-yyyymmdd_hhmm*. Meanwhile, your most recent built image will be tagged as *release-latest*. **The docker_release needed to be executed outside the container.**
### Push docker images
```bash
bash apollo_docker.sh push
```
The command will push your most recent release docker image to the docker hub.
This command will push your most recent release docker image to the docker hub.

## <span id="build_in_vscode">Build in Visual Studio Code</span>
### Install VSCode
Expand All @@ -69,9 +69,9 @@ Start VSCode with the following command:
code
```
### Open the Apollo project in VSCode
Use the keyboard shortcut (Ctrl+K Ctrl+O) to open the Apollo project.
Use the keyboard shortcut **(Ctrl+K Ctrl+O)** to open the Apollo project.
### Build the Apollo project in VSCode
Use the keyboard shortcut (Ctrl+Shift+B) to build the Apollo project.
Use the keyboard shortcut **(Ctrl+Shift+B)** to build the Apollo project.
### Run all unit tests for the Apollo project in VSCode
Select the "Tasks->Run Tasks..." menu command and click "run all unit tests for the apollo project" from a popup menu to check the code style for the Apollo project.
### Run a code style check task for the Apollo project in VSCode
Expand Down
17 changes: 10 additions & 7 deletions docs/howto/how_to_build_your_own_kernel.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
# Installing Your Own Kernel.
# Installing Your Own Kernel

## Helpful hints before you begin.
If you have modified the kernel, or the pre-built kernel is not the best for your platform, you can build your own kernel with the following steps.
## Helpful hints before you begin
If you have modified the kernel, or the pre-built kernel is not the best for your platform, you can build your own kernel with the following steps:

## Installing your own kernel.
## Installing your own kernel
1. Clone the code from repository.
```git clone https://github.com/ApolloAuto/apollo-kernel.git```
```cd apollo-kernel```
```
git clone https://github.com/ApolloAuto/apollo-kernel.git
cd apollo-kernel
```

2. Add the ESD CAN driver source code according to [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md).
3. Build the kernel with the following command.
3. Build the kernel with the following command:
```bash build.sh```
4. Install the kernel the same way as using a pre-built [Apollo Kernel](https://github.com/ApolloAuto/apollo/blob/master/docs/howto/how_to_install_apollo_kernel.md).
16 changes: 10 additions & 6 deletions docs/howto/how_to_create_a_pull.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
How to create a pull request
==========================
# How to create a pull request

You can follow the standard [github approach](https://help.github.com/articles/using-pull-requests/) to contribute code. Here is one sample setup.
You can follow the standard [github approach](https://help.github.com/articles/using-pull-requests/) to contribute code to Apollo. Here is a sample setup:

- Fork a new repo with your GitHub username.
- Set up your github personal email and user name
- Set up your GitHub personal email and user name

```
git config user.name "XXX"
Expand All @@ -25,7 +24,12 @@ git config user.email "XXX@[XXX.com]"
(Use HTTPS) git remote add upstream https://github.com/ApolloAuto/apollo.git
```

- Create a new branch, make changes and commit.
- Confirm that the upstream branch has been added
```
git remote -v
```

- Create a new branch, make changes and commit

```
git checkout -b "my_dev"
Expand All @@ -44,6 +48,6 @@ git push -f -u origin "my_dev"
```

- Generate a new pull request between "Apolloauto/apollo:master" and "forked repo:my_dev"
- Collaborators will review and merge the commit.
- Collaborators will review and merge the commit (this may take some time, please be patient)

Thanks a lot for your contributions!
14 changes: 7 additions & 7 deletions docs/howto/how_to_document_code.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# How to document source code for doxygen

Developers who are not familiar with doxygen can get more information from its official website [http://www.stack.nl/~dimitri/doxygen/](http://www.stack.nl/~dimitri/doxygen/).
Developers who are not familiar with doxygen can get more information from its [official website](http://www.stack.nl/~dimitri/doxygen/).

We use [time.h](https://github.com/ApolloAuto/apollo/blob/master/modules/common/time/time.h) as an example to explain how to document.
## file
We use [time.h](https://github.com/ApolloAuto/apollo/blob/master/modules/common/time/time.h) as an example to explain how to successfully document code.
### File
```
/**
* @file
Expand All @@ -14,7 +14,7 @@ We use [time.h](https://github.com/ApolloAuto/apollo/blob/master/modules/common/
*/
```

## namespace
### Namespace
```
/**
* @namespace apollo::common::time
Expand All @@ -25,7 +25,7 @@ namespace common {
namespace time {
```

## class
### Class
```
/**
* @class Clock
Expand All @@ -39,7 +39,7 @@ class Clock {
...
```

## function
### Function
```
/**
* @brief Set the behavior of the \class Clock.
Expand All @@ -52,7 +52,7 @@ class Clock {
}
```

## public / protected class member variables
### Public / protected class member variables
```
/// Stores the currently set timestamp, which serves mock clock
/// queries.
Expand Down
6 changes: 3 additions & 3 deletions docs/howto/how_to_install_apollo_kernel.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Installing the Apollo Kernel
## Helpful hints before you begin
* The Apollo runtime in the vehicle requires the Apollo Kernel. You are strongly recommended to install the pre-built kernel.
* The Apollo runtime environment in the vehicle requires the Apollo Kernel. You are strongly recommended to install the pre-built kernel.

## Installing Apollo Kernel

Expand All @@ -10,5 +10,5 @@ https://github.com/ApolloAuto/apollo-kernel/releases
* ```tar zxvf linux-4.4.32-apollo-1.5.0.tar.gz```
* ```cd install```
* ```sudo bash install_kernel.sh```
3. Reboot your system by the reboot command
4. After rebooting, build the ESD CAN driver source code. How to build the ESD CAN driver source code can be found at [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
3. Reboot your system using the reboot command
4. After rebooting, build the ESD CAN driver source code. Resources to build the ESD CAN driver source code can be found here: [ESDCAN-README.md](https://github.com/ApolloAuto/apollo-kernel/blob/master/linux/ESDCAN-README.md)
27 changes: 14 additions & 13 deletions docs/howto/how_to_run_apollo_2.5_with_ubuntu16.md
Original file line number Diff line number Diff line change
@@ -1,25 +1,26 @@
# How to Run Apollo in Ubuntu 16 (Apollo 2.5)

We recommend to use Ubuntu 14 for Apollo. For the user using ubuntu 16, here is the extra step you have to follow to run Apollo 2.5 under ubuntu 16.
We recommend using **Ubuntu 14.04** for Apollo. For those users that currently have Ubuntu 16 installed, here is the extra step you have to follow to run Apollo 2.5 successfully on your Ubuntu 16 machine.


1. You need glfw 3.2 and above, which supports EGL and run-time context creation API selection. (Refer to http://www.glfw.org/docs/latest/news.html)
1. You need GLFW(Graphics Library Framework) 3.2 and above, which supports EGL and run-time context creation API selection. (Refer to [http://www.glfw.org/docs/latest/news.html](http://www.glfw.org/docs/latest/news.html) for additional information)
Install the correct version from [this link](https://launchpad.net/ubuntu/+source/glfw3).

Installed the version from https://launchpad.net/ubuntu/+source/glfw3.
2. Add following one line in `glfw_fusion_viewer.cc` file, in GLFWFusionViewer::window_init() before the glfwCreateWindow() call:
```
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);
```
2. Add following one line in glfw_fusion_viewer.cc:
glfwWindowHint(GLFW_CONTEXT_CREATION_API, GLFW_EGL_CONTEXT_API);

(in GLFWFusionViewer::window_init() before the glfwCreateWindow() call)


With this, the perception_lowcost_vis finally works on my machine without a segfault.
With this, the `perception_lowcost_vis` should work on your machine without a segfault.
The issue comes from some behavior changes in the latest nvidia driver and a glfw bug mentioned in http://www.glfw.org/docs/latest/window_guide.html#window_hints_ctx:
The issue comes from a behavior changes in the latest nvidia driver and a glfw bug. You can find information about the bug [here](http://www.glfw.org/docs/latest/window_guide.html#window_hints_ctx). To summarize the behaviour,
“On some Linux systems, creating contexts via both the native and EGL APIs in a single process will cause the application to segfault. Stick to one API or the other on Linux for now.”
```
“On some Linux systems, creating contexts via both the native and EGL APIs in a single process
will cause the application to segfault. Stick to one API or the other on Linux for now.”
```
So, with the driver (on Ubuntu 16), glfw_fusion_viewer needs to be set up to use EGL_CONTEXT_API instead of the default NATIVE_CONTEXT_API to evade the segfault.
We plan to update the Apollo docker to support these.
We plan to update the Apollo docker to support these soon!
12 changes: 5 additions & 7 deletions docs/howto/how_to_save_load_docker_image_locally.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# How to save and load docker image
Considering the docker image is more than one Gigabyte, it is better to generate or download the docker image in the WIFI environment and then copy the image to cars.
# How to save and load your docker image
Considering the docker image is more than one Gigabyte, it is better to generate or download the docker image using WiFi or a very stable internet connection, and then copy the image to your car.

## Save Docker Image
## Save the Docker Image

After generating or downloading a docker image, you can save the docker image into a local tar file.

Expand All @@ -12,11 +12,9 @@ e.g.
docker save -o apollo_img.tar apolloauto/apollo:release-latest
```

## Load Docker Image
## Load the Docker Image

After copying the tar file to the car, you need to load the docker image from the tar file.

e.g.
After copying the .tar file to the car, you need to load the docker image from the .tar file as shown below:

```
# docker load -i <path to image tar file>
Expand Down
8 changes: 4 additions & 4 deletions docs/howto/how_to_style_check_to_one_dir.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
## how to add c++ style check to one directory?
1. in BUILD file, at the top, add the following line
## How to add C++ style check to one directory?
1. In the BUILD file, at the top, add the following line
```
load("//tools:cpplint.bzl", "cpplint")
```
2. in BUILD file, at the bottom, add the following line
2. In the BUILD file, at the bottom, add the following line
```
cpplint()
```
3. run `apollo.sh check` to verify if the directory passes style check.
3. Run `apollo.sh check` to verify if the directory passes style check.
### Please use the [BUILD](https://github.com/ApolloAuto/apollo/blob/master/modules/canbus/BUILD) file of canbus module as an example.
```
Expand Down
Loading

0 comments on commit 9bb66cd

Please sign in to comment.