ArduPilot / SITL_Models

Models of aircraft for SITL
82 stars 116 forks source link

Add Ignition model for quadruped rover #52

Closed srmainwaring closed 2 years ago

srmainwaring commented 2 years ago

This PR adds a model for a Quadruped rover for use with ArduPilot.

The controller for this model is the result of Ashvath's project GSoC 2020: Walking Robot Support For Ardupilot.

The original version of the model is here: https://github.com/srmainwaring/ardupilot_gazebo_models/tree/master/models. It has been upgraded for use with Ignition.

quadruped_stand_1

Usage

Ignition and the plugins should be installed as per the ardupilot_gazebo wiki instructions.

Update the IGN_GAZEBO_RESOURCE_PATH to include these models:

export IGN_GAZEBO_RESOURCE_PATH=$IGN_GAZEBO_RESOURCE_PATH:\
$HOME/SITL_Models/Ignition/models:\
$HOME/SITL_Models/Ignition/worlds

Run Gazebo

$ ign gazebo -v4 -r quadruped_runway.sdf

Run ArduPilot SITL

This model requires a custom controller which is implemented in the ArduPilot Lua script quadruped.lua. There is a copy of this script in SITL_Models/Ignition/config/scripts for convenience.

Set up the rover and SITL following the ArduPilot wiki instructions for Walking Robots.

Copy the Lua script quadruped.lua to the scripts folder for SITL (this is usually $ARDUPILOT_HOME/scripts).

The parameters set SCR_ENABLE = 1 and you will need to reboot the autopilot after the initial start to retrieve the full set of scripting parameters. You may also need to increase the SCR_HEAP_SIZE.

$ sim_vehicle.py -v Rover -f JSON --add-param-file=$HOME/SITL_Models/Ignition/config/quadruped.param --console --map

Controls

Manual control in MAVLink:

# stand up from rest position
MANUAL> arm throttle
# rotate counter clockwise
MANUAL> rc 1 1000
# rotate clockwise
MANUAL> rc 1 1000
# lean right
MANUAL> rc 2 1000
# lean left
MANUAL> rc 2 2000
# walk backward
MANUAL> rc 3 1000
# walk forward
MANUAL> rc 3 2000
# lean forward
MANUAL> rc 4 1000
# lean backwards
MANUAL> rc 4 2000
# return to rest position
MANUAL> disarm

Credits

Hexapod CAD model

Dimensions