Based off of the example code, I’ve gotten our gyro and rangefinder to work in separate codes. However, I am having troubles combining them into one code as Set High Priority User Data only accepts one input, and you cannot use more than one.
I’ve tried sending the output from the rangefinder to the User Messages section of the Driver’s Station. I saw jumbled characters constantly updating when I had linked the output to a string flattener before the Send User Message, and saw nothing when I linked the output directly to Send User Message.
You can combine data from multiple places using a Cluster Bundle, and then flatten the cluster for the high priority dashboard data.
For the user messages, it expects a string. However, the flatten to string isn’t what you want. It takes the number, converts it to binary, and sends it. You should use the format into string, which takes a number like 10, and coverts it to a string “10”. I hope that’s understandable.
Let’s focus on using a Cluster Bundle. Where would I find such a tool? I can’t find it under WPI or Data Manipulation, but I might just be blind.
So, if I wire in data from our Gyro and Rangefinder to the Cluster Bundle, flatten it, and ship it off into the high priority data, how do I separate the Gyro data from the Rangefinder data once I unflatten the string?
The by name versions are nice if you create a .ctl with your cluster as a typedef, which you’ll want to do once you start adding more things to the dashboard, but is overboard for just two items.
Yes, you need the flatten to string after the bundle, before the flatten from string. On the dashboard side, you’ll need to create a “fake” cluster to feet into the unflatten from string, so that it knows how to decode the string.
That is a bundle by name. It requires an input cluster, defining the potential names of the elements of the cluster. The bundle by name can only used on elements with names in the cluster, unnamed elements are ignored. You can replace that with a bundle if you do not want to define a specific cluster. I would recommend using cluster saved as a typedef. This allows the dashboard project to use the same control, and be automatically updated when the cluster is updated, upon the next opening of the project.
I’ve replaced the bundle by name with a plain old bundle. Now, I need to know how to unflatten and unbundle the data within the dashboard. I’ve tried pumping the high user data into unbundle, but that didn’t do it.
You are getting closer. Technically that will should work, but I wouldn’t recommend it, because it is a bit convolved. Here is a small example I just threw together. I used non-typedef’d clusters for portability, but I would highly recommend using typedefs. I try to never use clusters without making them a typedef, it always pays off. The cluster is contains arbitrary data, replace the contents of that cluster at will.
Sending to the driver station:
Reading that data back:
EDIT: These pictures are snippets, and can be dragged onto a LV block diagram. (Firefox requires dragging to disk first, then to LV)