Skip to content

Commit

Permalink
Merge branch 'CodexLabsLLC:main' into humble
Browse files Browse the repository at this point in the history
  • Loading branch information
nikola-j authored Nov 22, 2023
2 parents 0e1de32 + 2383b0a commit 691e62b
Show file tree
Hide file tree
Showing 10 changed files with 55 additions and 177 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/test_ubuntu.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-18.04, ubuntu-20.04]
os: [ubuntu-20.04]

steps:
- uses: actions/checkout@v3
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ __pragma(warning(disable : 4239))
MultirotorRpcLibClient* MultirotorRpcLibClient::moveToGPSAsync(float latitude, float longitude, float altitude, float velocity, float timeout_sec,
DrivetrainType drivetrain, const YawMode& yaw_mode, float lookahead, float adaptive_lookahead, const std::string& vehicle_name)
{
pimpl_->last_future = static_cast<rpc::client*>(getClient())->async_call("movetoGPS", latitude, longitude, altitude, velocity, timeout_sec, drivetrain, MultirotorRpcLibAdaptors::YawMode(yaw_mode), lookahead, adaptive_lookahead, vehicle_name);
pimpl_->last_future = static_cast<rpc::client*>(getClient())->async_call("moveToGPS", latitude, longitude, altitude, velocity, timeout_sec, drivetrain, MultirotorRpcLibAdaptors::YawMode(yaw_mode), lookahead, adaptive_lookahead, vehicle_name);
return this;
}

