1) I was trying to use this in the MoveWithOptions function call, as suggested in the new guide.
When I compile i get an error indicating that GetHeading() was not declared in this scope.
I have the latest version of the behaviour file ( 04_01)
2) I am curious in the "driveSquare" behaviour, why the "pause", "resume" and Calibrate functions are callled? I understand why Zero is called but not why the other calls are needed.
Any suggestions?
GetHeading() and Navigation question
-
- Posts: 2
- Joined: Wed Sep 23, 2015 4:09 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: GetHeading() and Navigation question
I'm not 100% sure but I think instead of GetHeading() you can use PresentHeading() or GetDegrees().
-
- Posts: 180
- Joined: Tue Jul 28, 2015 12:56 am [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable
Re: GetHeading() and Navigation question
cbw,
I just realized I made a big mistake in the guide. It's "PresentHeading()" not "GetHeading()". I put "getheading" into the guide then when making final edits to the base code before releasing, I changed it to "PresentHeading()" because I though thought that was more clear when used inside MoveWithOptions.
About the Pause and Resume.... if the Gyro and Accelerometer aren't read at least every 80 milliseconds, their internal buffers will overflow. This isn't necessarily bad, it just means that any movement that happened during that time won't be calculated into the present heading and xy coordinates. So if you're going to run a delay, it's good practice to Pause and then Resume.
The reason we were running calibrate over and over is because we were using this behavior at a show and people were handling the bots a lot. If calibration is run when the bot isn't totally still, it'll navigate in strange ways following - so this basically just re-calibrates it a lot. Remember calibration just reads the sensors a few times and cancels out any existing non-zero acceleration in future calculations.
I just realized I made a big mistake in the guide. It's "PresentHeading()" not "GetHeading()". I put "getheading" into the guide then when making final edits to the base code before releasing, I changed it to "PresentHeading()" because I though thought that was more clear when used inside MoveWithOptions.
About the Pause and Resume.... if the Gyro and Accelerometer aren't read at least every 80 milliseconds, their internal buffers will overflow. This isn't necessarily bad, it just means that any movement that happened during that time won't be calculated into the present heading and xy coordinates. So if you're going to run a delay, it's good practice to Pause and then Resume.
The reason we were running calibrate over and over is because we were using this behavior at a show and people were handling the bots a lot. If calibration is run when the bot isn't totally still, it'll navigate in strange ways following - so this basically just re-calibrates it a lot. Remember calibration just reads the sensors a few times and cancels out any existing non-zero acceleration in future calculations.
Who is online
Users browsing this forum: No registered users and 8 guests