Skip to content

Commit

Permalink
Hexapod Copter: add model, script and params
Browse files Browse the repository at this point in the history
- Initial version based on Quadruped
- Reuse existing materials and meshes.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Update world name

Signed-off-by: Rhys Mainwaring <[email protected]>

- Add mid legs
- Reuse existing materials and meshes.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Fix indentation of control elements

Signed-off-by: Rhys Mainwaring <[email protected]>

- Add motors - initial version
- Initial motor placement - props not correctly oriented.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Update joint controller gains and initial position

Signed-off-by: Rhys Mainwaring <[email protected]>

- Add initial version of user doc

Signed-off-by: Rhys Mainwaring <[email protected]>

- Update motors and add rotor lift
- Update motor names to include index.
- Add lift drag plugins for props.
- Orient motors correctly for standard hexa frame.
- Add velocity control elements for motors.
- Disable joint control elements.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Update version of user doc
- The default hexa frame works.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Update initial position of femur links
- Change initial position from -0.6 to -0.5.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Configure model as FRAME_CLASS 15 (Scripting Matrix).
- Add control elements for the femur and tibia joints of the mid legs.
- Fix servo limits min 1000, max 2000.
- Add Lua script for hexapod copter.
- Add param file for hexapod copter.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Add <have_32_channels> parameter to model.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Update model docs.

Signed-off-by: Rhys Mainwaring <[email protected]>

- Update script to use dynamics motor mixer.
- Update params to use FRAME_CLASS 17.

Signed-off-by: Rhys Mainwaring <[email protected]>
  • Loading branch information
srmainwaring committed Mar 19, 2023
1 parent 78eb2de commit 6c2b1ed
Show file tree
Hide file tree
Showing 8 changed files with 3,817 additions and 0 deletions.
127 changes: 127 additions & 0 deletions Gazebo/config/hexapod_copter.param
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
FRAME_CLASS 17.0 # Dynamic Scripting Matrix
FRAME_TYPE 1 # X
SERVO_32_ENABLE 1

SCR_DEBUG_OPTS 0
SCR_DIR_DISABLE 0
SCR_ENABLE 1 # Lua Scripts
SCR_HEAP_SIZE 204800
SCR_USER1 0.0
SCR_USER2 0.0
SCR_USER3 0.0
SCR_USER4 0.0
SCR_USER5 0.0
SCR_USER6 0.0
SCR_VM_I_COUNT 10000

SERVO1_FUNCTION 33.0 # Motor 1
SERVO1_MAX 2000.0
SERVO1_MIN 1000.0
SERVO1_REVERSED 0
SERVO1_TRIM 1500.0
SERVO2_FUNCTION 34.0 # Motor 2
SERVO2_MAX 2000.0
SERVO2_MIN 1000.0
SERVO2_REVERSED 0
SERVO2_TRIM 1500.0
SERVO3_FUNCTION 35.0 # Motor 3
SERVO3_MAX 2000.0
SERVO3_MIN 1000.0
SERVO3_REVERSED 0
SERVO3_TRIM 1500.0
SERVO4_FUNCTION 36.0 # Motor 4
SERVO4_MAX 2000.0
SERVO4_MIN 1000.0
SERVO4_REVERSED 0
SERVO4_TRIM 1500.0
SERVO5_FUNCTION 37.0 # Motor 5
SERVO5_MAX 2000.0
SERVO5_MIN 1000.0
SERVO5_REVERSED 0
SERVO5_TRIM 1500.0
SERVO6_FUNCTION 38.0 # Motor 6
SERVO6_MAX 2000.0
SERVO6_MIN 1000.0
SERVO6_REVERSED 0
SERVO6_TRIM 1500.0

SERVO7_FUNCTION 94.0 # Script 1
SERVO7_MAX 2000.0
SERVO7_MIN 1000.0
SERVO7_REVERSED 0
SERVO7_TRIM 1500.0
SERVO8_FUNCTION 95.0 # Script 2
SERVO8_MAX 2000.0
SERVO8_MIN 1000.0
SERVO8_REVERSED 0
SERVO8_TRIM 1500.0
SERVO9_FUNCTION 96.0 # Script 3
SERVO9_MAX 2000.0
SERVO9_MIN 1000.0
SERVO9_REVERSED 0
SERVO9_TRIM 1500.0
SERVO10_FUNCTION 97.0 # Script 4
SERVO10_MAX 2000.0
SERVO10_MIN 1000.0
SERVO10_REVERSED 0
SERVO10_TRIM 1500.0
SERVO11_FUNCTION 98.0 # Script 5
SERVO11_MAX 2000.0
SERVO11_MIN 1000.0
SERVO11_REVERSED 0
SERVO11_TRIM 1500.0
SERVO12_FUNCTION 99.0 # Script 6
SERVO12_MAX 2000.0
SERVO12_MIN 1000.0
SERVO12_REVERSED 0
SERVO12_TRIM 1500.0
SERVO13_FUNCTION 100.0 # Script 7
SERVO13_MAX 2000.0
SERVO13_MIN 1000.0
SERVO13_REVERSED 0
SERVO13_TRIM 1500.0
SERVO14_FUNCTION 101.0 # Script 8
SERVO14_MAX 2000.0
SERVO14_MIN 1000.0
SERVO14_REVERSED 0
SERVO15_TRIM 1500.0
SERVO15_FUNCTION 102.0 # Script 9
SERVO15_MAX 2000.0
SERVO15_MIN 1000.0
SERVO15_REVERSED 0
SERVO15_TRIM 1500.0
SERVO16_FUNCTION 103.0 # Script 10
SERVO16_MAX 2000.0
SERVO16_MIN 1000.0
SERVO16_REVERSED 0
SERVO16_TRIM 1500.0
SERVO17_FUNCTION 104.0 # Script 11
SERVO17_MAX 2000.0
SERVO17_MIN 1000.0
SERVO17_REVERSED 0
SERVO17_TRIM 1500.0
SERVO18_FUNCTION 105.0 # Script 12
SERVO18_MAX 2000.0
SERVO18_MIN 1000.0
SERVO18_REVERSED 0
SERVO18_TRIM 1500.0
SERVO19_FUNCTION 106.0 # Script 13
SERVO19_MAX 2000.0
SERVO19_MIN 1000.0
SERVO19_REVERSED 0
SERVO19_TRIM 1500.0
SERVO20_FUNCTION 107.0 # Script 14
SERVO20_MAX 2000.0
SERVO20_MIN 1000.0
SERVO20_REVERSED 0
SERVO20_TRIM 1500.0
SERVO21_FUNCTION 108.0 # Script 15
SERVO21_MAX 2000.0
SERVO21_MIN 1000.0
SERVO21_REVERSED 0
SERVO21_TRIM 1500.0
SERVO22_FUNCTION 109.0 # Script 16
SERVO22_MAX 2000.0
SERVO22_MIN 1000.0
SERVO22_REVERSED 0
SERVO22_TRIM 1500.0
62 changes: 62 additions & 0 deletions Gazebo/docs/HexapodCopter.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
# Hexapod Copter

A Gazebo model for a hexapod copter (a hexapod rover with motors on each arm).

The original quadruped version of this frame is the result of Ashvath's project [GSoC 2020: Walking Robot Support For Ardupilot](https://discuss.ardupilot.org/t/gsoc-2020-walking-robot-support-for-ardupilot/57080).


![hexapod_copter_hover](https://user-images.githubusercontent.com/24916364/225340320-9aa31fe2-4602-4036-ba6b-491f72097c01.jpg)

The frame is fully articulated. Each of the 6 legs has 3 joints, however only 16 are actuated. The middle two 'hip' joints are fixed in this example. The motor ordering and orientation is the same as a standard hexa X frame, however in this case the FRAME_CLASS 17 (Dynamic Scripting Matrix) and the motor mixing is set in the Lua script.

The legs have two positions - folded when disarmed, and unfolded when armed.

If the scripting control of the legs is disabled they may be moved using gz topic commands:

```bash
# move the mid right femur joint down from its initial position of -0.6 rad to -0.4 rad
gz topic -t "/femur_mr_joint/cmd_pos" -m gz.msgs.Double -p "data: -0.4"
```

## Usage

Gazebo and the plugins should be installed as per the [ArduPilot Gazebo Plugin](https://github.com/ArduPilot/ardupilot_gazebo) instructions.

Update the `GZ_SIM_RESOURCE_PATH` to include these models:

```bash
export GZ_SIM_RESOURCE_PATH=$GZ_SIM_RESOURCE_PATH:\
$HOME/SITL_Models/Gazebo/models:\
$HOME/SITL_Models/Gazebo/worlds
```

#### Run Gazebo

```bash
$ gz sim -v4 -r hexapod_copter_runway.sdf
```

#### Run ArduPilot SITL

Copy the script $HOME/SITL_Models/Gazebo/scripts/hexapod_copter.lua to the SITL scripts directory,
then start SITL:

```bash
sim_vehicle.py -D -v ArduCopter -f hexa --model JSON --add-param-file=$HOME/SITL_Models/Gazebo/config/hexapod_copter.param --console
```

## Dimensions

- height: 53.23 mm
- coxa_axis_width: 101.42 mm
- coxa_axis_length: 177.03 mm
- coxa_axis_to_femur_axis: 30.0 mm
- femur_axis_to_tibia_axis: 76.17 mm
- tibia_axis_to_foot: 122.0 mm

## Credits

### Hexapod CAD model

- Author: [Tim Mills](https://grabcad.com/tim.mills-1)
- Model: [Hexapod Robot](https://grabcad.com/library/hexapod-robot-1)
160 changes: 160 additions & 0 deletions Gazebo/models/hexapod_copter/meshes/iris_prop_ccw.dae

Large diffs are not rendered by default.

160 changes: 160 additions & 0 deletions Gazebo/models/hexapod_copter/meshes/iris_prop_cw.dae

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions Gazebo/models/hexapod_copter/model.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0" ?>
<model>
<name>Hexapod Copter</name>
<version>1.0</version>
<sdf version="1.7">model.sdf</sdf>

<author>
<name>ashvath100</name>
</author>

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

<description>
A Gazebo model of a Hexapod Copter
</description>

</model>
Loading

0 comments on commit 6c2b1ed

Please sign in to comment.