Skip to content

Conversation

@NoamRosenberg08
Copy link
Member

No description provided.

greenblitz4590 and others added 30 commits November 14, 2022 17:39
greenblitz4590 and others added 21 commits December 30, 2022 14:21
…e module classes to KazaSwerve and SdsSwerve Classes in RobotMap
@NoamRosenberg08 NoamRosenberg08 changed the title merge dev -> path planner fix conflicts and then path-planner -> dev pull request merge path-planner to dev Jan 6, 2023
*
*/
public static double modulo(double x, double y) {
public static double modulo(double x, double y) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know it is already on dev, but I didn't get a chance to write it before on a CR.
GBMath.modulo() is not a clear name, if I will ask someone who didn't hear about it (maybe a team member in a few years), what does GBMath.modulo() do, he won't be able to tell.
The bare minimum is to have clear docs about it, because, what is the "correct modulo result"?
The extra step is to find a better name. I will say, I don't have one right now, but at least improve the docs.
(Or you can simply not use this function, there are other solutions)


private Battery battery;

private static final int LEN_OF_AVG = 10;
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe something like, AVG_FILTER_SIZE?

import edu.greenblitz.pegasus.RobotMap;
import edu.wpi.first.wpilibj.RobotController;

public class Battery extends GBSubsystem {
Copy link
Contributor

Choose a reason for hiding this comment

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

Tell me if I missing something, but why is it a subsystem? The only functions it has only use static data.

(another nitpick: why are the changes to the battery on the path-planner CR?)

Copy link
Member Author

@NoamRosenberg08 NoamRosenberg08 Jan 7, 2023

Choose a reason for hiding this comment

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

it's a subsystem because a command is running on it, and about the nitpick, it's because i made the merge from dev -> path-planner to be safer but apparently i needed to do this the other way

Copy link
Contributor

Choose a reason for hiding this comment

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

A command doesn't have to run on a subsystem.

And yes, before merging to dev, you need to merge dev to your branch


public class Battery extends GBSubsystem {

private double currentVoltage;
Copy link
Contributor

Choose a reason for hiding this comment

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

even if I am missing something, what can access this variable?

Copy link
Member Author

Choose a reason for hiding this comment

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

we don't need it. now it's gone

SmartDashboard.putNumber("bl abs encoder", blAbsEncoder);
SmartDashboard.putNumber("fr abs encoder", frAbsEncoder);
SmartDashboard.putNumber("fl abs encoder", flAbsEncoder);
// SmartDashboard.putNumber("error", Math.toDegrees(falconEncoder - brAbsEncoder) %);
Copy link
Contributor

Choose a reason for hiding this comment

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

remove this line

Copy link
Contributor

Choose a reason for hiding this comment

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

only the comment line

import edu.greenblitz.pegasus.utils.PIDObject;
import edu.wpi.first.math.kinematics.SwerveModuleState;

public class DecoyModule implements SwerveModule{
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the purpose of this class?

Copy link
Contributor

Choose a reason for hiding this comment

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

To be able to run some of swerve chassis functions with less then 4 modules

@Override
public void rotateToAngle(double angle) {

double diff = GBMath.modulo(angle - getModuleAngle(), 2 * Math.PI);
Copy link
Contributor

Choose a reason for hiding this comment

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

Talking about lines 79-81:
I must say, even with the knowledge of what the GBMath.modulo function does, the flow here is unclear.
I think that the flow here should be split better using if and maybe using more variables to define calculations that are part of the big calculation.

Copy link
Contributor

Choose a reason for hiding this comment

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

Can also be fixed with better doc

*/
@Override
public void rotateToAngle(double angleInRads) {
double diff = GBMath.modulo(angleInRads - getModuleAngle(), 2 * Math.PI);
Copy link
Contributor

Choose a reason for hiding this comment

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

Same here like the KazaSwerve

Copy link
Contributor

Choose a reason for hiding this comment

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

Can also be fixed with better doc

pose estimator and rotate to angle by pose estimator
@NoamRosenberg08 NoamRosenberg08 changed the title pull request merge path-planner to dev changes to do to dev Jan 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants