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

Gazebo: add OmniRover with Mecanum wheels #139

Merged
merged 8 commits into from
Sep 25, 2024
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
59 changes: 59 additions & 0 deletions Gazebo/config/omni3rover.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
ACRO_TURN_RATE 300.000000
ARSPD_PIN 1
ARSPD_BUS 2
ATC_SPEED_P 0.200000
ATC_SPEED_D 0.000010
ATC_STR_RAT_D 0.000010
ATC_STR_RAT_FF 0.100000
ATC_STR_RAT_I 0.010000
ATC_STR_RAT_MAX 360.000000
ATC_STR_RAT_P 0.030000
BATT_MONITOR 4
CRUISE_SPEED 1.0
CRUISE_THROTTLE 42.0
FRAME_TYPE 4
GCS_PID_MASK 1
INS_ACC2OFFS_X 0.001
INS_ACC2OFFS_Y 0.001
INS_ACC2OFFS_Z 0.001
INS_ACC2SCAL_X 1.001
INS_ACC2SCAL_Y 1.001
INS_ACC2SCAL_Z 1.001
INS_ACCOFFS_X 0.001
INS_ACCOFFS_Y 0.001
INS_ACCOFFS_Z 0.001
INS_ACCSCAL_X 1.001
INS_ACCSCAL_Y 1.001
INS_ACCSCAL_Z 1.001
INS_LOG_BAT_MASK 127
MODE3 11
MODE4 10
MODE5 2
PSC_VEL_P 0.500000
RC1_MAX 2000
RC1_MIN 1000
RC2_MAX 2000
RC2_MIN 1000
RC3_MAX 2000
RC3_MIN 1000
RC4_MAX 2000
RC4_MIN 1000
RELAY1_PIN 1
RELAY2_PIN 2
SERVO1_FUNCTION 33
SERVO1_MAX 2000
SERVO1_MIN 1000
SERVO1_TRIM 1500
SERVO2_FUNCTION 34
SERVO2_MAX 2000
SERVO2_MIN 1000
SERVO2_TRIM 1500
SERVO3_FUNCTION 35
SERVO3_MAX 2000
SERVO3_MIN 1000
SERVO3_TRIM 1500
WP_PIVOT_RATE 120.0
WP_RADIUS 3
WP_SPEED 1.0


64 changes: 64 additions & 0 deletions Gazebo/config/omni4rover.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
ACRO_TURN_RATE 300.000000
ARSPD_PIN 1
ARSPD_BUS 2
ATC_SPEED_P 0.200000
ATC_SPEED_D 0.000100
ATC_STR_RAT_D 0.005000
ATC_STR_RAT_FF 0.100000
ATC_STR_RAT_I 0.080000
ATC_STR_RAT_MAX 360.000000
ATC_STR_RAT_P 0.080000
BATT_MONITOR 4
CRUISE_SPEED 1.0
CRUISE_THROTTLE 42.0
FRAME_TYPE 2
GCS_PID_MASK 1
INS_ACC2OFFS_X 0.001
INS_ACC2OFFS_Y 0.001
INS_ACC2OFFS_Z 0.001
INS_ACC2SCAL_X 1.001
INS_ACC2SCAL_Y 1.001
INS_ACC2SCAL_Z 1.001
INS_ACCOFFS_X 0.001
INS_ACCOFFS_Y 0.001
INS_ACCOFFS_Z 0.001
INS_ACCSCAL_X 1.001
INS_ACCSCAL_Y 1.001
INS_ACCSCAL_Z 1.001
INS_LOG_BAT_MASK 127
MODE3 11
MODE4 10
MODE5 2
PSC_VEL_D 0.000100
PSC_VEL_I 0.100000
RC1_MAX 2000
RC1_MIN 1000
RC2_MAX 2000
RC2_MIN 1000
RC3_MAX 2000
RC3_MIN 1000
RC4_MAX 2000
RC4_MIN 1000
RELAY1_PIN 1
RELAY2_PIN 2
SERVO1_FUNCTION 33
SERVO1_MAX 2000
SERVO1_MIN 1000
SERVO1_TRIM 1500
SERVO2_FUNCTION 34
SERVO2_MAX 2000
SERVO2_MIN 1000
SERVO2_TRIM 1500
SERVO3_FUNCTION 35
SERVO3_MAX 2000
SERVO3_MIN 1000
SERVO3_TRIM 1500
SERVO4_FUNCTION 36
SERVO4_MIN 1000
SERVO4_MAX 2000
SERVO4_TRIM 1500
WP_PIVOT_RATE 120.0
WP_RADIUS 3
WP_SPEED 1.0


36 changes: 36 additions & 0 deletions Gazebo/docs/Omni3Rover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
# Omni3 Mecanum Rover

An Omni rover with 3 [Mecanum wheels](https://en.wikipedia.org/wiki/Mecanum_wheel).

![omni3rover](https://github.com/user-attachments/assets/53d5d0bf-e4e3-4f03-a50a-4004a9865309)


## Usage

#### Run Gazebo

Edit the `omnirover_playpen.sdf` to include the `omni3rover` model.

```bash
gz sim -v4 -r omnirover_playpen.sdf
```

#### Run ArduPilot SITL

```bash
sim_vehicle.py -v Rover --model JSON --add-param-file=$HOME/SITL_Models/Gazebo/config/omni3rover.param --console --map
```

Once armed, set the mode to `MANUAL` and control as follows:

| Channel | Low | High |
| --- | --- | --- |
`rc 1` | yaw left | yaw right |
`rc 2` | not assigned | |
`rc 3` | move back | move forward |
`rc 4` | move left | move right |


## Links

- [Rover wiki: Motor and Servo Connections: Omni-Vehicles](https://ardupilot.org/rover/docs/rover-motor-and-servo-connections.html#omni-vehicles)
34 changes: 34 additions & 0 deletions Gazebo/docs/OmniXRover.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# OmniX Mecanum Rover

An Omni rover with 4 [Mecanum wheels](https://en.wikipedia.org/wiki/Mecanum_wheel).

![omni4rover](https://github.com/user-attachments/assets/00775e2c-a651-4902-9493-c272687152c0)


## Usage

#### Run Gazebo

```bash
gz sim -v4 -r omnirover_playpen.sdf
```

#### Run ArduPilot SITL

```bash
sim_vehicle.py -v Rover --model JSON --add-param-file=$HOME/SITL_Models/Gazebo/config/omni4rover.param --console --map
```

Once armed, set the mode to `MANUAL` and control as follows:

| Channel | Low | High |
| --- | --- | --- |
`rc 1` | yaw left | yaw right |
`rc 2` | not assigned | |
`rc 3` | move back | move forward |
`rc 4` | move left | move right |


## Links

- [Rover wiki: Motor and Servo Connections: Omni-Vehicles](https://ardupilot.org/rover/docs/rover-motor-and-servo-connections.html#omni-vehicles)

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
15 changes: 15 additions & 0 deletions Gazebo/models/mecanum_wheel_left/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<?xml version="1.0"?>
<model>
<name>Mecanum Wheel Left</name>
<version>1.0</version>
<sdf version="1.9">model.sdf</sdf>

<author>
<name>Rhys Mainwaring</name>
<email>[email protected]</email>
</author>

<description>
Left mecanum wheel.
</description>
</model>
Loading