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

New features for the ackermann rover module #23310

Merged
merged 2 commits into from
Jul 10, 2024

Conversation

chfriedrich98
Copy link
Contributor

@chfriedrich98 chfriedrich98 commented Jun 21, 2024

Solved Problem

This PR adds new features and a bugfix on a logging issue to the ackerman rover module from #23024:

Solution

  1. Adds support for the return to launch (RTL) functionality
  2. Adds a slew rate for the actuators which can be set with:
Parameter Description Unit
RA_MAX_ACCEL Maximum acceleration for the rover $m/s^2$
RA_MAX_STR_RATE Maximum steering rate for the rover $rad/s$

The slew rate for the acceleration is not based on acceleration measurements but rather on an assumed linear relation between the throttle and maximum rover speed. Therefor the maximum rover speed RA_MAX_SPEED needs to be set for this to work.
The slew rate for the steering rate is also based on a assumed linear relation between steering input and steering angle. Therefor the maximum steering angle RA_MAX_STR_ANG needs to be set for this to work.

  1. Adds a new ackermann rover specific message to log data for tuning:
    The new message is called RoverAckermannStatus.msg and includes the following:
Variable Description Unit
throttle_setpoint [-1, 1] Normalized throttle setpoint -
steering_setpoint [-1, 1] Normalized steering setpoint -
actual_speed Rover ground speed $m/s$

The setpoints can be used to tune the slew rates by comparing them to the actual actuator outputs.
Note: actual_speed was moved from the already existing RoverAckermannGuidanceStatus.msg to this one s.t. it is logged both in mission and manual mode.

  1. Improved the cornering slow down effect during mission mode:
    Now uses math::trajectory::computeMaxSpeedFromDistance to give speed setpoints s.t. the rover slows down to arrive at the waypoint with the cornering speed.
    This requires to set a new parameter called RA_MAX_JERK.

  2. Logging bugfix:
    Fixed a bug in the module that could cause the logger to not work correctly, leading to empty log files.

Changelog Entry

For release notes:

Feature: New features and improvements for the rover ackermann module.

Alternatives

Open to any suggestions.

Test coverage

Context

Related links, screenshot before/after, video

@chfriedrich98 chfriedrich98 self-assigned this Jun 21, 2024
@chfriedrich98 chfriedrich98 added the Rover 🚙 Rovers and other UGV label Jun 21, 2024
@sfuhrer
Copy link
Contributor

sfuhrer commented Jun 24, 2024

src/modules/logger/logged_topics.cpp Outdated Show resolved Hide resolved
msg/RoverAckermannStatus.msg Show resolved Hide resolved
msg/RoverAckermannStatus.msg Show resolved Hide resolved
src/modules/rover_ackermann/RoverAckermann.cpp Outdated Show resolved Hide resolved
src/modules/rover_ackermann/RoverAckermann.cpp Outdated Show resolved Hide resolved
src/modules/rover_ackermann/module.yaml Show resolved Hide resolved
src/modules/rover_ackermann/module.yaml Outdated Show resolved Hide resolved
src/modules/rover_ackermann/module.yaml Outdated Show resolved Hide resolved
@DronecodeBot
Copy link

This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there:

https://discuss.px4.io/t/rover-ackermann-oscillates-on-a-straight-track/37797/12

@chfriedrich98
Copy link
Contributor Author

chfriedrich98 commented Jun 28, 2024

rebased on main and squashed

@chfriedrich98 chfriedrich98 force-pushed the rover_ackermann_new_features branch 2 times, most recently from c82cda3 to 5aa314d Compare July 1, 2024 08:23
@chfriedrich98
Copy link
Contributor Author

chfriedrich98 commented Jul 1, 2024

rebased on main and removed SITL airframe

@chfriedrich98 chfriedrich98 marked this pull request as draft July 3, 2024 07:26
@sfuhrer sfuhrer marked this pull request as ready for review July 3, 2024 08:16
sfuhrer
sfuhrer previously approved these changes Jul 3, 2024
Copy link
Contributor

@sfuhrer sfuhrer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good iteration!

@sfuhrer sfuhrer marked this pull request as draft July 3, 2024 09:02
@chfriedrich98 chfriedrich98 marked this pull request as ready for review July 8, 2024 14:42
sfuhrer
sfuhrer previously approved these changes Jul 9, 2024
added return mode support, slew rates for actuators, new ackermann specific message, improved cornering slow down effect and fixed logging issue.
@sfuhrer sfuhrer merged commit 3fe609f into PX4:main Jul 10, 2024
87 of 90 checks passed
@chfriedrich98 chfriedrich98 deleted the rover_ackermann_new_features branch August 29, 2024 13:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Rover 🚙 Rovers and other UGV
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants