![]() |
Casting Floats, printf's, and variable maxing
Ive been having a problem, and I wanted to wait until I was absolutely sure I didnt know how to fix it before posting it here. Well, guess what... I've hit that benchmark. We are implementing a simple navigation system on our robot this year, which is used to keep track of position and give drive commands to drive to waypoints.
This system grabs current angle from an on board gyro, and distance traveled in the sample period from shaft encoders. I have been testing this on an EDU controller, and everything worked flawlessly. But when I moved my code over to the FRC controller, I started getting some fishy outcomes. I have a function that is called every program loop to keep track of position, then a printf in user routines.c that shows current x, y, and heading variables for debugging purposes. Heres the navigation function: Code:
int nav_heading;Code:
printf("X = %d | Y = %d\r", Nav_Get_x(), Nav_Get_y());Do you have any idea what is wrong? |
Re: Casting Floats, printf's, and variable maxing
You might try splitting things up, temporarily to get to the bottom of it...
Code:
int nav_heading;Eric |
| All times are GMT -5. The time now is 04:41. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi