Skip to content
This repository has been archived by the owner on Apr 18, 2020. It is now read-only.

RotateCruizcore store previous gyro rate #28

Open
jabrena opened this issue Oct 22, 2016 · 2 comments
Open

RotateCruizcore store previous gyro rate #28

jabrena opened this issue Oct 22, 2016 · 2 comments

Comments

@jabrena
Copy link
Member

jabrena commented Oct 22, 2016

Version detected: v0.3.1
Developing the method GoToXY, I discovered that the block about RotateCruizcore doesn´t work in the right way if the user rotate twice. What is the reason?

The sensor internally doesn´t reset the internal value every time that the sensor is called.

Alternatives:

1. Reset the sensor
One default solution could be resetting the sensor another one. The problem is the global I2C Support. Complex alternative.

Related issue: #29

2. Improve Sensor Characterization
Maybe it is easier if I understand better default behaviour of the EV3G Cruizcore block to avoid this case.

Cruizcore EV3G Block:

The sensor returns a value in the following range: (Pi, 0, -Pi) x 100

Using a calculus in the beginning of the method it is possible to know what quadrant is the angle and later calculate the reference angle to rotate in the range [0,Pi] or [0,-Pi]

For angles > 360, 2Pi, it is possible to use the Modulus to solve the issue.

final double angleToRotate = parameter % 360;

For every angle except 180, the idea is valid. For the angle 180, it is necessary to a State Machine approach.

@jabrena jabrena added this to the v0.4.0 milestone Oct 22, 2016
@jabrena jabrena self-assigned this Oct 22, 2016
@jabrena
Copy link
Member Author

jabrena commented Oct 23, 2016

It is necessary to create a Private method to calculate the reference angle for Quadrant I, Quadrant II, Quadrant III & Quadrant IV

@jabrena
Copy link
Member Author

jabrena commented Oct 23, 2016

The method was tested in several scenarios. It is necessary to review the integration in the logic.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant