forked from PX4/PX4-Autopilot
-
Notifications
You must be signed in to change notification settings - Fork 0
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
1 parent
8f6ce4e
commit 3bebd44
Showing
27 changed files
with
1,528 additions
and
2 deletions.
There are no files selected for viewing
61 changes: 61 additions & 0 deletions
61
ROMFS/px4fmu_common/init.d-posix/airframes/4015_gz_r1_rover_mecanum
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,61 @@ | ||
#!/bin/sh | ||
# @name Aion Robotics R1 Rover | ||
# @type Rover | ||
# @class Rover | ||
|
||
. ${R}etc/init.d/rc.rover_mecanum_defaults | ||
|
||
PX4_SIMULATOR=${PX4_SIMULATOR:=gz} | ||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=rover} | ||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=r1_rover_mecanum} | ||
|
||
param set-default SIM_GZ_EN 1 # Gazebo bridge | ||
|
||
# Rover parameters | ||
param set-default RM_WHEEL_TRACK 0.3 | ||
param set-default RM_MAN_YAW_SCALE 0.1 | ||
param set-default RM_YAW_RATE_I 0 | ||
param set-default RM_YAW_RATE_P 0.1 | ||
param set-default RM_MAX_ACCEL 6 | ||
param set-default RM_MAX_JERK 30 | ||
param set-default RM_MAX_SPEED 7 | ||
param set-default RM_YAW_P 3 | ||
param set-default RM_YAW_I 0.1 | ||
param set-default RM_MAX_YAW_RATE 180 | ||
param set-default RM_MISS_SPD_DEF 7 | ||
param set-default RM_TRANS_DRV_TRN 0.349066 | ||
param set-default RM_TRANS_TRN_DRV 0.174533 | ||
|
||
# Pure pursuit parameters | ||
param set-default PP_LOOKAHD_MAX 10 | ||
param set-default PP_LOOKAHD_MIN 1 | ||
param set-default PP_LOOKAHD_GAIN 0.5 | ||
|
||
# Simulated sensors | ||
param set-default SENS_EN_GPSSIM 1 | ||
param set-default SENS_EN_BAROSIM 0 | ||
param set-default SENS_EN_MAGSIM 1 | ||
param set-default SENS_EN_ARSPDSIM 0 | ||
|
||
# Actuator mapping | ||
param set-default SIM_GZ_WH_FUNC1 102 # right wheel front | ||
param set-default SIM_GZ_WH_MIN1 0 | ||
param set-default SIM_GZ_WH_MAX1 200 | ||
param set-default SIM_GZ_WH_DIS1 100 | ||
|
||
param set-default SIM_GZ_WH_FUNC2 101 # left wheel front | ||
param set-default SIM_GZ_WH_MIN2 0 | ||
param set-default SIM_GZ_WH_MAX2 200 | ||
param set-default SIM_GZ_WH_DIS2 100 | ||
|
||
param set-default SIM_GZ_WH_FUNC3 104 # right wheel back | ||
param set-default SIM_GZ_WH_MIN3 0 | ||
param set-default SIM_GZ_WH_MAX3 200 | ||
param set-default SIM_GZ_WH_DIS3 100 | ||
|
||
param set-default SIM_GZ_WH_FUNC4 103 # left wheel back | ||
param set-default SIM_GZ_WH_MIN4 0 | ||
param set-default SIM_GZ_WH_MAX4 200 | ||
param set-default SIM_GZ_WH_DIS4 100 | ||
|
||
param set-default SIM_GZ_WH_REV 10 |
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
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
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,8 @@ | ||
#!/bin/sh | ||
# Standard apps for a mecanum drive rover. | ||
|
||
# Start rover mecanum drive controller. | ||
rover_mecanum start | ||
|
||
# Start Land Detector. | ||
land_detector start rover |
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,11 @@ | ||
#!/bin/sh | ||
# Mecanum rover parameters. | ||
|
||
set VEHICLE_TYPE rover_mecanum | ||
param set-default MAV_TYPE 10 # MAV_TYPE_GROUND_ROVER | ||
param set-default CA_AIRFRAME 13 # Rover (Mecanum) | ||
param set-default CA_R_REV 15 # Right and left motors reversible | ||
param set-default EKF2_MAG_TYPE 1 # make sure magnetometer is fused even when not flying | ||
param set-default NAV_ACC_RAD 0.5 # Waypoint acceptance radius | ||
param set-default EKF2_GBIAS_INIT 0.01 | ||
param set-default EKF2_ANGERR_INIT 0.01 |
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
Submodule gz
updated
10 files
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
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
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,6 @@ | ||
uint64 timestamp # time since system start (microseconds) | ||
|
||
float32 lookahead_distance # [m] Lookahead distance of pure the pursuit controller | ||
float32 heading_error_deg # [deg] Heading error of the pure pursuit controller | ||
|
||
# TOPICS rover_mecanum_guidance_status |
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,11 @@ | ||
uint64 timestamp # time since system start (microseconds) | ||
|
||
float32 forward_speed_setpoint # [m/s] Desired forward speed for the rover | ||
float32 forward_speed_setpoint_normalized # [-1, 1] Desired normalized forward speed for the rover | ||
float32 lateral_speed_setpoint # [m/s] Desired lateral speed for the rover | ||
float32 lateral_speed_setpoint_normalized # [-1, 1] Desired normalized lateral speed for the rover | ||
float32 yaw_rate_setpoint # [rad/s] Desired yaw rate for the rover | ||
float32 yaw_rate_setpoint_normalized # [-1, 1] Desired normalized yaw rate for the rover | ||
float32 yaw_setpoint # [rad] Desired yaw (heading) for the rover | ||
|
||
# TOPICS rover_mecanum_setpoint |
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,13 @@ | ||
uint64 timestamp # time since system start (microseconds) | ||
|
||
float32 actual_forward_speed # [m/s] Actual forward speed of the rover | ||
float32 actual_lateral_speed # [m/s] Actual lateral speed of the rover | ||
float32 desired_yaw_rate_deg_s # [deg/s] Desired yaw rate | ||
float32 actual_yaw_rate_deg_s # [deg/s] Actual yaw rate of the rover | ||
float32 actual_yaw_deg # [deg] Actual yaw of the rover | ||
float32 pid_yaw_rate_integral # Integral of the PID for the closed loop yaw rate controller | ||
float32 pid_yaw_integral # Integral of the PID for the closed loop yaw controller | ||
float32 pid_forward_throttle_integral # Integral of the PID for the closed loop forward speed controller | ||
float32 pid_lateral_throttle_integral # Integral of the PID for the closed loop lateral speed controller | ||
|
||
# TOPICS rover_mecanum_status |
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
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
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
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,50 @@ | ||
############################################################################ | ||
# | ||
# Copyright (c) 2024 PX4 Development Team. All rights reserved. | ||
# | ||
# Redistribution and use in source and binary forms, with or without | ||
# modification, are permitted provided that the following conditions | ||
# are met: | ||
# | ||
# 1. Redistributions of source code must retain the above copyright | ||
# notice, this list of conditions and the following disclaimer. | ||
# 2. Redistributions in binary form must reproduce the above copyright | ||
# notice, this list of conditions and the following disclaimer in | ||
# the documentation and/or other materials provided with the | ||
# distribution. | ||
# 3. Neither the name PX4 nor the names of its contributors may be | ||
# used to endorse or promote products derived from this software | ||
# without specific prior written permission. | ||
# | ||
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS | ||
# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS | ||
# FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE | ||
# COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, | ||
# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, | ||
# BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS | ||
# OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED | ||
# AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT | ||
# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN | ||
# ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
# POSSIBILITY OF SUCH DAMAGE. | ||
# | ||
############################################################################ | ||
|
||
add_subdirectory(RoverMecanumGuidance) | ||
add_subdirectory(RoverMecanumControl) | ||
|
||
px4_add_module( | ||
MODULE modules__rover_mecanum | ||
MAIN rover_mecanum | ||
SRCS | ||
RoverMecanum.cpp | ||
RoverMecanum.hpp | ||
DEPENDS | ||
RoverMecanumGuidance | ||
RoverMecanumControl | ||
px4_work_queue | ||
pure_pursuit | ||
MODULE_CONFIG | ||
module.yaml | ||
) |
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,6 @@ | ||
menuconfig MODULES_ROVER_MECANUM | ||
bool "rover_mecanum" | ||
default n | ||
depends on MODULES_CONTROL_ALLOCATOR | ||
---help--- | ||
Enable support for control of mecanum rovers |
Oops, something went wrong.