-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Rover ackermann module #23024
Open
chfriedrich98
wants to merge
27
commits into
PX4:main
Choose a base branch
from
chfriedrich98:rover_ackermann
base: main
Could not load branches
Branch not found: {{ refName }}
Could not load tags
Nothing to show
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,373
−1
Open
Rover ackermann module #23024
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
90ef7d8
added ackermann airframe
chfriedrich98 d62e8f5
added ackermann module
chfriedrich98 1b3126a
Apply suggestions from code review
chfriedrich98 5b12c01
Implemented suggestions from code review
chfriedrich98 150d69a
fixed build issue
chfriedrich98 9939834
Apply suggestions from code review
chfriedrich98 1615c2a
optimize allocations for uORB subscriptions
chfriedrich98 c917c2e
fix airframes
chfriedrich98 f546853
Apply suggestions from code review
chfriedrich98 fa170f1
fixed home position bug
chfriedrich98 651a1d0
rename module to rover_ackermann
chfriedrich98 1d5d955
rename constants in guidance state machine
chfriedrich98 63fd641
Apply suggestions from code review
chfriedrich98 3144777
added code suggestions
chfriedrich98 a9938dc
restructure uORB topics
chfriedrich98 42b9610
cleanup motor commands
chfriedrich98 690c859
restructure guidance and enable ackermann in rover builds
chfriedrich98 d3c8aa1
added feed-forward term to speed controller
chfriedrich98 2b0d78f
add crosstrack error to log
chfriedrich98 abffc92
fix naming convention
chfriedrich98 8f7b0b0
fixed typo
chfriedrich98 01696d3
Clarify setpoint comments
chfriedrich98 e58a96d
implemented code suggestions
chfriedrich98 4f6f5c9
Apply suggestions from code review
chfriedrich98 ddd8b7c
cleanup airframes
chfriedrich98 25871fc
added code suggestions
chfriedrich98 d1e9f61
fix setpoint naming
chfriedrich98 File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
48 changes: 48 additions & 0 deletions
48
ROMFS/px4fmu_common/init.d-posix/airframes/4012_gz_rover_ackermann
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,48 @@ | ||
#!/bin/sh | ||
# @name Rover Ackermann | ||
# @type Rover | ||
# @class Rover | ||
|
||
. ${R}etc/init.d/rc.rover_ackermann_defaults | ||
|
||
PX4_SIMULATOR=${PX4_SIMULATOR:=gz} | ||
PX4_GZ_WORLD=${PX4_GZ_WORLD:=default} | ||
PX4_SIM_MODEL=${PX4_SIM_MODEL:=rover_ackermann} | ||
|
||
param set-default SIM_GZ_EN 1 # Gazebo bridge | ||
|
||
# Rover parameters | ||
param set RA_MAX_SPEED 3.6 | ||
param set RA_WHEEL_BASE 0.321 | ||
|
||
# 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 | ||
|
||
# Wheels | ||
param set-default SIM_GZ_WH_FUNC1 101 | ||
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 | ||
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 101 | ||
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 101 | ||
param set-default SIM_GZ_WH_MIN4 0 | ||
param set-default SIM_GZ_WH_MAX4 200 | ||
param set-default SIM_GZ_WH_DIS4 100 | ||
|
||
# Steering | ||
param set-default SIM_GZ_SV_FUNC1 201 | ||
param set-default SIM_GZ_SV_FUNC2 201 | ||
param set-default SIM_GZ_SV_REV 3 |
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
12 changes: 12 additions & 0 deletions
12
ROMFS/px4fmu_common/init.d/airframes/50010_ackermann_rover_generic
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,12 @@ | ||
#!/bin/sh | ||
# | ||
# @name Generic ackermann rover | ||
# | ||
# @type Rover | ||
# @class Rover | ||
# | ||
# @board px4_fmu-v2 exclude | ||
# @board bitcraze_crazyflie exclude | ||
# | ||
|
||
. ${R}etc/init.d/rc.rover_ackermann_defaults |
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,11 @@ | ||
#!/bin/sh | ||
# Standard apps for a ackermann drive rover. | ||
|
||
# Start the attitude and position estimator. | ||
ekf2 start & | ||
|
||
# Start rover ackermann drive controller. | ||
rover_ackermann 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,13 @@ | ||
#!/bin/sh | ||
# Ackermann rover parameters. | ||
|
||
set VEHICLE_TYPE rover_ackermann | ||
param set-default MAV_TYPE 10 # MAV_TYPE_GROUND_ROVER | ||
param set-default CA_AIRFRAME 5 # Rover (Ackermann) | ||
param set-default CA_R_REV 1 # Motor is assumed to be reversible | ||
param set-default EKF2_MAG_TYPE 1 # make sure magnetometer is fused even when not flying | ||
param set-default EKF2_GBIAS_INIT 0.01 | ||
param set-default EKF2_ANGERR_INIT 0.01 | ||
param set-default NAV_ACC_RAD 0.5 # Waypoint acceptance radius | ||
param set-default NAV_RCL_ACT 6 # Disarm on manual control loss | ||
param set-default COM_FAIL_ACT_T 1 # Delay before failsafe after rc loss |
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
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
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,10 @@ | ||
uint64 timestamp # time since system start (microseconds) | ||
|
||
float32 actual_speed # [m/s] Rover ground speed | ||
float32 desired_speed # [m/s] Rover desired ground speed | ||
float32 lookahead_distance # [m] Lookahead distance of pure pursuit controller | ||
float32 heading_error # [deg] Heading error of pure pursuit controller | ||
float32 speed_pid_integrator # Integrator of PID controller for the rover speed during mission | ||
float32 crosstrack_error # [m] Shortest distance from the vehicle to the path | ||
|
||
# TOPICS rover_ackermann_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,6 @@ | ||
uint64 timestamp # time since system start (microseconds) | ||
|
||
float32 throttle # [-1, 1] Normalized throttle setpoint | ||
float32 steering # [-1, 1] Normalized steering angle setpoint (positive: right, negative: left) | ||
|
||
# TOPICS rover_ackermann_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
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,49 @@ | ||
############################################################################ | ||
# | ||
# 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(RoverAckermannControl) | ||
add_subdirectory(RoverAckermannGuidance) | ||
|
||
px4_add_module( | ||
MODULE modules__rover_ackermann | ||
MAIN rover_ackermann | ||
SRCS | ||
RoverAckermann.cpp | ||
RoverAckermann.hpp | ||
DEPENDS | ||
RoverAckermannControl | ||
RoverAckermannGuidance | ||
px4_work_queue | ||
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_ACKERMANN | ||
bool "rover_ackermann" | ||
default n | ||
depends on MODULES_CONTROL_ALLOCATOR | ||
---help--- | ||
Enable support for control of ackermann drive rovers |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the integrator unit in the output e.g. unit motor command? It would be useful to at least mention the range.