Skip to content

Commit

Permalink
Documentation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
WouterJansen committed Aug 2, 2024
1 parent dbb8d73 commit a7dac0f
Show file tree
Hide file tree
Showing 16 changed files with 78 additions and 92 deletions.
9 changes: 2 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
Cosys-AirSim is a simulator for drones, cars and more, with extensive API support, built on [Unreal Engine](https://www.unrealengine.com/). It is open-source, cross platform, and supports hardware-in-loop with popular flight controllers such as PX4 for physically and visually realistic simulations. It is developed as an Unreal plugin that can simply be dropped into any Unreal environment.

This fork is based on last public AirSim release from Microsoft's GitHub.

## Cosys-Lab Modifications

Cosys-Lab made extensive modifications to the AirSim platform to support multiple projects and research goals.
Please contact a Cosys-Lab researcher to get more in depth information on our work or if you wish to collaborate.
The [original AirSim MIT license](https://github.com/Cosys-Lab/Cosys-AirSim/blob/main/LICENSE) applies to all native AirSim source files.
Please note that we use that same [MIT license](https://github.com/Cosys-Lab/Cosys-AirSim/blob/main/LICENSE) as which applies to all changes made by Cosys-Lab in case you plan to do anything within this repository.
Do note that this repository is provided as is, will not be actively updated and comes without warranty or support.
Please contact a Cosys-Lab researcher to get more in depth information on which branch or version is best for your work.

### Associated publications
## Associated publications

- [Cosys-AirSim: A Real-Time Simulation Framework Expanded for Complex Industrial Applications](https://arxiv.org/abs/2303.13381)
```
Expand Down Expand Up @@ -93,9 +90,7 @@ Some more details on our changes can be found in the [changelog](https://github.

View our [detailed documentation](https://cosys-lab.github.io/) on all aspects of Cosys-AirSim.

## Participate

### Original AirSim Paper
## Original AirSim Paper

More technical details are available in [AirSim paper (FSR 2017 Conference)](https://arxiv.org/abs/1705.05065). Please cite this as:
```
Expand Down
9 changes: 2 additions & 7 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,14 @@
Cosys-AirSim is a simulator for drones, cars and more, with extensive API support, built on [Unreal Engine](https://www.unrealengine.com/). It is open-source, cross platform, and supports hardware-in-loop with popular flight controllers such as PX4 for physically and visually realistic simulations. It is developed as an Unreal plugin that can simply be dropped into any Unreal environment.

This fork is based on last public AirSim release from Microsoft's GitHub.

## Cosys-Lab Modifications

Cosys-Lab made extensive modifications to the AirSim platform to support multiple projects and research goals.
Please contact a Cosys-Lab researcher to get more in depth information on our work or if you wish to collaborate.
The [original AirSim MIT license](https://github.com/Cosys-Lab/Cosys-AirSim/blob/main/LICENSE) applies to all native AirSim source files.
Please note that we use that same [MIT license](https://github.com/Cosys-Lab/Cosys-AirSim/blob/main/LICENSE) as which applies to all changes made by Cosys-Lab in case you plan to do anything within this repository.
Do note that this repository is provided as is, will not be actively updated and comes without warranty or support.
Please contact a Cosys-Lab researcher to get more in depth information on which branch or version is best for your work.

### Associated publications
## Associated publications

- [Cosys-AirSim: A Real-Time Simulation Framework Expanded for Complex Industrial Applications](https://arxiv.org/abs/2303.13381)
```
Expand Down Expand Up @@ -93,9 +90,7 @@ Some more details on our changes can be found in the [changelog](https://github.

View our [detailed documentation](https://cosys-lab.github.io/) on all aspects of Cosys-AirSim.

## Participate

### Original AirSim Paper
## Original AirSim Paper

More technical details are available in [AirSim paper (FSR 2017 Conference)](https://arxiv.org/abs/1705.05065). Please cite this as:
```
Expand Down
1 change: 0 additions & 1 deletion docs/adding_new_apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,3 @@ Testing is required to ensure that the API is working as expected. For this, as

It is recommended to use a virtual environment for dealing with Python packaging so as to not break any existing setup.

When opening a PR, make sure to follow the [coding guidelines](coding_guidelines.md). Also add a docstring for the API in the Python files, and please include any example scripts and settings required in the script as well.
66 changes: 37 additions & 29 deletions docs/annotation.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ The annotation system uses actor and/or component tags to set these values for t
* Landscape objects aren't supported. This is the special object type in Unreal to make terrain with. As a work-around, StaticMesh terrain must be used.
* Foliage objects aren't supported. This is the special object type in Unreal to place trees, grass and other plants that move with the wind. As a work-around, StaticMesh objects must be used.
* Brush objects aren't supported. This is a special object type in Unreal to create your own meshes with. As a work-around, you can convert them to a StaticMesh.
* These and other unsupported object types that are less common that either will not be rendered (decals, text, foliage, ...) or will by default be given the RGB color value of [149,149,149] or [0,0,0](brush objects, landscape,...).
* These and other unsupported object types that are less common that either will not be rendered (decals, text, foliage, ...) or will by default be given the RGB color value of [149,149,149] or [0,0,0]. (brush objects, landscape,...).

## Usage

Expand Down Expand Up @@ -95,18 +95,20 @@ colorMap = client.simGetSegmentationColorMap()
```

Several RPC API functions are available to influence or retrieve the RGB annotation layer. Currently, it is not possible to use the RPC API to add new actors or components to the annotation system, you can only update their values. For example in Python:
* `simSetAnnotationObjectID(annotation_name, mesh_name, object_id, is_name_regex=False/True)` to update the color of an object in index mode (regex allows to set multiple with wildcards for example) when it already exists in the annotation system
* `simSetAnnotationObjectColor(annotation_name, mesh_name, r, g, b, is_name_regex=False/True)` to update the color of an object in direct mode (regex allows to set multiple with wildcards for example) when it already exists in the annotation system
* `simGetAnnotationObjectID(annotation_name, mesh_name)` to get the ID of an object in index mode
* `simGetAnnotationObjectColor(annotation_name, mesh_name)` to get the color of an object in direct mode
* `simIsValidColor(r,g,b)` You can check if a color is valid using this function

* `simSetAnnotationObjectID(annotation_name, mesh_name, object_id, is_name_regex=False/True)` to update the color of an object in index mode (regex allows to set multiple with wildcards for example) when it already exists in the annotation system
* `simSetAnnotationObjectColor(annotation_name, mesh_name, r, g, b, is_name_regex=False/True)` to update the color of an object in direct mode (regex allows to set multiple with wildcards for example) when it already exists in the annotation system
* `simGetAnnotationObjectID(annotation_name, mesh_name)` to get the ID of an object in index mode
* `simGetAnnotationObjectColor(annotation_name, mesh_name)` to get the color of an object in direct mode
* `simIsValidColor(r,g,b)` You can check if a color is valid using this function

The same is available in Unreal Blueprint and Unreal c++. You can find the functions in the `Annotation` category.
* `Add RGBDirect Annotation Tag to Component/Actor(annotation_name, component/actor, color, update_annotation=true/false)` to set the color of an object in direct mode
* `Update RGBDirect Annotation Tag to Component/Actor(annotation_name, component/actor, color, update_annotation=true/false)` to update the color of an object in direct mode already in the system
* `Add RGBIndex Annotation Tag to Component/Actor(annotation_name, component/actor, object_id, update_annotation=true/false)` to set the index of an object in index mode
* `Update RGBIndex Annotation Tag to Component/Actor(annotation_name, component/actor, object_id, update_annotation=true/false)` to update the index of an object in index mode already in the system
* `Is Annotation RGB Valid(color)`You can check if a color is valid using this function

* `Add RGBDirect Annotation Tag to Component/Actor(annotation_name, component/actor, color, update_annotation=true/false)` to set the color of an object in direct mode
* `Update RGBDirect Annotation Tag to Component/Actor(annotation_name, component/actor, color, update_annotation=true/false)` to update the color of an object in direct mode already in the system
* `Add RGBIndex Annotation Tag to Component/Actor(annotation_name, component/actor, object_id, update_annotation=true/false)` to set the index of an object in index mode
* `Update RGBIndex Annotation Tag to Component/Actor(annotation_name, component/actor, object_id, update_annotation=true/false)` to update the index of an object in index mode already in the system
* `Is Annotation RGB Valid(color)`You can check if a color is valid using this function

Note that enabling _update_annotation_ is a relatively slow process, specially on actors with lots of annotated components.
Ideally set _update_annotation_ to false during the process of adding tags to the actor and only turn on update_annotation for the last component or actor you want to update.
Expand All @@ -120,12 +122,14 @@ So if for example your RGB annotation layer is called `GreyscaleTest`, you can t
When `Default` is set to 1, all objects without a tag for this layer will be rendered in black.

Several RPC API functions are available to influence or retrieve the RGB annotation layer. Currently, it is not possible to use the RPC API to add new actors or components to the annotation system, you can only update their values. For example in Python:
* `simSetAnnotationObjectValue(annotation_name, mesh_name, greyscale_value, is_name_regex=False/True)` to update the value of an object (regex allows to set multiple with wildcards for example) when it already exists in the annotation system
* `simGetAnnotationObjectValue(annotation_name, mesh_name)` to get the value of an object

* `simSetAnnotationObjectValue(annotation_name, mesh_name, greyscale_value, is_name_regex=False/True)` to update the value of an object (regex allows to set multiple with wildcards for example) when it already exists in the annotation system
* `simGetAnnotationObjectValue(annotation_name, mesh_name)` to get the value of an object

The same is available in Unreal Blueprint and Unreal c++. You can find the functions in the `Annotation` category.
* `Add Greyscale Annotation Tag to Component/Actor(annotation_name, component/actor, value, update_annotation=true/false)` to update the value of an object when it already exists in the annotation system
* `Update Greyscale Annotation Tag to Component/Actor(annotation_name, component/actor, value, update_annotation=true/false)` to update the value of an object

* `Add Greyscale Annotation Tag to Component/Actor(annotation_name, component/actor, value, update_annotation=true/false)` to update the value of an object when it already exists in the annotation system
* `Update Greyscale Annotation Tag to Component/Actor(annotation_name, component/actor, value, update_annotation=true/false)` to update the value of an object

Note that enabling _update_annotation_ is a relatively slow process, specially on actors with lots of annotated components.
Ideally set _update_annotation_ to false during the process of adding tags to the actor and only turn on update_annotation for the last component or actor you want to update.
Expand All @@ -151,16 +155,18 @@ So for example if you have a static mesh called *Cylinder* and your texture laye
When `Default` is set to 1, all objects without a tag for this layer will be rendered in black.

Several RPC API functions are available to influence or retrieve the RGB annotation layer. Currently, it is not possible to use the RPC API to add new actors or components to the annotation system, you can only update their values. For example in Python:
* `simSetAnnotationObjectTextureByPath(annotation_name, mesh_name, texture_path, is_name_regex=False/True)` to set the texture of an object in direct mode, the texture path should be same format as described above, for example `/Game/MyTextures/TestTexture1` (regex allows to set multiple with wildcards for example)
* `simEnableAnnotationObjectTextureByPath(annotation_name, mesh_name, r, g, b, is_name_regex=False/True)` to enable the texture of an object in relative path mode, this does require a texture in the relative path as described above! (regex allows to set multiple with wildcards for example)
* `simGetAnnotationObjectTexturePath(annotation_name, mesh_name)` to get the texture path of an object

* `simSetAnnotationObjectTextureByPath(annotation_name, mesh_name, texture_path, is_name_regex=False/True)` to set the texture of an object in direct mode, the texture path should be same format as described above, for example `/Game/MyTextures/TestTexture1` (regex allows to set multiple with wildcards for example)
* `simEnableAnnotationObjectTextureByPath(annotation_name, mesh_name, r, g, b, is_name_regex=False/True)` to enable the texture of an object in relative path mode, this does require a texture in the relative path as described above! (regex allows to set multiple with wildcards for example)
* `simGetAnnotationObjectTexturePath(annotation_name, mesh_name)` to get the texture path of an object

The same is available in Unreal Blueprint and Unreal c++. You can find the functions in the `Annotation` category.
* `Add Texture Direct Annotation Tag to Component/Actor By Path(annotation_name, component/actor, texture_path, update_annotation=true/false)` to set the texture of an object in direct mode, the texture path should be same format as described above, for example `/Game/MyTextures/TestTexture1`
* `Update Texture Direct Annotation Tag to Component/Actor By Path(annotation_name, component/actor, texture_path, update_annotation=true/false)` to update texture of an object in direct mode that is already in the system, the texture path should be same format as described above, for example `/Game/MyTextures/TestTexture1`
* `Add Texture Direct Annotation Tag to Component/Actor(annotation_name, component/actor, texture, update_annotation=true/false)` to set the texture of an object in direct mode, the texture can be directly referenced as UTexture* Object
* `Update Texture Direct Annotation Tag to Component/Actor(annotation_name, component/actor, texture, update_annotation=true/false)` to update texture of an object in direct mode that is already in the system, the texture can be directly referenced as UTexture* Object
* `Enable Texture By Path Annotation Tag to Component/Actor(annotation_name, component/actor, update_annotation=true/false)` to enable the texture of an object in relative path mode, this does require a texture in the relative path as described above!

* `Add Texture Direct Annotation Tag to Component/Actor By Path(annotation_name, component/actor, texture_path, update_annotation=true/false)` to set the texture of an object in direct mode, the texture path should be same format as described above, for example `/Game/MyTextures/TestTexture1`
* `Update Texture Direct Annotation Tag to Component/Actor By Path(annotation_name, component/actor, texture_path, update_annotation=true/false)` to update texture of an object in direct mode that is already in the system, the texture path should be same format as described above, for example `/Game/MyTextures/TestTexture1`
* `Add Texture Direct Annotation Tag to Component/Actor(annotation_name, component/actor, texture, update_annotation=true/false)` to set the texture of an object in direct mode, the texture can be directly referenced as UTexture* Object
* `Update Texture Direct Annotation Tag to Component/Actor(annotation_name, component/actor, texture, update_annotation=true/false)` to update texture of an object in direct mode that is already in the system, the texture can be directly referenced as UTexture* Object
* `Enable Texture By Path Annotation Tag to Component/Actor(annotation_name, component/actor, update_annotation=true/false)` to enable the texture of an object in relative path mode, this does require a texture in the relative path as described above!

Note that enabling _update_annotation_ is a relatively slow process, specially on actors with lots of annotated components.
Ideally set _update_annotation_ to false during the process of adding tags to the actor and only turn on update_annotation for the last component or actor you want to update.
Expand All @@ -172,14 +178,16 @@ With the unreal blueprint and c++ functions however, you can also decide to upda
If you have many objects to update, this can save a lot of time by doing it only for the last object.

Some API functions exist for all types, for example in Python:
* `simListAnnotationObjects(annotation_name)` to get a list of all objects within this annotation layer.
* `simListAnnotationPoses(annotation_name, ned=True/False, only_visible=False/True)` to get the 3D poses of all objects in this annotation layer. The returned pose is in NED coordinates in SI units with its origin at Player Start by default or in Unreal NED frame if the `ned` boolean argument is set to `talse`.

* `simListAnnotationObjects(annotation_name)` to get a list of all objects within this annotation layer.
* `simListAnnotationPoses(annotation_name, ned=True/False, only_visible=False/True)` to get the 3D poses of all objects in this annotation layer. The returned pose is in NED coordinates in SI units with its origin at Player Start by default or in Unreal NED frame if the `ned` boolean argument is set to `talse`.

Similarly, for Unreal Blueprint and Unreal c++. You can find the functions in the `Annotation` category.
* `Does Annotation Layer Exist(annotation_name)` to figure out if a layer exists or not
* `Add New Actor To Annotation(annotation_name, actor, update_annotation=true/false)` if you manually added a tag, and want to update the annotation layer with this actor. This is useful to run after adding multiple tags to the actor and its components with the other api calls, and you want to update the annotation layer only once, otherwise it will be much slower.
* `Delete Actor From Annotation(annotation_name, actor, update_annotation=true/false)` if you manually remove all tags from an actor for this layer and remove it from the annotation layer
* `Force Update Annotation(annotation_name)` to force an update of the annotation layer.

* `Does Annotation Layer Exist(annotation_name)` to figure out if a layer exists or not
* `Add New Actor To Annotation(annotation_name, actor, update_annotation=true/false)` if you manually added a tag, and want to update the annotation layer with this actor. This is useful to run after adding multiple tags to the actor and its components with the other api calls, and you want to update the annotation layer only once, otherwise it will be much slower.
* `Delete Actor From Annotation(annotation_name, actor, update_annotation=true/false)` if you manually remove all tags from an actor for this layer and remove it from the annotation layer
* `Force Update Annotation(annotation_name)` to force an update of the annotation layer.

### Getting annotation data from sensors
The easiest way to get the images from annotation cameras, is through the image API. See the [Image API documentation](image_apis.md#annotation) for more information.
Expand Down
2 changes: 1 addition & 1 deletion docs/apis.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
AirSim exposes APIs so you can interact with vehicle in the simulation programmatically. You can use these APIs to retrieve images, get state, control the vehicle and so on.

## Python Quickstart
If you want to use Python to call AirSim APIs, we recommend using Anaconda with Python 3.5 or later versions however some code may also work with Python 2.7 ([help us](CONTRIBUTING.md) improve compatibility!).
If you want to use Python to call AirSim APIs, we recommend using Anaconda with Python 3.5 or later versions however some code may also work with Python 2.7.

First install this package:

Expand Down
Loading

0 comments on commit a7dac0f

Please sign in to comment.