![]() |
[FTC]: RobotC returns junk joystick data?
Hello:
We are having a problem where the joystick data is intermittently being transmitted as zero. We hold the joystick (joystick.joy1_y1) forward, and have the NXT display the value. The NXT alternates between 128 and 0. This produces jittery movement in the robot, intolerable for the FTC competition. This error is replicable in the sample code provided with RobotC. As we have noted, there are several elements in the chain from the controller to the NXT. In order, we have identified: The controller, the connection to robotc, robotc itself, the connection to the NXT, the driver on the NXT, and lastly the values interpreted by the NXT. We have eliminated all of these save the connection from RobotC to the NXT, which is an inherent part of the software provided. There were also several other variables, such as the controller used, the NXT used, and the software version used. In our debugging, we tried all possible combinations of the following: two different controllers, three different NXT bricks, and two unique versions of RobotC (3.03 and 3.04). None of the permutations solved our problem. The controller's information is correct. The Joystick Setup dialog box demonstrates that, at least within RobotC, the program is correct. The value does not deviate from 128 and does not spontaneously switch to zero. The controller is correct. The data being transferred from RobotC to the NXT is, to my knowledge, unverifiable. We tried several joystick drivers, including several modifications of the driver, as well as making some of our own edits to attempt to remove the junk data. The raw data received by the NXT is accurate for the output it creates, but, due to Garbage In Garbage Out, it returns incorrect data. This lead us to the conclusion that the error lies in the connection between RobotC and the NXT. To test which side the error was on, we attempted both a connection via USB and Bluetooth. The error was replicated exactly with both connection methods. This lead us to the conclusion that RobotC is not sending the correct joystick data and/or the NXT is not correctly receiving the data from the NXT. The error is very recent. Our FTC competition is in 13 days. Please hurry! Thanks! --Noah de.evolution 4278 |
Re: [FTC]: RobotC returns junk joystick data?
Does it only happen when the joystick is fully forward (not backwards)?
If so, it sound like a signed to unsinged integer conversion problem. Since the joystick actually puts out max negative when you push it forward, somewhere in the software is negating the number. Since there is a -128 in 8 bit signed math, but not a +128, this is sometimes converted incorrectly. If that's what it is, you might also expect it to happen to the X axis when you move the joystick all the way to the left, but it may not since that value probably isn't reversed. I don't use Robot C. What "type" is the joystick value (byte or integer)? Phil. |
Re: [FTC]: RobotC returns junk joystick data?
It happens at both directions. I did consider an unsigned int conversion error.
The data type is short for the joystick data. |
Re: [FTC]: RobotC returns junk joystick data?
Our experience with similar issues is somewhere in the USB connection/driver on the computer with your joysticks. We had the same symptoms when using a USB hub on a particular laptop. If we removed the USB hub from the equation or moved the hub to another computer the issue would go away.
I'd suggest testing from another computer or playing around with how you're connecting the joysticks to the computer. |
Re: [FTC]: RobotC returns junk joystick data?
The issue is present on two computers.
I may have found a workaround for it, though. |
Re: [FTC]: RobotC returns junk joystick data?
Did you try using a different joystick? If you don't have another, you could contact a team in your area.
|
| All times are GMT -5. The time now is 19:00. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi