Go to Post I don't mean to sound harsh, but I do not want you to get your hopes up. There are deadlines in FIRST. - RoboMom [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 20-01-2007, 18:32
kwilliam's Avatar
kwilliam kwilliam is offline
Registered User
FRC #1038
 
Join Date: Jan 2007
Location: Ohio
Posts: 8
kwilliam has a spectacular aura aboutkwilliam has a spectacular aura about
Question User_Bytes taken over by breakers?

Our team is using the .NET (2.0) Composite Dashboard Viewer to get servo and PWM data from the robot while it is running. It is supposed to let you view the camera centroid and bounding box too, but that isn't working. According to the page on the Composite Dashboard Viewer, the camera data needs to be mapped to the dashboard packet as follows:

user_byte1 = x
user_byte2 = y
user_byte3 = x1
user_byte4 = y1
user_byte5 = x2
user_byte6 = y2

I could probably figure out how to set these values, but then I noticed this in ifi_aliases.h:

Quote:
#define User_Byte1 txdata.user_byte1.allbits
#define User_Byte2 txdata.user_byte2.allbits
#define User_Byte3 txdata.user_byte3 /* This byte is now used for breaker panel byte 3 */
#define User_Byte4 txdata.user_byte4 /* This byte is now used for breaker panel byte 4 */
#define User_Byte5 txdata.user_byte5 /* This byte is now used for breaker panel byte 5 */
#define User_Byte6 txdata.user_byte6 /* This byte is now used for breaker panel byte 6 */
Is this breaker thing hardwired in the controller, so that we only get two User Bytes this year? Or is there a way to overwrite user bytes 3 through 6 with the camera data anyway?
  #2   Spotlight this post!  
Unread 20-01-2007, 18:58
dtengineering's Avatar
dtengineering dtengineering is offline
Teaching Teachers to Teach Tech
AKA: Jason Brett
no team (British Columbia FRC teams)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: Vancouver, BC
Posts: 1,832
dtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond reputedtengineering has a reputation beyond repute
Re: User_Bytes taken over by breakers?

I'm not an expert at the data packets, so I might attach to this question the following one:

If you have an unused PWM (that has no servo cable attached to it) could you not use that value as an additional byte to send back to the OI?

Typically we use fewer than half of our PWMs, but the data structure of the packet seems to show that they are all returned to the OI.

Experts?

Jason
  #3   Spotlight this post!  
Unread 20-01-2007, 20:19
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: User_Bytes taken over by breakers?

The breaker panel feedback isn't hardwired. It was a short bit of code (in Default_Routine(), I believe) in prior years. It is only useful if you're a) using the IFI breaker panel, and b) connecting the IFI breaker to the program port on the RC.

You're not doing either of those this year, because the IFI breaker panel isn't a permitted component. If the default code still refers to it, ignore it.
  #4   Spotlight this post!  
Unread 20-01-2007, 23:09
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,856
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: User_Bytes taken over by breakers?

Quote:
Originally Posted by dtengineering View Post
If you have an unused PWM (that has no servo cable attached to it) could you not use that value as an additional byte to send back to the OI?
Yes, you can set your unused PWMs to any byte value you chose and read it via the dashboard.

P.S. Alan caught my oversight. 255 isn't allowed over the radio link since a pair of them back to back is reserved as a special flag indicating a new packet is starting. You can set your PWMs to 255, but the Master will change them to 254 before radioing the packet back to the OI and your dashboard.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 21-01-2007 at 12:11.
  #5   Spotlight this post!  
Unread 21-01-2007, 00:06
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: User_Bytes taken over by breakers?

Quote:
Originally Posted by Mark McLeod View Post
Yes, you can set your unused PWMs to any byte value you chose and read it via the dashboard.
Not any value. You can't use 255; it will get changed to 254 on the way through the radio link.
  #6   Spotlight this post!  
Unread 21-01-2007, 22:30
kwilliam's Avatar
kwilliam kwilliam is offline
Registered User
FRC #1038
 
Join Date: Jan 2007
Location: Ohio
Posts: 8
kwilliam has a spectacular aura aboutkwilliam has a spectacular aura about
Re: User_Bytes taken over by breakers?

Quote:
Originally Posted by Alan Anderson View Post
The breaker panel feedback isn't hardwired. It was a short bit of code (in Default_Routine(), I believe) in prior years. ... If the default code still refers to it, ignore it.
What made me think it might be hardwired is that it isn't referenced anywhere in the default code. Did they just forget to take the comments out? If that's the case, will I need to add ".allbits" to bytes 3 through 6 like bytes 1 and 2 have?
  #7   Spotlight this post!  
Unread 22-01-2007, 10:33
seanwitte seanwitte is offline
Registered User
None #0116
Team Role: Engineer
 
Join Date: Nov 2002
Location: Herndon, VA
Posts: 378
seanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant futureseanwitte has a brilliant future
Send a message via AIM to seanwitte
Re: User_Bytes taken over by breakers?

Quote:
Originally Posted by kwilliam View Post
What made me think it might be hardwired is that it isn't referenced anywhere in the default code. Did they just forget to take the comments out? If that's the case, will I need to add ".allbits" to bytes 3 through 6 like bytes 1 and 2 have?
I haven't looked at the code, but it might be an artifact from last year. The breaker panel sends updates over the serial port, so the code that handled that updated the user bytes. If you're not using the breaker panel code then you should be able to set the user bytes yourself.
  #8   Spotlight this post!  
Unread 22-01-2007, 10:45
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: User_Bytes taken over by breakers?

The reference to "allbits" is only on the first two user bytes. I think it's that way because the Dashboard Viewer program can show each individual bit of those two user bytes, and there is an associated bit array in the user byte structure that you can use to set those bytes' bits one at a time if you want to.

Don't worry about it. Just set User_Byte1 through User_Byte6 the way you want, make sure nothing else in Default_Routine() is setting them to something you don't want, and everything should work fine.
  #9   Spotlight this post!  
Unread 22-01-2007, 17:33
kwilliam's Avatar
kwilliam kwilliam is offline
Registered User
FRC #1038
 
Join Date: Jan 2007
Location: Ohio
Posts: 8
kwilliam has a spectacular aura aboutkwilliam has a spectacular aura about
Re: User_Bytes taken over by breakers?

Thanks! It works great.
Code:
	//Send camera data to the Dashboard.
	User_Byte1 = CENTROID_X;
	User_Byte2 = CENTROID_Y;
	User_Byte3 = UPPER_X;
	User_Byte4 = UPPER_Y;
	User_Byte5 = LOWER_X;
	User_Byte6 = LOWER_Y;
(We defined aliases for the camera data.)
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
Looking for Picture taken at LA Regional Phil_Lutz Regional Competitions 2 14-04-2004 18:54
pic: this picture was taken on 2/19/04 CD47-Bot Robot Showcase 5 24-02-2004 10:40
Autodesk hath taken pity on us... RachelOfMars 3D Animation and Competition 2 05-04-2003 11:12
firstrobotics.org taken by spammers SlamminSammy General Forum 6 06-10-2002 20:23
Picture taken at nats David Kelly Championship Event 1 22-06-2001 12:25


All times are GMT -5. The time now is 23:51.

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