Go to Post Show me the mentor who has never built a bad robot and I'll show you either a new mentor, a liar, or Andy Baker. - Andrew Schreiber [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2010, 13:31
marsperson2 marsperson2 is offline
Registered User
FRC #2603
 
Join Date: Feb 2010
Location: Medina
Posts: 7
marsperson2 is an unknown quantity at this point
How to update the Virtual compass

We have a gyro that we know is working; we are sending the number values to the driver station via a printf statement, but we cannot get the virtual compass to display the data. We are using C++. Any help will be greatly appreciated.
  #2   Spotlight this post!  
Unread 13-02-2010, 15:37
Kyledoo Kyledoo is offline
Registered User
FRC #2603
 
Join Date: Jan 2010
Location: Ohio
Posts: 24
Kyledoo is an unknown quantity at this point
Re: How to update the Virtual compass

Hi, I'm the other programmer from team 2603; I have noticed that when we declare the gyro within DashboardDataFormat.cpp and use it in the function to show the value in the compass, we get a watchdog error and it gets stuck in some kind of loop. How are other teams getting the gyro data into the compass?
  #3   Spotlight this post!  
Unread 14-02-2010, 15:42
marsperson2 marsperson2 is offline
Registered User
FRC #2603
 
Join Date: Feb 2010
Location: Medina
Posts: 7
marsperson2 is an unknown quantity at this point
Re: How to update the Virtual compass

bump
  #4   Spotlight this post!  
Unread 14-02-2010, 17:17
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: How to update the Virtual compass

The heading indicator is part of the default Dashboard. It gets its data from the gyro code in the provided programming. I'm not familiar enough with C++ to give you any specific advice; perhaps someone else will jump in to tell you what to look for.
  #5   Spotlight this post!  
Unread 14-02-2010, 18:11
Radical Pi Radical Pi is offline
Putting the Jumper in the Bumper
AKA: Ian Thompson
FRC #0639 (Code Red Robotics)
Team Role: Programmer
 
Join Date: Jan 2010
Rookie Year: 2010
Location: New York
Posts: 655
Radical Pi has a spectacular aura aboutRadical Pi has a spectacular aura aboutRadical Pi has a spectacular aura about
Re: How to update the Virtual compass

I'll be that person to jump in. Assuming you are using the default dashboard code and have it properly included in your code, you probably don't know that the default dashboard posts the same values to the dashboard all the time.

Looking at the code though, it looks like the gyro data is not sent at all. This is a perfect time for an exercise in dashboard coding. Hopefully by looking at the example code you can figure out the C++ to LabVIEW interface used. Just add another U8 (or whatever type is used for gyros) data field to the Digital portion of the dashboard packet, have it read your gyro data in, and in LabVIEW update the packet typedef to what you are using, open the Decode Digital module VI and read the new gyro data you included, and then conect that to the virtual gyro on the dashboard. If you need help with all that I might be able to take some LabVIEW screenshots tomorow when I'm back at the build
  #6   Spotlight this post!  
Unread 15-02-2010, 17:56
KRibordy KRibordy is offline
Registered User
FRC #1000 (Cybearcats)
Team Role: Mentor
 
Join Date: Mar 2008
Rookie Year: 2006
Location: Valparaiso, IN
Posts: 36
KRibordy is an unknown quantity at this point
Re: How to update the Virtual compass

If I remember right, the default image code creates a new gyro and used the DashboardDataSender class to send the gyro information. I took it all out of our code because we don't have one; but I distinctly remember seeing it there.
  #7   Spotlight this post!  
Unread 15-02-2010, 18:13
marsperson2 marsperson2 is offline
Registered User
FRC #2603
 
Join Date: Feb 2010
Location: Medina
Posts: 7
marsperson2 is an unknown quantity at this point
Re: How to update the Virtual compass

Thank you, but what needs to be put in place of the hard coded value?
  #8   Spotlight this post!  
Unread 15-02-2010, 23:28
David Fort David Fort is offline
Registered User
FRC #1001
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2003
Location: Cleveland, OH
Posts: 26
David Fort is on a distinguished road
Re: How to update the Virtual compass

I trust this won't get any points for elegance, but in our case, we find the virtual compass on the driver station (straight out of the box) is updated along with the Vision Data, which at present, we don't have, but this seems to get the compass heading updated by stubbing out the vision stuff:
// this comes from the example:
// dds->sendVisionData(0.0,
// gyro->GetAngle(),
// 0.0,
// targets[0].m_xPos / targets[0].m_xMax,
// targets);

// and we are able to swing the needle thusly:
vector<Target> targets;
dds->sendVisionData(0.0, m_Gyro->GetAngle(), 0.0, 0.0, targets);


This uses DashboardDataSender.cpp from the 2010 Image Demo.

Hope it helps,
David Fort
Mentor, Team 1001
Hacksaw
  #9   Spotlight this post!  
Unread 21-02-2010, 15:05
Kyledoo Kyledoo is offline
Registered User
FRC #2603
 
Join Date: Jan 2010
Location: Ohio
Posts: 24
Kyledoo is an unknown quantity at this point
Re: How to update the Virtual compass

Quote:
Originally Posted by David Fort View Post
I trust this won't get any points for elegance, but in our case, we find the virtual compass on the driver station (straight out of the box) is updated along with the Vision Data, which at present, we don't have, but this seems to get the compass heading updated by stubbing out the vision stuff:
// this comes from the example:
// dds->sendVisionData(0.0,
// gyro->GetAngle(),
// 0.0,
// targets[0].m_xPos / targets[0].m_xMax,
// targets);

// and we are able to swing the needle thusly:
vector<Target> targets;
dds->sendVisionData(0.0, m_Gyro->GetAngle(), 0.0, 0.0, targets);


This uses DashboardDataSender.cpp from the 2010 Image Demo.

Hope it helps,
David Fort
Mentor, Team 1001
Hacksaw
Ok, I found the example code you are talking about, now what I am wondering is how to get the DashboardDataSender to work in our code. I have tried simply declaring DashboardDataSender, but it returns an error saying that it does not name a type.
  #10   Spotlight this post!  
Unread 21-02-2010, 17:41
chris janney chris janney is offline
Registered User
FRC #3266
 
Join Date: Jan 2010
Location: eaton ohio
Posts: 46
chris janney is an unknown quantity at this point
Re: How to update the Virtual compass

what does the gyro look like?
Closed Thread


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
HM55B Digital Compass - How do I program the controller to read it? RyanN Programming 12 13-03-2008 00:14
Interfacing a digital compass with the RC Kelly Electrical 14 27-09-2007 19:01
We are looking for the 2005 Virtual Kit Of Parts sgsdragons Inventor 2 22-01-2005 16:44
Who was in on the Virtual March on Washington? Scottie2Hottie Chit-Chat 2 28-02-2003 10:09
WHERE IS THE VIRTUAL KIT OF PARTS ggoldman Inventor 6 08-01-2002 13:42


All times are GMT -5. The time now is 01:55.

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