Our team is using the .NET (2.0) Composite Dashboard Viewer](http://www.chiefdelphi.com/media/papers/1765) 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:
#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?
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
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.
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.
Not any value. You can’t use 255; it will get changed to 254 on the way through the radio link.
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.
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.
Thanks! It works great.
//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.)