![]() |
Set User Data Help
1 Attachment(s)
I'm trying to send some camera target info back to the driverstation. I'm not sure how to send back the "area %" though.
At first i tried sending it directly through and I would only see a value of 0-1 on the driverstation. I think the area % was actually reading 0.4-0.5 so it may have just been rounding? I tried typecasting it to a 32bit integer. which converted it from a floating point to a big integer number. On the dashboard though, it appears that it is only sending the least significant bits. Is there an easy way to break this number up into an array of 8 bit numbers? Also, what does the little red mark mean on the last input to the build array block and the set user data block? |
Re: Set User Data Help
You don't want to cast a float as an integer. That would give you the bit pattern of a float interpreted as an integer, and it would pretty much be nonsense until cast back as a float. What you really want to do is add the float to the cluster as a float, then everything can be flattened as a TCP string buffer. Back on the PC, you can unflatten and you will receive the exact same values. Then you can display them however you like -- sliders, meters, numerics, graphs, etc.
Greg McKaskle |
| All times are GMT -5. The time now is 10:40. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi