Skip to content

Commit

Permalink
docs update, dialout group for linux
Browse files Browse the repository at this point in the history
  • Loading branch information
sytelus committed Jul 27, 2017
1 parent 1add57c commit b3ffaea
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 11 deletions.
3 changes: 2 additions & 1 deletion Unreal/Environments/Blocks/Blocks.uproject
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,6 @@
"Name": "AirSim",
"Enabled": true
}
]
],
"EngineAssociation": "4.16"
}
15 changes: 10 additions & 5 deletions docs/image_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ int getOneImage()

Returned image is always in png format. To get uncompressed and other format please see next section.

## Getting Stereo/Multiple Images at once
## Getting Stereo/Multiple Images at Once

The `simGetImages` API whichis slighly more complex to use than `simGetImage` API, for example, you can get left camera view, right camera view and depth image from left camera - all at once!

Expand Down Expand Up @@ -52,7 +52,7 @@ Unlike `simGetImage`, the `simGetImages` API also allows you to get uncompressed

You can also use Python to get images. For sample code please see [PythonClient project](https://github.com/Microsoft/AirSim/tree/master/PythonClient) and [Python example doc](python.md).

## "Computer Vision" mode
## "Computer Vision" Mode

You can use AirSim in so-called "Computer Vision" mode. In this mode, physics engine is disabled and there is no flight controller active. This means when you start AirSim, vehicle would just hang in air. However you can move around using keyboard (use F1 to see help on keys). You can press Record button to continuously generate images. Or you can call APIs to move around and take images.

Expand All @@ -65,10 +65,12 @@ To active this mode, simply go to settings.json that you can find in your Docume
}
```

## How to Set Position and Orientation (Pose)?

To move around the environment using APIs you can use `simSetPose` API. This API takes position and orientation and sets that on the vehicle. If you don't want to change position (or orientation) then set components of position (or orientation) to floating point nan values.

## Changing resolution and camera parameters
To change resolution, FOV etc, you can use [settings.json](settings.md). For example, below is the complete content of settings.json that sets parameters for scene capture and uses "Computer Vision" mode described above. If you ommit any setting then below default values will be used. For more information see [settings doc](settings.md).
## Changing Resolution and Camera Parameters
To change resolution, FOV etc, you can use [settings.json](settings.md). For example, below is the complete content of settings.json that sets parameters for scene capture and uses "Computer Vision" mode described above. If you ommit any setting then below default values will be used. For more information see [settings doc](settings.md). If you are using stereo camera, currently the distance between left and right is fixed at 25 cm.

```
{
Expand All @@ -84,8 +86,11 @@ To change resolution, FOV etc, you can use [settings.json](settings.md). For exa
}
```

## What Does Values in Depth Image Mean?
Unreal generates the ground truth *perspective* depth image. The value of each pixel is a depth value from 0 to 2^24-1. However as this range is too large, the depth map would end up looking like all white. So we clip the depth at 10,000 cm and then normalize it from 0.0 to 1.0. To get the planner depth you need to do additional processing (for example, [see this function](https://github.com/Microsoft/AirSim/blob/master/Examples/StereoImageGenerator.hpp#L200)).

## Collision API
The collision information can be obtained using `getCollisionInfo` API. This call returns a struct that has information not only whether collision occured but also collision position, surface normal, penetration depth and so on.

## Complete example
## Complete Example
A complete example of setting vehicle positions at random locations and orientations and then taking images can be found in [GenerateImageGenerator.hpp]((https://github.com/Microsoft/AirSim/blob/master/Examples/StereoImageGenerator.hpp). This example generates specified number of stereo images and ground truth depth with normalization to camera plan, computation of disparity image and saving it to pfm format in this mode.
2 changes: 1 addition & 1 deletion docs/prereq.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
It depends on how big your Unreal Envionment is. The Blocks environment that comes with AirSim is very basic and works on typical laptops. The [Modular Neighborhood Pack](https://www.unrealengine.com/marketplace/modular-neighborhood-pack) that we use ourselves for research requires GPUs with at least 4GB of RAM. The [Open World environment](https://www.unrealengine.com/marketplace/open-world-demo-collection) needs GPU with 8GB RAM. Our typical development machines have 32GB of RAM and NVidia TitanX and a [fast hard drive](hard_drive.md).

### Using AirSim Without PX4
Yes, now its possible to use AirSim without PX4. Please see the [instructions here](image_apis.md) for how to use so-called "Computer Vision" mode. If you don't need vehicle physics, we highly recommand to use this mode because setting up PX4 had been pain, unstable and unreliable (and you can skip rest of the instructions on this page!). Due to bugs [such as this](https://github.com/PX4/Firmware/issues/7516) things haven't been working after PX4 release 1.5.5. Even when its working, you may see wobbly drone randomly. We are in process to integrate [ROSFlight](https://github.com/rosflight/firmware) to replace PX4 as our default flight controller. We are also making more head ways to develop our own [simple_flight](https://github.com/Microsoft/AirSim/tree/master/AirLib/include/controllers/simple_flight) which would be useful for folks working on re-inforcement learning.
Yes, now its possible to use AirSim without PX4. Please see the [instructions here](image_apis.md) for how to use so-called "Computer Vision" mode. If you don't need vehicle physics, we highly recommand to use this mode because setting up PX4 had been unreliable (and you can skip rest of the instructions on this page!). Due to bugs [such as this](https://github.com/PX4/Firmware/issues/7516) things haven't been working after PX4 release 1.5.5. With that release, you may still see wobbly drone sometimes. We are in process to integrate [ROSFlight](https://github.com/rosflight/firmware) to replace PX4 as our default flight controller. We are also making more head ways to develop our own [simple_flight](https://github.com/Microsoft/AirSim/tree/master/AirLib/include/controllers/simple_flight) which would be useful for folks working on re-inforcement learning.

### RC Transmitter and Receiver

Expand Down
12 changes: 8 additions & 4 deletions setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ pushd "$SCRIPT_DIR" >/dev/null
#get sub modules
git submodule update --init --recursive

#give user perms to access USB port - this is not needed if not using PX4 HIL
sudo adduser $USER dialout
sudo usermod -a -G dialout $USER

# get clang, libc++
# sudo rm -rf llvm-build
# mkdir -p llvm-build/output
Expand All @@ -24,11 +28,11 @@ sudo apt-get install -y clang-3.9 clang++-3.9

#get libc++ source
if [[ ! -d "llvm-source-39" ]]; then
git clone --depth=1 -b release_39 https://github.com/llvm-mirror/llvm.git llvm-source-39
git clone --depth=1 -b release_39 https://github.com/llvm-mirror/libcxx.git llvm-source-39/projects/libcxx
git clone --depth=1 -b release_39 https://github.com/llvm-mirror/libcxxabi.git llvm-source-39/projects/libcxxabi
git clone --depth=1 -b release_39 https://github.com/llvm-mirror/llvm.git llvm-source-39
git clone --depth=1 -b release_39 https://github.com/llvm-mirror/libcxx.git llvm-source-39/projects/libcxx
git clone --depth=1 -b release_39 https://github.com/llvm-mirror/libcxxabi.git llvm-source-39/projects/libcxxabi
else
echo "folder llvm-source already exists, skipping git clone..."
echo "folder llvm-source already exists, skipping git clone..."
fi

#build libc++
Expand Down

0 comments on commit b3ffaea

Please sign in to comment.