-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
54 additions
and
90 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,111 +1,75 @@ | ||
# Asteroid Mining Simulation | ||
|
||
## Overview | ||
1. Excavator bot navigates (using a Nav2 plan) to mining site | ||
This is a proof of concept project that combines multiple technologies. | ||
|
||
The aim is to investigate the maturity of these technologies in the context of a simulated multi-robot asteroid mining scenario. | ||
|
||
Robot Types: (inspired by [Offworld](https://www.offworld.ai/products)) | ||
- Excavator | ||
- Collector | ||
- (Surveyor) | ||
- (Dozer) | ||
- (Hauler) | ||
- (Fixer) | ||
|
||
## Mission Plan | ||
1. Excavator bot navigates to mining site using Nav2 | ||
1. Excavator bot starts mining | ||
1. MoveIt2 + Gazebo simulation plans and executes mining motion | ||
1. Upon success, Gazebo triggers Bevy to start spawning resources | ||
1. Collector bot collects resources | ||
1. Collector bot brings resources back to refinery | ||
1. Rovers automatically goes to charging station when low battery. | ||
|
||
## Technologies Used | ||
- Bevy (Rust) | ||
- `ros2-rust` | ||
- Space ROS | ||
- Gazebo | ||
- SMACC2 | ||
- BehaviorTree.CPP | ||
|
||
## Macro Sim (Bevy) | ||
### Entities | ||
- Rovers | ||
- Base | ||
- Tool (inspired by [Offworld](https://www.offworld.ai/products)) | ||
- Excavator | ||
- Collector | ||
- (Surveyor) | ||
- (Dozer) | ||
- (Hauler) | ||
- (Fixer) | ||
- Mining site | ||
- Refinery/Factory | ||
- Solar Panels | ||
- Command Center | ||
|
||
### Components | ||
- Health | ||
- Tool Slot | ||
- Capacity | ||
|
||
### Systems | ||
- Degradation | ||
- Pickup Tool | ||
- Drop Tool | ||
- Tool Operation | ||
- Natural Disaster | ||
- Collisions | ||
- Base motion | ||
- Gravity | ||
|
||
### UI | ||
- Select Rover | ||
- Remote Control | ||
- Switch Mode | ||
|
||
## Rovers (Space ROS) | ||
### Topics | ||
Publish: | ||
- Command Velocity | ||
- ~~Battery Level~~ | ||
|
||
Subscribe: | ||
- ~~Costmap~~ | ||
|
||
### Services | ||
- Set Nav Target (PoseStamped) | ||
- ~~Set battery level~~ | ||
|
||
### Actions | ||
- ~~Go To Position~~ | ||
- ~~Excavate / Operate Tool~~ | ||
|
||
### Hierarchical Finite State Machine Behavior Tree Hybrid (HFSMBTH) | ||
<https://www.youtube.com/watch?v=Qq_xX1JCreI&t=1167s> | ||
|
||
SMACC2 + BehaviorTree.CPP | ||
|
||
States: | ||
- Autonomous | ||
1. Go to worksite | ||
1. Do work | ||
1. Repeat | ||
- Low Battery | ||
1. Go to charging station | ||
1. Charge | ||
- Manual | ||
1. Execute | ||
1. Wait for X seconds | ||
1. Go back to Autonomous | ||
|
||
## Micro Sim (Gazebo) | ||
Use MoveIt2, Nav2 and Gazebo to simulate certain robot behaviors | ||
- Drilling motion | ||
- [x] [Bevy](https://bevyengine.org/) | ||
- [x] [`ros2-rust`](https://github.com/ros2-rust/ros2_rust) | ||
- [x] [Space ROS](https://space.ros.org/) | ||
- [x] [Hierarchical Finite State Machine Behavior Tree Hybrid (HFSMBTH)](https://www.youtube.com/watch?v=Qq_xX1JCreI&t=1167s) | ||
- [x] [BehaviorTree.CPP](https://github.com/BehaviorTree/BehaviorTree.CPP) | ||
- [x] [HFSM2](https://github.com/andrew-gresyk/HFSM2) | ||
- [ ] Gazebo | ||
- [ ] Nav2 | ||
- [ ] MoveIt2 | ||
|
||
## TODO | ||
- [] Set up CI/CD & linters | ||
- [ ] Set up CI/CD & linters | ||
- [x] Bare minimum macro sim | ||
- [x] Single excavator with manual controls | ||
- [x] Interface with ROS using `ros2-rust` | ||
- [x] Set up robot running Space ROS | ||
- [] Create HFSMBTH | ||
- [] Set up micro sim (Gazebo) | ||
- [] Set up MoveIt2 | ||
- [] Set up Nav2 | ||
- [ ] Create HFSMBTH | ||
- [x] Create FSM | ||
- [ ] Create BT | ||
- [ ] Macro Sim UI | ||
- [ ] Multiple rovers | ||
- [ ] Set up micro sim (Gazebo) | ||
- [ ] Set up MoveIt2 | ||
- [ ] Set up Nav2 | ||
|
||
## Macro Sim (Bevy + `ros2-rust`) | ||
The asteroid and rover kinematics is simulated using Bevy, a popular Rust game engine that uses an ECS architecture similar to Gazebo. | ||
|
||
The asteroid is treated as a sphere and the rover is assumed to be constrained to the surface of the asteroid. | ||
The rover velocity is forward integrated and reprojected onto the surface of the sphere via geodesic calculations. | ||
|
||
## Rovers (Space ROS + HFSMBTH) | ||
The rover is controlled using Space ROS to mimic what a real space rover would use. | ||
|
||
The behavior is coordinated using a HFSMBTH which aims to combine the benefits of hierarchical finite state machines (HFSM) and behavior trees (BT). | ||
|
||
## FAQ | ||
Why Bevy and not Gazebo? | ||
1. I wanted an excuse to learn the Bevy engine. | ||
1. Radial (planetary) gravity | ||
1. I plan to scale this to large number of robots and didn't want to simulate the physics of every single one. | ||
Note that Gazebo is still used when simulating the sensor and robot arm during arm motion planning. | ||
1. [Gazebo vs *\<insert game engine\>*](https://discourse.ros.org/t/why-do-we-use-gazebo-instead-of-unreal-or-unity/25890/15). | ||
Note that Gazebo will still be used when simulating the sensor and robot arm during arm motion planning. | ||
|
||
Why HFSMBTH? | ||
- (Reiterating key points from talk linked above) | ||
|
||
BTs are great at modelling sequences of fallible actions but awful at modelling cyclical behavior (BTs are directed acyclic graphs). | ||
|
||
FSMs are great at modelling cyclical behavior but awful at modelling sequences of fallible actions (fallback/retry adds lots of unnecessary states). | ||
|
||
Combine them both to get the best of both worlds. |