Go to Post Slight physical blocks will never stop a good programmer, we can just program around it. - AIBob [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-01-2015, 16:57
FurryFaust's Avatar
FurryFaust FurryFaust is offline
Registered User
FRC #0334
 
Join Date: Nov 2014
Location: Brooklyn, New York
Posts: 4
FurryFaust is an unknown quantity at this point
Vex Ultrasonic not working for new 2015 system

The Vex Ultrasonics' code is crashing the robot. As soon as a certain line of code runs (pinpointed on robot init), the driver station immediately disables and says no robot code. I have tested this with 2014's robot system which has not been an issue however this issue only occurs with 2015's.

Code:
package org.usfirst.frc.team334.robot;

import edu.wpi.first.wpilibj.IterativeRobot;
import edu.wpi.first.wpilibj.Ultrasonic;
import edu.wpi.first.wpilibj.smartdashboard.SmartDashboard;

public class Robot extends IterativeRobot {

	Ultrasonic ultrasonic = new Ultrasonic(1, 2);

	public void robotInit() {
		ultrasonic.setAutomaticMode(true);
	}

	public void autonomousPeriodic() {
		SmartDashboard.putNumber("Ultrasonic Value", ultrasonic.getRangeInches());
		
	}

	public void teleopPeriodic() {

	}

	public void testPeriodic() {

	}
}
Reply With Quote
  #2   Spotlight this post!  
Unread 09-02-2015, 10:59
mdrouillard mdrouillard is offline
Registered User
FRC #0772
 
Join Date: May 2011
Location: Canada
Posts: 29
mdrouillard is an unknown quantity at this point
Re: Vex Ultrasonic not working for new 2015 system

IN JAVA: We spent an entire day on this, doubting our wiring, our code. We even created a brand new empty shell using gearsbot command based as a starting point, but only adding the vex ultrasonic digital sensor. We could not get it to work. So, we then did the same thing but switched to C++...

It worked in C++. We believe there is a bug in the Java library. But without anything concrete in team updates or elsewhere on CD....

So, we are now switching our robot to C++ as we need these rangefinders on the robot. So, give it a try in C++ and report back. We are not looking back now....

md
Reply With Quote
  #3   Spotlight this post!  
Unread 12-02-2015, 12:58
mdrouillard mdrouillard is offline
Registered User
FRC #0772
 
Join Date: May 2011
Location: Canada
Posts: 29
mdrouillard is an unknown quantity at this point
Re: Vex Ultrasonic not working for new 2015 system

Just an update everyone. We were able to get it to work under JAVA after all. At this point we are not sure what changed, but there was an re-image to the roborio that was done. So, it may not be a library bug after all. I just did not want anyone chasing ghosts on this...

md
Reply With Quote
  #4   Spotlight this post!  
Unread 14-02-2015, 09:47
FurryFaust's Avatar
FurryFaust FurryFaust is offline
Registered User
FRC #0334
 
Join Date: Nov 2014
Location: Brooklyn, New York
Posts: 4
FurryFaust is an unknown quantity at this point
Re: Vex Ultrasonic not working for new 2015 system

Thank guys. We reflashed the roborio and it's working now!
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 08:03.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi