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

Ackermann steering #128

Open
wants to merge 23 commits into
base: main
Choose a base branch
from
Open

Ackermann steering #128

wants to merge 23 commits into from

Conversation

andrew-bork
Copy link
Contributor

Implemented Ackermann Steering

This is only an change in the steering math for the drive system.
Anything unrelated to the steering was not changed.
Unnecessary files were deleted.

Does not include:

  • Feedback from motors
  • Fast Homing
  • Fast Steering

@andrew-bork andrew-bork linked an issue Mar 28, 2024 that may be closed by this pull request
Copy link
Contributor

@Viha123 Viha123 left a comment

Choose a reason for hiding this comment

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

You should fix and improve a lot of documentation before we carry on with this review.

return hal::success(); // Is there a hal::failure()?
}

for(size_t i = 0; i < m_legs.size(); i ++) {
Copy link
Contributor

Choose a reason for hiding this comment

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

a better way to iterate over a span could be a range base loop like so:
for (auto& value : values)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This can't be done using a for each, since I still need the iterator to index the other span.

#include "drive_configuration.hpp"
namespace sjsu::drive {
// Multiply this with the desired angle to get the correct angle to steer the motors.
constexpr float angle_correction_factor = 1.3625; // ???? WHY ARE THESE MOTORS SCALED????
Copy link
Contributor

Choose a reason for hiding this comment

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

remove the comment

#include "drive_configuration.hpp"
namespace sjsu::drive {
// Multiply this with the desired angle to get the correct angle to steer the motors.
constexpr float angle_correction_factor = 1.3625; // ???? WHY ARE THESE MOTORS SCALED????
Copy link
Contributor

Choose a reason for hiding this comment

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

Where does this number come from? What does it mean, improve documentation and possibly a better name

* @brief This structure defines a valid steering configuration for the drive system.
*
*/
struct drive_configuration {
Copy link
Contributor

Choose a reason for hiding this comment

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

why not use hal::units. And why are these in deg/sec instead of degrees


// These control how fast the system can react to changes in the target.
constexpr drive_configuration config_max_delta = {
.steering_angle = 40, // degrees/sec
Copy link
Contributor

Choose a reason for hiding this comment

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

use units native to what you are trying to compute. Ex: for rmd use rpms and degrees

*
* @param dt Change in time since last call
*/
void update(float dt);
Copy link
Contributor

Choose a reason for hiding this comment

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

better name for change in time (dt)

Comment on lines 32 to 45
drive_configuration get_current();
/**
* @brief Get the current target
*
* @return drive_configuration
*/
drive_configuration get_target();
/**
* @brief Get the difference calculated in the last update
* @note units/sec
*
* @return drive_configuration
*/
drive_configuration get_delta();
Copy link
Contributor

Choose a reason for hiding this comment

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

why do these return drive_configuration

Comment on lines 32 to 45
drive_configuration get_current();
/**
* @brief Get the current target
*
* @return drive_configuration
*/
drive_configuration get_target();
/**
* @brief Get the difference calculated in the last update
* @note units/sec
*
* @return drive_configuration
*/
drive_configuration get_delta();
Copy link
Contributor

Choose a reason for hiding this comment

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

update the documentation for the return type

#include "ackermann_steering.hpp"

namespace sjsu::drive {
/**
Copy link
Contributor

Choose a reason for hiding this comment

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

more detail on what settings is, elaborate on tri wheel configuration, and a brief line to explain purpose of serial.

*
* @note It is possible to have any steering angle or wheel heading, since the steering function is continous.
*
* @param p_config
Copy link
Contributor

Choose a reason for hiding this comment

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

add more explanations for every parameter in this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
Status: Backlog
Development

Successfully merging this pull request may close these issues.

Ackermann Steering
2 participants