My first gues is that it's not turning in the correct difection because of drive motor directions. Did you run the sample teleop and auto opmodes before making changes? You should be able to run the code by 1) making your robot-configuration motor names match. 2) setting the motor.setDirection() values so that all motors drive forward... Once you have this done, verify that the robot drives as expected. Then make sure the gyro is changing properly as you tur (look at the telemetry). turning left should increase the heading.
Sample telop works fine as the robot drives as expected except the turns. The heading stays at 0 that is why the robot keeps turning rather than stopping at 90 degrees as programmed. I will double check the configuration and motor.setDirection()values. Thanks @@GEARSinc
Also, the only way odometry drives correctly is if this code direction for logo and USB for IMU is flipped: our hub logo is facing right (but in code we have it as LEFT) and USB is facing up (but in code is DOWN) // Tell the software how the Control Hub is mounted on the robot to align the IMU XYZ axes correctly RevHubOrientationOnRobot orientationOnRobot = new RevHubOrientationOnRobot(RevHubOrientationOnRobot.LogoFacingDirection.UP, RevHubOrientationOnRobot.UsbFacingDirection.FORWARD); @@GEARSinc
Hey there, I was trying to implement your code into our robot to test it out and ran into an issue when implementing the SampleAutonomous. For reference I am using the OnBotJava and both the Robot class file and SampleAutonomous file are in the same folder. On line 23 of the Sample Autonomous code I am getting this error: ERROR: incompatible types: org.firstinspires.ftc.teamcode.SampleAutonomous cannot be converted to com.qualcomm.robotcore.eventloop.EventLoopManager and on line 28 I am getting this error: ERROR: cannot find symbol symbol: method initialize(boolean) location: variable robot of type com.qualcomm.robotcore.robot.Robot I havent modified any of the code on the github repo. Any help would be much appreciated
Hi So... it turns out that OnBotJava was not happy about me naming the robot hardware class "Robot". This clashes with an internal SDK class. So I have renamed the class to "SimplifiedMecanumRobot" Nothing else has changed. So if you re-clone the repo (I just updated it) and get the new files, then it will build properly in OnBotJava.
Thanks for update. Everything works fine but when trying to complete a 90 deg turn, robot does not stop. What could be issue?
My first gues is that it's not turning in the correct difection because of drive motor directions. Did you run the sample teleop and auto opmodes before making changes? You should be able to run the code by 1) making your robot-configuration motor names match. 2) setting the motor.setDirection() values so that all motors drive forward... Once you have this done, verify that the robot drives as expected. Then make sure the gyro is changing properly as you tur (look at the telemetry). turning left should increase the heading.
Sample telop works fine as the robot drives as expected except the turns. The heading stays at 0 that is why the robot keeps turning rather than stopping at 90 degrees as programmed. I will double check the configuration and motor.setDirection()values. Thanks @@GEARSinc
Also, the only way odometry drives correctly is if this code direction for logo and USB for IMU is flipped: our hub logo is facing right (but in code we have it as LEFT) and USB is facing up (but in code is DOWN)
// Tell the software how the Control Hub is mounted on the robot to align the IMU XYZ axes correctly
RevHubOrientationOnRobot orientationOnRobot =
new RevHubOrientationOnRobot(RevHubOrientationOnRobot.LogoFacingDirection.UP,
RevHubOrientationOnRobot.UsbFacingDirection.FORWARD);
@@GEARSinc
Hey there,
I was trying to implement your code into our robot to test it out and ran into an issue when implementing the SampleAutonomous. For reference I am using the OnBotJava and both the Robot class file and SampleAutonomous file are in the same folder. On line 23 of the Sample Autonomous code I am getting this error: ERROR: incompatible types: org.firstinspires.ftc.teamcode.SampleAutonomous cannot be converted to com.qualcomm.robotcore.eventloop.EventLoopManager
and on line 28 I am getting this error:
ERROR: cannot find symbol
symbol: method initialize(boolean)
location: variable robot of type com.qualcomm.robotcore.robot.Robot
I havent modified any of the code on the github repo. Any help would be much appreciated
I don't have hardware at the moment (snowed in) but I will try an OBJ build and see what your issue might be. Hopefully by tomorrow.
Hi
So... it turns out that OnBotJava was not happy about me naming the robot hardware class "Robot". This clashes with an internal SDK class. So I have renamed the class to "SimplifiedMecanumRobot" Nothing else has changed. So if you re-clone the repo (I just updated it) and get the new files, then it will build properly in OnBotJava.