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

Error building with RR files #96

Closed
graceliu opened this issue Mar 4, 2023 · 3 comments
Closed

Error building with RR files #96

graceliu opened this issue Mar 4, 2023 · 3 comments

Comments

@graceliu
Copy link

graceliu commented Mar 4, 2023

Hi,
I imported RoadRunner files and I am getting build errors. I was hoping virtual robot is able to support RoadRunner. Let me know ideas on how to resolve the following issues?

For example, I would like to use the SampleMecanumDrive, and I get the following errors:

/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java:27:39
java: cannot find symbol
symbol: class VoltageSensor
location: package com.qualcomm.robotcore.hardware
/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/drive/SampleMecanumDrive.java:76:13
java: cannot find symbol
symbol: class VoltageSensor
location: class org.firstinspires.ftc.teamcode.drive.SampleMecanumDrive

For example, I would like to use trajectory sequence, and I am getting the following errors:

/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/trajectorysequence/TrajectorySequenceRunnerCancelable.java:3:27
java: cannot find symbol
symbol: class Nullable
location: package androidx.annotation
/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/trajectorysequence/TrajectorySequenceRunnerCancelable.java:6:41
java: package com.acmerobotics.dashboard.canvas does not exist
/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/trajectorysequence/TrajectorySequenceRunnerCancelable.java:203:13
java: cannot find symbol
symbol: class Canvas
location: class org.firstinspires.ftc.teamcode.trajectorysequence.TrajectorySequenceRunnerCancelable
/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/trajectorysequence/TrajectorySequenceRunnerCancelable.java:79:13
java: cannot find symbol
symbol: class Nullable
location: class org.firstinspires.ftc.teamcode.trajectorysequence.TrajectorySequenceRunnerCancelable
/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/trajectorysequence/TrajectorySequenceRunnerCancelable.java:69:18
java: cannot find symbol
symbol: method setTelemetryTransmissionInterval(int)
location: variable dashboard of type com.acmerobotics.dashboard.FtcDashboard
/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/trajectorysequence/TrajectorySequenceRunnerCancelable.java:85:9
java: cannot find symbol
symbol: class Canvas
location: class org.firstinspires.ftc.teamcode.trajectorysequence.TrajectorySequenceRunnerCancelable
/Users/graceliu/Documents/robotics/virtual_robot/TeamCode/src/org/firstinspires/ftc/teamcode/trajectorysequence/TrajectorySequenceRunnerCancelable.java:85:37
java: cannot find symbol
symbol: method fieldOverlay()
location: variable packet of type com.acmerobotics.dashboard.telemetry.TelemetryPacket

@jkenney2
Copy link
Contributor

jkenney2 commented Mar 6, 2023

Are you trying to use the road-runner-quick-start code?

If so, the issue is that the quickstart code makes use of both the roadrunner core, and additional code from acmerobotics (and some from FTC, google, etc) that is separate from the roadrunner core, and is not supported in virtual_robot.

The solution will be: 1) add some code to virtual_robot to minimize the incompatibility; then, 2) User removes a few non-critical things from road-runner-quickstart to allow virtual_robot to build.

Work on item (1) is ongoing. Will include instructions for item (2) when this issue is closed.

@jkenney2
Copy link
Contributor

jkenney2 commented Mar 7, 2023

EDITED 3/7/2023 (again)

Changes have been made to better accommodate the use of road-runner-quickstart. However, several changes to the quickstart files will still be necessary:

From the util package, delete: Logfiles.java, LoggingUtil.java, LynxModuleUtil.java, and AssetsTrajectoryManager.java.

From the drive.opmode package, delete: AutomaticFeedForwardTuner.java

In trajectorysequence.TrajectorySequenceRunner.java, comment out line 26:
//import org.firstinspires.ftc.teamcode.util.LogFiles;

In trajectorysequence.TrajectorySequenceRunner.java, comment out lines 212-217:
// if (targetPose != null) {
// LogFiles.record(
// targetPose, poseEstimate, voltage,
// lastDriveEncPositions, lastDriveEncVels, lastTrackingEncPositions, lastTrackingEncVels
// );
// }

In SampleMecanumDrive.java, comment out line 34:
//import org.firstinspires.ftc.teamcode.util.LynxModuleUtil;

In SampleMecanumDrive.java, comment out line 87:
// LynxModuleUtil.ensureMinimumFirmwareVersion(hardwareMap);

In SampleMecanumDrive.java, change the names of motors in lines 101-104 as follows:
leftFront = hardwareMap.get(DcMotorEx.class, "front_left_motor");
leftRear = hardwareMap.get(DcMotorEx.class, "back_left_motor");
rightRear = hardwareMap.get(DcMotorEx.class, "back_right_motor");
rightFront = hardwareMap.get(DcMotorEx.class, "front_right_motor");

In SampleTankDrive.java, comment out line 34:
//import org.firstinspires.ftc.teamcode.util.LynxModuleUtil;

In SampleTankDrive.java, comment out line 81:
// LynxModuleUtil.ensureMinimumFirmwareVersion(hardwareMap);

In SampleMecanumDrive.java, at the "TODO" comment, line 119, reverse the directions of the left motors:
// TODO: reverse any motors using DcMotor.setDirection()
leftFront.setDirection(DcMotorSimple.Direction.REVERSE);
leftRear.setDirection(DcMotorSimple.Direction.REVERSE);

It is necessary to provide some information about the robot in DriveConstants.java.
The following work well with the Mecanum robot configuraiton in virtual_robot:

TICKS_PER_REV = 1120
MAX_RPM = 160
RUN_USING_ENCODER = true
TRACK_WIDTH = 17.91
MAX_VEL = 28
MAX_ACCEL = 28

Also, max linear and turn velocities can be set as follows:
public static double MAX_VEL = 28;
public static double MAX_ACCEL = 28;
public static double MAX_ANG_VEL = Math.toRadians(175);
public static double MAX_ANG_ACCEL = Math.toRadians(175);

@graceliu
Copy link
Author

graceliu commented Mar 7, 2023 via email

@jkenney2 jkenney2 closed this as completed Mar 7, 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

No branches or pull requests

2 participants