Skip to content
This repository has been archived by the owner on Feb 3, 2023. It is now read-only.

The ChassisController DriveToPoint and TurnToPoint methods do not function correctly #495

Open
DoctorFogarty opened this issue Dec 17, 2022 · 0 comments

Comments

@DoctorFogarty
Copy link

When using the DriveToPoint or TurnToPoint function the robot will rotate to a seemingly random angle sometimes close to correct and sometimes completely wrong. I tested this using a consistent starting point with no code changes and observed the turn angle wildly change 4/9 runs. We were able to get completely expected and consistent results using turnAngle and moveDistance function calls so we are fairly confident this issue is not hardware related or tuning of the PID values.

std::shared_ptr<OdomChassisController> chassis =
ChassisControllerBuilder()
	.withGains(
	{0.003, 0.0001, 0.0001}, //Distance
	{0.0065, 0, 0.0001},     //Turning
	{0.001, 0, 0.0001}       //Straightness
	)
	.withMotors({2,5},{-1,-20}) // Minus sign means motors are reversed
	.withDimensions(AbstractMotor::gearset::green, {{4_in, 11.5_in}, imev5GreenTPR})
	.withSensors(RotationSensor(10), RotationSensor(9, true))
	.withOdometry({{2.75_in, 7.5_in}, 360})
	.buildOdometry();

  	chassis->setMaxVelocity(90);
	chassis->moveDistance(3_in);
	chassis->waitUntilSettled();
	chassis->stop();

	chassis->driveToPoint({70_in, -39_in});
	chassis->waitUntilSettled();
	chassis->stop();

	chassis->turnToPoint({125_in,5_in});
	chassis->stop();

Versions
4.8.0 OKAPI
3.7.2 PROS Kernel

@DoctorFogarty DoctorFogarty changed the title The ChassisController DriveToPoint and TurnToPoint Does Not seem to function correctly The ChassisController DriveToPoint and TurnToPoint do not function correctly Dec 17, 2022
@DoctorFogarty DoctorFogarty changed the title The ChassisController DriveToPoint and TurnToPoint do not function correctly The ChassisController DriveToPoint and TurnToPoint methods do not function correctly Dec 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant