-
Notifications
You must be signed in to change notification settings - Fork 4
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
3 changed files
with
115 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,101 @@ | ||
--- | ||
layout: default | ||
title: Standalone outside ROS | ||
parent: MRS Simulator | ||
grand_parent: Simulation | ||
nav_order: 3 | ||
--- | ||
|
||
The MRS Multirotor Simulator contains a **header-only** implementation of the single UAV dynamics including a feedback controller pipeline. | ||
|
||
## Headers | ||
|
||
The headers are located in [include/mrs_multirotor_simulator/uav_system](https://github.com/ctu-mrs/mrs_multirotor_simulator/tree/master/include/mrs_multirotor_simulator/uav_system). | ||
All the headers should be linked using relative includes so it should be possible to just copy the whole folder into your own code. | ||
|
||
## Provided API | ||
|
||
The API to the single UAV model is provided from | ||
``` | ||
include uav_system.hpp | ||
``` | ||
|
||
### Constructors | ||
|
||
Default constructor, uses parameters for Holybro x500 drone: | ||
```C | ||
UavSystem(void); | ||
``` | ||
A constructor that accepts model parameters: | ||
```C | ||
UavSystem(const MultirotorModel::ModelParams& model_params); | ||
``` | ||
|
||
A constructor that accepts model parameters and an initial spawn position: | ||
```C | ||
UavSystem(const MultirotorModel::ModelParams& model_params, const Eigen::Vector3d spawn_pos, const double spawn_heading); | ||
``` | ||
### Stepping the simulator | ||
The simulator step with a particular time step can be executed by: | ||
```C | ||
void makeStep(const double dt); | ||
``` | ||
|
||
### Control inputs | ||
|
||
The UAV accepts a variety of control inputs. | ||
You can start controlling the drone by calling any of these functions: | ||
```C | ||
void setInput(const reference::Actuators& actuators); | ||
void setInput(const reference::ControlGroup& control_group); | ||
void setInput(const reference::AttitudeRate& attitude_rate); | ||
void setInput(const reference::Attitude& attitude); | ||
void setInput(const reference::TiltHdgRate& tilt); | ||
void setInput(const reference::AccelerationHdgRate& acceleration); | ||
void setInput(const reference::AccelerationHdg& acceleration); | ||
void setInput(const reference::VelocityHdgRate& velocity); | ||
void setInput(const reference::VelocityHdg& velocity); | ||
void setInput(const reference::Position& position); | ||
|
||
void setFeedforward(const reference::AccelerationHdgRate& cmd); | ||
void setFeedforward(const reference::AccelerationHdg& cmd); | ||
void setFeedforward(const reference::VelocityHdg& cmd); | ||
void setFeedforward(const reference::VelocityHdgRate& cmd); | ||
``` | ||
### Getting data | ||
The full UAV state can be obtained by: | ||
```C | ||
MultirotorModel::State getState(void); | ||
``` | ||
|
||
The simulated accelerometer measurement can be obtained by: | ||
```C | ||
Eigen::Vector3d getImuAcceleration(void); | ||
``` | ||
### Setting controller parameters | ||
```C | ||
void setMixerParams(const Mixer::Params& params); | ||
void setRateControllerParams(const RateController::Params& params); | ||
void setAttitudeControllerParams(const AttitudeController::Params& params); | ||
void setVelocityControllerParams(const VelocityController::Params& params); | ||
void setPositionControllerParams(const PositionController::Params& params); | ||
``` | ||
|
||
### Other routines | ||
|
||
A crash can be induced by: | ||
```C | ||
void crash(void); | ||
``` | ||
External force can be applied to the UAV by: | ||
```C | ||
void applyForce(const Eigen::Vector3d& force); | ||
``` |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
layout: default | ||
title: Standalone ROS simulation | ||
parent: MRS Simulator | ||
grand_parent: Simulation | ||
nav_order: 2 | ||
--- |
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 |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
layout: default | ||
title: With the MRS UAV System | ||
parent: MRS Simulator | ||
grand_parent: Simulation | ||
nav_order: 1 | ||
--- |