Ja-r-ed / OFFSEASON-LEARNING-FRC-24

Other
0 stars 0 forks source link

Code review 17/7/24 15:30 #1

Open Gastatouillle opened 1 month ago

Gastatouillle commented 1 month ago

after build the errors and solutions / suggestions are listed below.

1: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\include/RobotContainer.h:8:10: fatal error: frc2/command/CommandXboxController.h: No such file or directory 8 | #include <frc2/command/CommandXboxController.h>

Solution: Include file path is frc2/command/button/CommandXboxController.h

2: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\include/Subsystems/SubFeeder.h:10:10: fatal error: Subsystems/Constants.h: No such file or directory 10 | #include "Subsystems/Constants.h"

Solution: Constants.h does not sit within a folder, include will be just Constants.h

3: Not going to paste error codes but anything related to ICSparkMax or ICSparkEncoder is likely causes by revlib version 2024.2.4, as compared to the version used on Molly/Gausse which is 2024.2.0. This is a possible fix and the errors may be caused by changes in the versions.

Version changes need to be made on lines 4, 15, 22, 40 and 58

Gastatouillle commented 1 month ago

4: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\cpp\Subsystems\SubFeeder.cpp:16:18: error: no declaration matches 'frc2::CommandPtr SubFeeder::Feed()' 16 | frc2::CommandPtr SubFeeder::Feed(){

Solution: SubFeeder not included in RobotContainer.cpp or RobotContainer.h

5: No error code but line 19 RobotContainer.h is going to break

Solution, move the semicolon outside the brackets, change the brackets to {} instead of ()

Gastatouillle commented 1 month ago

6: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\include/Subsystems/SubShooter.h:37:81: error: expected ';' at end of member declaration
37 | frc::sim::FlywheelSim _flywheelSim{frc::DCMotor::NEO(), GEARING, FLYWHEEL_MASS} | ^
| ;

Solution: Add a semicolon

7: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\include/Subsystems/SubShooter.h:37:59: error: 'GEARING' was not declared in this scope
37
frc::sim::FlywheelSim _flywheelSim{frc::DCMotor::NEO(), GEARING, FLYWHEEL_MASS}

Solution: Gearing is capitalized differently on line 35 where it is declared

8: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\include/Subsystems/SubFeeder.h:25:90: warning: 'MotorType' is deprecated: Use CANSparkLowLevel::MotorType [-Wdeprecated-declarations] 25 | rev::CANSparkMax _feedermotor{canid::feedermotor, rev::CANSparkMaxLowLevel::MotorType::kBrushless};

Solution: rev::CANSparkMaxLowLevel::MotorType::kBrushless should be rev::CANSparkMax::MotorType::kBrushless

Gastatouillle commented 1 month ago

9: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\cpp\Subsystems\SubShooter.cpp:10:10: error: 'frc::smartdashboard' has not been declared 10 | frc::smartdashboard::PutData{"Shooter Motor", (wpi::Sendable*)&_shootermotor};

Solution: Replace {} brackets with () brackets

10: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\cpp\Subsystems\SubShooter.cpp:30:6: error: 'SUbShooter' has not been declared 30 | void SUbShooter::SimulationPeriodic() {

Solution: Change SUbShooter to SubShooter

Gastatouillle commented 1 month ago

11: C:\src\OFFSEASON-LEARNING-FRC-24\src\main\cpp\Subsystems\SubFeeder.cpp:16:18: error: no declaration matches 'frc2::CommandPtr SubFeeder::Feed()' 16 | frc2::CommandPtr SubFeeder::Feed(){ | ^~~~~

Solution: Declare Feed in the header. "CommandPtr Feed();"

Gastatouillle commented 1 month ago

12: Utilities is capitalized for the cpp folder and uncapitalized for the header folder

Solution: Change both to be lowercase, if you go uppercase your includes will break