GetHeading() and Navigation question

Ringo setup, hardware, basic programming. User to user support.
[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
cbw060
Posts: 23
Joined: Wed Aug 26, 2015 6:21 pm
[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

GetHeading() and Navigation question

Postby cbw060 » Mon Sep 21, 2015 4:04 am

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?

PapaBlaza
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

Postby PapaBlaza » Wed Sep 23, 2015 4:34 am

I'm not 100% sure but I think instead of GetHeading() you can use PresentHeading() or GetDegrees().

Kevin
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

Postby Kevin » Fri Sep 25, 2015 8:50 pm

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.


[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
[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

Who is online

Users browsing this forum: No registered users and 25 guests