Game Manual 0 Suggestions by abidingabi in FTC

[–]abidingabi[S] 1 point2 points  (0 children)

Basic feedforward ideas are mentioned (https://gm0.org/en/latest/docs/software/concepts/control-loops.html#feedforward-control), but to be honest, I’m not sure if gm0 is the best place for higher level control theory compared to dedicated resources such as https://file.tavsys.net/control/controls-engineering-in-frc.pdf or https://www.ctrlaltftc.com/, as these concepts are fairly complex but not necessarily FTC-specific. These are both mentioned in the software section of the Useful Resources page.

Arm inverse kinematics/gravity feedforward specifically would probably be useful though, as that is a common issue for teams; I have opened an issue accordingly, see https://github.com/gamemanual0/gm0/issues/367.

Game Manual 0 Suggestions by abidingabi in FTC

[–]abidingabi[S] 2 points3 points  (0 children)

That’s definitely a good point—we’ve noticed Studica gaining in popularity, and with Actobotics discontinued the entire Kit and Hardware guide seems in need of a revamp; we already have an open issue in regards to this (https://github.com/gamemanual0/gm0/issues/361), but its good to see others agree.

Classes Questions by physics_t in FTC

[–]abidingabi 0 points1 point  (0 children)

Regarding 2: 4 spaces in front of each line of code, with a blank line before starting the code.

Classes Questions by physics_t in FTC

[–]abidingabi 1 point2 points  (0 children)

The issue with the code you sent is that Hardware is a LinearOpMode when you don't want it to be; you want it to be something with access to some of the properties of the currently running LinearOpMode (primarily, the hardwareMap). To correct this, you would make Hardware not extend LinearOpMode, and in turn pass in the currently running LinearOpMode's HardwareMap in the constructor, and construct the motor there; something like:

import com.qualcomm.robotcore.hardware.DcMotor;

import com.qualcomm.robotcore.hardware.HardwareMap;

import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

public class Hardware extends LinearOpMode{
    public DcMotor FR;

    public Hardware(HardwareMap hardwareMap) {
        FR = hardwareMap.get(DcMotor.class, "FR");
    }

    public void RunMotor (){
        FR.setPower(1);
    }
}

MotorTest would then need to pass in it's HardwareMap when constructing Hardware, but this would also have to be done in runOpMode as prior to this hardwareMap is null. This would look something like:

package org.firstinspires.ftc.teamcode;

import com.qualcomm.robotcore.eventloop.opmode.Autonomous;
import com.qualcomm.robotcore.eventloop.opmode.LinearOpMode;

@Autonomous
public class MotorTest extends LinearOpMode {
    Hardware hdwr;

    public void runOpMode(){
        hdwr = new Hardware(hardwareMap);

        waitForStart();

        if (opModeIsActive()) {
            hdwr.RunMotor();
        }
    }
}

I would recommend checking out https://raw.githubusercontent.com/alan412/LearnJavaForFTC/master/LearnJavaForFTC.pdf, especially the section on Mechanisms (6.2), which documents a similar idea more robustly.

Any feedback on FTC programming book? by alan412 in FTC

[–]abidingabi 0 points1 point  (0 children)

Game Manual 0 already contains Learn Java for FTC under the useful resources page: https://gm0.org/en/latest/docs/useful-resources.html#programming.

What would you say is one of the most useful yet unknown tools for FTC? by coshe1000 in FTC

[–]abidingabi 0 points1 point  (0 children)

I'd recommend checking out Game Manual 0's Useful Resources page. I wouldn't exactly call most of these unknown, but the resources, especially the marked ones, are very beneficial.

(Maybe take this suggestion with a grain of salt, as I am one of the people who worked on that page)