Expand Down
146 changes: 8 additions & 138 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@
[![Ubuntu Build](https://github.com/CodexLabsLLC/Colosseum/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/CodexLabsLLC/Colosseum/actions/workflows/test_ubuntu.yml)
[![MacOS Build](https://github.com/CodexLabsLLC/Colosseum/actions/workflows/test_macos.yml/badge.svg)](https://github.com/CodexLabsLLC/Colosseum/actions/workflows/test_macos.yml)
[![Windows Build](https://github.com/CodexLabsLLC/Colosseum/actions/workflows/test_windows.yml/badge.svg)](https://github.com/CodexLabsLLC/Colosseum/actions/workflows/test_windows.yml)

[![](https://dcbadge.vercel.app/api/server/y9ZJKKKn8J)](https://discord.gg/y9ZJKKKn8J)

## Looking for more performance?
The company managing this repo created the SWARM Developer System to help build, simulate and deploy single and
Expand All @@ -13,13 +15,17 @@ multi-agent autonomous systems. Check it out here: [SWARM Developer System](http
Moving forward, we are now using Unreal Engine 5 version 5.03 or greater! If you
want to use UE4.27, you can use the branch `ue4.27`.

## Unreal Engine Version for Main Branch
The main branch of this repository **only** supports Unreal Engine 5.2! Please see our other branches
for other versions that we support.

## Currently Supported Operating Systems
Below are the list of officially supported Operating Systems, with full Unreal Engine support:
### Windows
- Windows 10 (Latest)

### Linux
- Ubuntu 18.04
- ~~Ubuntu 18.04~~ (NO LONGER SUPPORTED. 18.04 is EOL so we will not be checking this anymore and GitHub doesn't support CI builds)
- Ubuntu 20.04

**NOTE** Ubuntu 22.04 is not currently supported due to Vulkan support. If this changes, we will notify you here. If you want to use Colosseum on 22.04, we highly recommend that you use Docker.
Expand All @@ -40,7 +46,7 @@ Colosseum is a simulator for robotic, autonomous systems, built on [Unreal Engin
This is a fork of the AirSim repository, which Microsoft decided to shutdown in July of 2022. This fork serves as a waypoint to building a new and better simulation platform. The creater and maintainer of this fork is Codex Laboratories LLC (our website is [here](https://www.codex-labs-llc.com)). Colosseum is one of the underlying simulation systems that we use in our product, the [SWARM Simulation Platform](https://www.swarmsim.io). This platform exists to provide pre-built tools and low-code/no-code autonomy solutions. Please feel free to check this platform out and reach out if interested.

## Join the Community
We have decided to create a Slack to better allow for community engagement. Join here: [Colosseum Slack](https://join.slack.com/t/colosseum-sim/shared_invite/zt-1qwrbtz1d-WCGpYhJ8sDrYTv8fk50pFg)
We have decided to create a Discord channel to better allow for community engagement. Join here: [Colosseum Robotics Discord](https://discord.gg/y9ZJKKKn8J).


## Goals and Project Development
Expand All @@ -51,142 +57,6 @@ Click [here](https://docs.google.com/document/d/1doohQTos4v1tg4Wv6SliQFnKNK1MouK
If you want to be apart of the official development team, attend meetings, etc., please utilize the Slack channel (link above) and
let Tyler Fedrizzi know!

**Check out the quick 1.5 minute demo**

Quadrotor UAVs in Colosseum

[![Colosseum Drone Demo Video](docs/images/demo_video.png)](https://youtu.be/-WfTr1-OBGQ)

Cars in Colosseum

[![Colosseum Car Demo Video](docs/images/car_demo_video.png)](https://youtu.be/gnz1X3UNM5Y)


## How to Get It

### Windows
[![Build Status](https://github.com/microsoft/AirSim/actions/workflows/test_windows.yml/badge.svg)](https://github.com/microsoft/AirSim/actions/workflows/test_windows.yml)
* [Download binaries](https://github.com/Microsoft/AirSim/releases)
* [Build it](https://microsoft.github.io/AirSim/build_windows)

### Linux
[![Build Status](https://github.com/microsoft/AirSim/actions/workflows/test_ubuntu.yml/badge.svg)](https://github.com/microsoft/AirSim/actions/workflows/test_ubuntu.yml)
* [Download binaries](https://github.com/Microsoft/AirSim/releases)
* [Build it](https://microsoft.github.io/AirSim/build_linux)

### macOS
[![Build Status](https://github.com/microsoft/AirSim/actions/workflows/test_macos.yml/badge.svg)](https://github.com/microsoft/AirSim/actions/workflows/test_macos.yml)
* [Build it](https://microsoft.github.io/AirSim/build_macos)

For more details, see the [use precompiled binaries](docs/use_precompiled.md) document.

## How to Use It

### Documentation

View our [detailed documentation](https://microsoft.github.io/AirSim/) on all aspects of Colosseum.

### Manual drive

If you have remote control (RC) as shown below, you can manually control the drone in the simulator. For cars, you can use arrow keys to drive manually.

[More details](https://microsoft.github.io/AirSim/remote_control)

![record screenshot](docs/images/AirSimDroneManual.gif)

![record screenshot](docs/images/AirSimCarManual.gif)


### Programmatic control

Colosseum exposes APIs so you can interact with the vehicle in the simulation programmatically. You can use these APIs to retrieve images, get state, control the vehicle and so on. The APIs are exposed through the RPC, and are accessible via a variety of languages, including C++, Python, C# and Java.

These APIs are also available as part of a separate, independent cross-platform library, so you can deploy them on a companion computer on your vehicle. This way you can write and test your code in the simulator, and later execute it on the real vehicles. Transfer learning and related research is one of our focus areas.

Note that you can use [SimMode setting](https://microsoft.github.io/AirSim/settings#simmode) to specify the default vehicle or the new [ComputerVision mode](https://microsoft.github.io/AirSim/image_apis#computer-vision-mode-1) so you don't get prompted each time you start Colosseum.

[More details](https://microsoft.github.io/AirSim/apis)

### Gathering training data

There are two ways you can generate training data from Colosseum for deep learning. The easiest way is to simply press the record button in the lower right corner. This will start writing pose and images for each frame. The data logging code is pretty simple and you can modify it to your heart's content.

![record screenshot](docs/images/record_data.png)

A better way to generate training data exactly the way you want is by accessing the APIs. This allows you to be in full control of how, what, where and when you want to log data.

### Computer Vision mode

Yet another way to use Colosseum is the so-called "Computer Vision" mode. In this mode, you don't have vehicles or physics. You can use the keyboard to move around the scene, or use APIs to position available cameras in any arbitrary pose, and collect images such as depth, disparity, surface normals or object segmentation.

[More details](https://microsoft.github.io/AirSim/image_apis)

### Weather Effects

Press F10 to see various options available for weather effects. You can also control the weather using [APIs](https://microsoft.github.io/AirSim/apis#weather-apis). Press F1 to see other options available.

![record screenshot](docs/images/weather_menu.png)

## Tutorials

- [Video - Setting up Colosseum with Pixhawk Tutorial](https://youtu.be/1oY8Qu5maQQ) by Chris Lovett
- [Video - Using Colosseum with Pixhawk Tutorial](https://youtu.be/HNWdYrtw3f0) by Chris Lovett
- [Video - Using off-the-self environments with Colosseum](https://www.youtube.com/watch?v=y09VbdQWvQY) by Jim Piavis
- [Webinar - Harnessing high-fidelity simulation for autonomous systems](https://note.microsoft.com/MSR-Webinar-AirSim-Registration-On-Demand.html) by Sai Vemprala
- [Reinforcement Learning with Colosseum](https://microsoft.github.io/AirSim/reinforcement_learning) by Ashish Kapoor
- [The Autonomous Driving Cookbook](https://aka.ms/AutonomousDrivingCookbook) by Microsoft Deep Learning and Robotics Garage Chapter
- [Using TensorFlow for simple collision avoidance](https://github.com/simondlevy/AirSimTensorFlow) by Simon Levy and WLU team

## Participate

### Paper

More technical details are available in [Colosseum paper (FSR 2017 Conference)](https://arxiv.org/abs/1705.05065). Please cite this as:
```
@inproceedings{airsim2017fsr,
author = {Shital Shah and Debadeepta Dey and Chris Lovett and Ashish Kapoor},
title = {AirSim: High-Fidelity Visual and Physical Simulation for Autonomous Vehicles},
year = {2017},
booktitle = {Field and Service Robotics},
eprint = {arXiv:1705.05065},
url = {https://arxiv.org/abs/1705.05065}
}
```

### Contribute

Please take a look at [open issues](https://github.com/microsoft/airsim/issues) if you are looking for areas to contribute to.

* [More on Colosseum design](https://microsoft.github.io/AirSim/design)
* [More on code structure](https://microsoft.github.io/AirSim/code_structure)
* [Contribution Guidelines](CONTRIBUTING.md)

### Who is Using Colosseum?

We are maintaining a [list](https://microsoft.github.io/AirSim/who_is_using) of a few projects, people and groups that we are aware of. If you would like to be featured in this list please [make a request here](https://github.com/CodexLabsLLC/Colosseum/issues).

## Contact

Join our [GitHub Discussions group](https://github.com/microsoft/AirSim/discussions) to stay up to date or ask any questions.

We also have an Colosseum group on [Facebook](https://www.facebook.com/groups/1225832467530667/).


## What's New

* [Experimental Support for Unreal Engine 5.0.3](https://github.com/CodexLabsLLC/Colosseum/tree/ue5)

For complete list of changes, view our [Changelog](docs/CHANGELOG.md)

## FAQ

If you run into problems, check the [FAQ](https://codexlabsllc.github.io/Colosseum/faq) and feel free to post issues in the [Colosseum](https://github.com/CodexLabsLLC/Colosseum/issues) repository.

## Code of Conduct

This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments.


## License

This project is released under the MIT License. Please review the [License file](LICENSE) for more details.
Expand Down
17 changes: 16 additions & 1 deletion Unity/UnityDemo/Assets/AirSimAssets/Scripts/Vehicles/Vehicle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -343,10 +343,25 @@ private void InitializeVehicle() {
captureResetEvent = new AutoResetEvent(false);
}

private GameObject FindChildWithTag(GameObject parent, string tag) {
GameObject child = null;

foreach(Transform transform in parent.transform) {
if(transform.CompareTag(tag)) {
child = transform.gameObject;
break;
}
}

return child;
}

//Register all the capture cameras in the scene for recording and data capture.
//Make sure every camera is a child of a gameobject with tag "CaptureCameras"
private void SetUpCameras() {
GameObject camerasParent = GameObject.FindGameObjectWithTag("CaptureCameras");
GameObject this_vehicle = GameObject.Find(this.name);
GameObject camerasParent = FindChildWithTag(this_vehicle, "CaptureCameras");

if (!camerasParent) {
Debug.LogWarning("No Cameras found in the scene to capture data");
return;
Expand Down
12 changes: 6 additions & 6 deletions Unreal/Plugins/AirSim/Source/AirBlueprintLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -494,9 +494,9 @@ std::vector<msr::airlib::MeshPositionVertexBuffersResponse> UAirBlueprintLib::Ge
ENQUEUE_RENDER_COMMAND(GetVertexBuffer)
(
[vertex_buffer, data](FRHICommandListImmediate& RHICmdList) {
FVector* indices = (FVector*)RHILockVertexBuffer(vertex_buffer->VertexBufferRHI, 0, vertex_buffer->VertexBufferRHI->GetSize(), RLM_ReadOnly);
FVector* indices = (FVector*)RHILockBuffer(vertex_buffer->VertexBufferRHI, 0, vertex_buffer->VertexBufferRHI->GetSize(), RLM_ReadOnly);
memcpy(data, indices, vertex_buffer->VertexBufferRHI->GetSize());
RHIUnlockVertexBuffer(vertex_buffer->VertexBufferRHI);
RHIUnlockBuffer(vertex_buffer->VertexBufferRHI);
});

#if ((ENGINE_MAJOR_VERSION > 4) || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 27))
Expand All @@ -516,9 +516,9 @@ std::vector<msr::airlib::MeshPositionVertexBuffersResponse> UAirBlueprintLib::Ge
ENQUEUE_RENDER_COMMAND(GetIndexBuffer)
(
[IndexBuffer, data_ptr](FRHICommandListImmediate& RHICmdList) {
uint16_t* indices = (uint16_t*)RHILockIndexBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
uint16_t* indices = (uint16_t*)RHILockBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
memcpy(data_ptr, indices, IndexBuffer->IndexBufferRHI->GetSize());
RHIUnlockIndexBuffer(IndexBuffer->IndexBufferRHI);
RHIUnlockBuffer(IndexBuffer->IndexBufferRHI);
});

//Need to force the render command to go through cause on the next iteration the buffer no longer exists
Expand All @@ -539,9 +539,9 @@ std::vector<msr::airlib::MeshPositionVertexBuffersResponse> UAirBlueprintLib::Ge
ENQUEUE_RENDER_COMMAND(GetIndexBuffer)
(
[IndexBuffer, data_ptr](FRHICommandListImmediate& RHICmdList) {
uint32_t* indices = (uint32_t*)RHILockIndexBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
uint32_t* indices = (uint32_t*)RHILockBuffer(IndexBuffer->IndexBufferRHI, 0, IndexBuffer->IndexBufferRHI->GetSize(), RLM_ReadOnly);
memcpy(data_ptr, indices, IndexBuffer->IndexBufferRHI->GetSize());
RHIUnlockIndexBuffer(IndexBuffer->IndexBufferRHI);
RHIUnlockBuffer(IndexBuffer->IndexBufferRHI);
});

FlushRenderingCommands();
Expand Down
2 changes: 1 addition & 1 deletion Unreal/Plugins/AirSim/Source/SimMode/SimModeBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ void ASimModeBase::initializeTimeOfDay()
static const FName sun_prop_name(TEXT("Directional light actor"));
auto* p = sky_sphere_class_->FindPropertyByName(sun_prop_name);

#if ENGINE_MINOR_VERSION > 24
#if ((ENGINE_MAJOR_VERSION > 4) || (ENGINE_MAJOR_VERSION == 4 && ENGINE_MINOR_VERSION >= 27))
FObjectProperty* sun_prop = CastFieldChecked<FObjectProperty>(p);
#else
FObjectProperty* sun_prop = Cast<FObjectProperty>(p);
Expand Down
5 changes: 5 additions & 0 deletions ros2/src/airsim_ros_pkgs/include/airsim_ros_wrapper.h
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,11 @@ class AirsimROSWrapper
rclcpp::TimerBase::SharedPtr airsim_control_update_timer_;
rclcpp::TimerBase::SharedPtr airsim_lidar_update_timer_;

/// Callback groups
std::vector<rclcpp::CallbackGroup::SharedPtr> airsim_img_callback_groups_;
rclcpp::CallbackGroup::SharedPtr airsim_control_callback_group_;
std::vector<rclcpp::CallbackGroup::SharedPtr> airsim_lidar_callback_groups_;

typedef std::pair<std::vector<ImageRequest>, std::string> airsim_img_request_vehicle_name_pair;
std::vector<airsim_img_request_vehicle_name_pair> airsim_img_request_vehicle_name_pair_vec_;
std::vector<image_transport::Publisher> image_pub_vec_;
Expand Down
30 changes: 7 additions & 23 deletions ros2/src/airsim_ros_pkgs/src/airsim_node.cpp
Original file line number Diff line number Diff line change
@@ -1,35 +1,19 @@
#include <rclcpp/rclcpp.hpp>
#include "airsim_ros_wrapper.h"

int main(int argc, char** argv)
{
int main(int argc, char **argv) {
rclcpp::init(argc, argv);
rclcpp::NodeOptions node_options;
node_options.automatically_declare_parameters_from_overrides(true);
std::shared_ptr<rclcpp::Node> nh = rclcpp::Node::make_shared("airsim_node", node_options);
std::shared_ptr<rclcpp::Node> nh_img = nh->create_sub_node("img");
std::shared_ptr<rclcpp::Node> nh_lidar = nh->create_sub_node("lidar");
std::shared_ptr <rclcpp::Node> nh = rclcpp::Node::make_shared("airsim_node", node_options);
std::shared_ptr <rclcpp::Node> nh_img = nh->create_sub_node("img");
std::shared_ptr <rclcpp::Node> nh_lidar = nh->create_sub_node("lidar");
std::string host_ip;
nh->get_parameter("host_ip", host_ip);
AirsimROSWrapper airsim_ros_wrapper(nh, nh_img, nh_lidar, host_ip);

if (airsim_ros_wrapper.is_used_img_timer_cb_queue_) {
rclcpp::executors::SingleThreadedExecutor executor;
executor.add_node(nh_img);
while (rclcpp::ok()) {
executor.spin();
}
}

if (airsim_ros_wrapper.is_used_lidar_timer_cb_queue_) {
rclcpp::executors::SingleThreadedExecutor executor;
executor.add_node(nh_lidar);
while (rclcpp::ok()) {
executor.spin();
}
}

rclcpp::spin(nh);
rclcpp::executors::MultiThreadedExecutor executor;
executor.add_node(nh);
executor.spin();

return 0;
}
Loading

0 comments on commit 691e62b

Please sign in to comment.