Log in

View Full Version : Sensors Not Working in Autonomous


jSoft
16-02-2015, 11:34
Hey everyone, last night my team and I were trying to finish up the autonomous for our robot, and we ran into a problem. We called a function to read the distance on an encoder, and we published the encoder distance to the dashboard, but the encoder function doesn't seem to be working, and no data is being displayed on the dashboard. This is the same with limit switches. All of our code is done in LabView 2015. Has anyone else had this problem, and is there a solution to it?

Alan Anderson
16-02-2015, 11:40
We had that problem early on. Publishing a value to the "Gyro" Smart Dashboard variable didn't result in the indicator on the Dashboard doing anything.

That's because the Dashboard Gyro indicator isn't on one of the tabs where indicators automatically work. Adding code to actually read the Smart Dashboard variable and wiring it to the indicator made it work.

What tab are your Dashboard indicators on? Are they named to match the SD variable? How are you writing the SD variable in the robot code?

jSoft
16-02-2015, 11:43
Thanks for the quick reply, my dashboard indicators are on the "custom" tab, and the names do match as they're the exact same as the names in the teleop file. I'm using the standard write to dashboard functions to publish the data.

Alan Anderson
16-02-2015, 11:51
Do you have anything wired to the custom Dashboard indicators? Leave them unwired in order for the SD variables to get displayed. Look in the Variables tab of the Dashboard to see if the SD variables are actually being sent. That'll help you find out whether to focus on the Dashboard or on the robot code.

You're trying to write Autonomous code, but you said you published the values in Teleop. Is that what you meant?