Skip to content

Commit

Permalink
merge from ign-sensors3
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 committed Feb 2, 2021
2 parents 67dbabc + f5a57f1 commit 14eccf4
Show file tree
Hide file tree
Showing 2 changed files with 107 additions and 66 deletions.
52 changes: 0 additions & 52 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ designed to generate realistic data from simulation environments. Ignition Senso

[Usage](#usage)

[Documentation](#documentation)

[Testing](#testing)

[Folder Structure](#folder-structure)

[Code of Conduct](#code-of-conduct)
Expand All @@ -63,54 +59,6 @@ See the [installation tutorial](https://ignitionrobotics.org/api/sensors/4.0/ins

Please refer to the [examples directory](https://github.com/ignitionrobotics/ign-sensors/raw/master/examples/).

# Documentation

API and tutorials can be found at [https://ignitionrobotics.org/libs/sensors](https://ignitionrobotics.org/libs/sensors).

You can also generate the documentation from a clone of this repository by following these steps.

1. You will need Doxygen. On Ubuntu Doxygen can be installed using

```
sudo apt-get install doxygen
```
2. Clone the repository
```
git clone https://github.com/ignitionrobotics/ign-sensors
```
3. Configure and build the documentation.
```
cd ign-sensors; mkdir build; cd build; cmake ../; make doc
```
4. View the documentation by running the following command from the build directory.
```
firefox doxygen/html/index.html
```
# Testing
Follow these steps to run tests and static code analysis in your clone of this repository.
1. Follow the [source install instruction](#source-install).
2. Run tests.
```
make test
```
3. Static code checker.
```
make codecheck
```
# Folder Structure

Refer to the following table for information about important directories and files in this repository.
Expand Down
121 changes: 107 additions & 14 deletions tutorials/02_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ sudo apt-get update
sudo apt install libignition-sensors4-dev
```

### Windows

Binary install is pending `ignition-rendering` and `ignition-sensors` being added to conda-forge.

## Source Install

Source installation can be performed in UNIX systems by first installing the
Expand All @@ -41,35 +45,124 @@ Ignition Sensors requires:
* [SDFormat](https://github.com/osrf/sdformat)
* [Protobuf3](https://developers.google.com/protocol-buffers/)

### Building from source
### Ubuntu

1. Make sure you are running [Ubuntu Bionic](http://releases.ubuntu.com/18.04/) or above.

2. Install the [Prerequisites](#prerequisites).
2. Install the Prerequisites.

3. Configure to use gcc8 if that is not the default compiler

```{.sh}
sudo apt-get install g++-8
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
```
sudo apt-get install g++-8
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-8 800 --slave /usr/bin/g++ g++ /usr/bin/g++-8 --slave /usr/bin/gcov gcov /usr/bin/gcov-8
```

4. Clone the repository

```{.sh}
git clone https://github.com/ignitionrobotics/ign-sensors
```
git clone https://github.com/ignitionrobotics/ign-sensors
```

5. Configure and build
```
cd ign-sensors; mkdir build; cd build; cmake ..; make
```

```{.sh}
cd ign-sensors; mkdir build; cd build; cmake ..; make
6. Optionally, install the library
```
sudo make install
```

### Windows

#### Install Prerequisites

First, follow the [ign-cmake](https://github.com/ignitionrobotics/ign-cmake) tutorial for installing Conda, Visual Studio, CMake, etc., prerequisites, and creating a Conda environment.

Navigate to `condabin` if necessary to use the `conda` command (i.e., if Conda is not in your `PATH` environment variable. You can find the location of `condabin` in Anaconda Prompt, `where conda`).

Create if necessary, and activate a Conda environment:

```
conda create -n ign-ws
conda activate ign-ws
```

6. Optionally, install the library
Install Ignition dependencies, replacing `<#>` with the desired versions:

```{.sh}
sudo make install
```
conda install libignition-cmake<#> libignition-common<#> libignition-math<#> libignition-transport<#> libignition-msgs<#> libignition-plugin<#> --channel conda-forge
```

Before [ign-rendering](https://github.com/ignitionrobotics/ign-rendering) becomes available on conda-forge, follow its tutorial to build it from source.

#### Build from source

1. Activate the Conda environment created in the prerequisites:
```
conda activate ign-ws
```

1. Navigate to where you would like to build the library, and clone the repository.
```
# Optionally, append `-b ign-sensors#` (replace # with a number) to check out a specific version
git clone https://github.com/ignitionrobotics/ign-sensors.git
```

1. Configure and build
```
cd ign-sensors
mkdir build
cd build
```

Before `ign-rendering` becomes available on conda-forge, we need to build it from source and specify the path containing `ignition-rendering-config.cmake` in `CMAKE_PREFIX_PATH`, for cmake to find `ign-rendering`. That path could be `ign-rendering-install-path\lib\cmake\ignition-rendering4`, for example.
```
cmake .. -DBUILD_TESTING=OFF -DCMAKE_PREFIX_PATH=path\containing\ignition-rendering-config # Optionally, -DCMAKE_INSTALL_PREFIX=path\to\install
cmake --build . --config Release
```

1. Optionally, install. You will likely need to run a terminal with admin privileges for this call to succeed.
```
cmake --install . --config Release
```

# Documentation

API and tutorials can be found at [https://ignitionrobotics.org/libs/sensors](https://ignitionrobotics.org/libs/sensors).

You can also generate the documentation from a clone of this repository by following these steps.

1. You will need Doxygen. On Ubuntu Doxygen can be installed using
```
sudo apt-get install doxygen
```

2. Clone the repository
```
git clone https://github.com/ignitionrobotics/ign-sensors
```

3. Configure and build the documentation.
```
cd ign-sensors; mkdir build; cd build; cmake ../; make doc
```

4. View the documentation by running the following command from the build directory.
```
firefox doxygen/html/index.html
```

# Testing

Follow these steps to run tests and static code analysis in your clone of this repository.

1. Run tests.
```
make test
```

2. Static code checker.
```
make codecheck
```

0 comments on commit 14eccf4

Please sign in to comment.