Go to Post Physics is weird sometimes, this is why we prototype. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
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 13-01-2011, 16:08
gr8dragon's Avatar
gr8dragon gr8dragon is offline
Registered User
AKA: Parth Patel
no team
Team Role: Alumni
 
Join Date: Dec 2008
Rookie Year: 2006
Location: Toronto,Canada
Posts: 39
gr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of lightgr8dragon is a glorious beacon of light
VEX Ultrasonic Sensor

Hi,
I have been trying to use the vex ultrasonic sensor on the FRC robot and have had no success. I think the problem may be in the way i wired the sensor. I have both the wires going into the Digital I/O on the sidecar ports 3,1. I am using the WPILib ultrasonic class and can only manage to read zeros. Also on the driver station, under the diagnostics tab, the error messages box keeps saying assertion failed. Can some one help me get this sensor to read values or should i just order a "FRC" sensor.

Thanks
Reply With Quote
  #2   Spotlight this post!  
Unread 14-01-2011, 02:23
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: VEX Ultrasonic Sensor

Please copy and paste the assertion that is failing and the code you wrote. We can't guess what's wrong otherwise.
Reply With Quote
  #3   Spotlight this post!  
Unread 29-01-2011, 14:32
kwfinken kwfinken is offline
Registered User
FRC #2246 (Army of Sum)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2009
Location: Lewiston, MI
Posts: 1
kwfinken is an unknown quantity at this point
Cool Re: VEX Ultrasonic Sensor

We are having the same problems and error, the sensor is not showing any distance changes but is staying at 0. The error appears on the driver's station diagnostic tab.
==================ERROR====================
Assertion Failed: "m_downSource!=NULL" in clearDownSource() in c:/windriver/workspace/wpilib/counter.cpp at line 337.

================Source Code=================

#include "WPILib.h"

DriverStationLCD *dsLCD = DriverStationLCD::GetInstance();

class ArmyOfSumRobot : public IterativeRobot
{
/*Initialize interaction with Hardware*/
RobotDrive *MyRobot; //Robot Drive
DriverStation *Ds; //Driver Station

Ultrasonic *USleft;

public:

ArmyOfSumRobot(void)
{
Ds = DriverStation::GetInstance();

MyRobot = new RobotDrive(1,2,3,4);// create robot drive base with 4 motors

USleft = new Ultrasonic(4,5); // create ultra sonic on digital IO 4,5 in inches
}

void AutonomousContinuous(void)
{
GetWatchdog().Feed();
}
void TeleopContinuous(void)
{
GetWatchdog().Feed();

dsLCD->Printf(DriverStationLCD::kUser_Line1, 1, "ultra sonic left: %g", USleft->GetRangeInches());
}

void DisabledPeriodic(void)
{
GetWatchdog().Feed(); // feed the user watchdog at every period when disabled
}

void TeleopPeriodic(void)
{
GetWatchdog().Feed(); // feed the user watchdog at every period when in autonomous

}

void DisabledContinuous(void)
{
GetWatchdog().Feed(); //do nothing
}

void AutonomousPeriodic(void)
{
GetWatchdog().Feed(); //do nothing
}
/********************************** Init Routines *************************************/
void DisabledInit(void)
{
}

void AutonomousInit(void)
{
}

void TeleopInit(void)
{
}

void RobotInit(void)
{

//initialize ultrasonics
USleft->SetDistanceUnits(Ultrasonic::kInches);
USleft->SetAutomaticMode(TRUE);


}
};

START_ROBOT_CLASS(ArmyOfSumRobot);
Reply With Quote
  #4   Spotlight this post!  
Unread 08-02-2011, 04:13
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: VEX Ultrasonic Sensor

Quote:
Originally Posted by kwfinken View Post
We are having the same problems and error, the sensor is not showing any distance changes but is staying at 0. The error appears on the driver's station diagnostic tab.
==================ERROR====================
Assertion Failed: "m_downSource!=NULL" in clearDownSource() in c:/windriver/workspace/wpilib/counter.cpp at line 337.
I believe that was fixed in the latest C++ update.

Please try updating and let us know if it works or if the error was just a red herring.

-Joe
Reply With Quote
  #5   Spotlight this post!  
Unread 08-02-2011, 10:14
jwakeman jwakeman is offline
Registered User
FRC #0063 (Red Barons)
Team Role: Mentor
 
Join Date: Jan 2011
Rookie Year: 2010
Location: 16510
Posts: 182
jwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nicejwakeman is just really nice
Re: VEX Ultrasonic Sensor

I think the assertion is likely a red herring in this case. I see that same message when using the GearTooth class but I am still counting teeth just fine.
Reply With Quote
  #6   Spotlight this post!  
Unread 09-02-2011, 03:03
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: VEX Ultrasonic Sensor

Quote:
Originally Posted by jwakeman View Post
I think the assertion is likely a red herring in this case. I see that same message when using the GearTooth class but I am still counting teeth just fine.
On a side note, then, have you updated to the most recent C++ update and you still see this, or are you still running the update from kickoff?

-Joe
Reply With Quote
  #7   Spotlight this post!  
Unread 09-02-2011, 10:25
virtuald's Avatar
virtuald virtuald is online now
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,055
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: VEX Ultrasonic Sensor

Joe,

We had the assert error with the vex sensors in the prior WPILib release, but the current WPILib release no longer asserts. Which is good

However, for some reason our sensors work inconsistently -- most of the time they read 120 or 249 -- but if I put my hand right in front of it, then it will read a few inches.. maybe out to 5 inches or so before it jumps back to 249. I'm hoping it's a wiring problem (it worked at first with the previous version, but then it started exhibiting the 120/249 behavior and I couldn't get it to work correctly), but maybe not.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
Reply With Quote
  #8   Spotlight this post!  
Unread 09-02-2011, 14:36
jhersh jhersh is offline
National Instruments
AKA: Joe Hershberger
FRC #2468 (Appreciate)
Team Role: Mentor
 
Join Date: May 2008
Rookie Year: 1997
Location: Austin, TX
Posts: 1,006
jhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond reputejhersh has a reputation beyond repute
Re: VEX Ultrasonic Sensor

Quote:
Originally Posted by virtuald View Post
Joe,

We had the assert error with the vex sensors in the prior WPILib release, but the current WPILib release no longer asserts. Which is good

However, for some reason our sensors work inconsistently -- most of the time they read 120 or 249 -- but if I put my hand right in front of it, then it will read a few inches.. maybe out to 5 inches or so before it jumps back to 249. I'm hoping it's a wiring problem (it worked at first with the previous version, but then it started exhibiting the 120/249 behavior and I couldn't get it to work correctly), but maybe not.
That type of behavior is usually caused by the sensor not seeing a reflection.
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 18:08.

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