Asked — Edited
Resolved Resolved by CochranRobotics!

Converting A String To Integer In Ez Scripting

I am using the plug in for the XV-11 Lidar. The output of the plug in an array in which each value is a string that represents the distance at the angle and the signal strength. To use this for control of the robot, I need numbers at these angles. The format is shown in the attached example. How do I parse and convert this in EZ Scripting into an integer?

In C there is the string.split command

https://msdn.microsoft.com/en-us/library/b873y76a(v=vs.110).aspx

and then the string to integer convert.

Is there a way to do this in the EZ scripting?

User-inserted image


ARC Pro

Upgrade to ARC Pro

With ARC Pro, your robot is not just a machine; it's your creative partner in the journey of technological exploration.

#49  

It is there already kind of. Image rotation setting in the settings will adjust the image. I cant remember if I adjust the variables though. I will need to look at it.

Yes, by default, when I have a bad value, I set it to 0. There is code that the Get Surreal maker is working on that will just not report these points back from the Get Surreal controller. I should see him early next month. I will check with him on where he is with this update and when he thinks it would be complete.

#50  

I could have it register as something like 4000 if there is no returned value. Let me think on that a bit.

I pushed a version that sets the variable to something outside of the range of the LIDAR if the LIDAR doesn't return a value(5000) for that angle. Also, it runs a bit faster now and starts the LIDAR automatically when the com port is activated or when the plugin loads.

This should prevent the first cycle of data from being off as by the time you start the LIDAR, the first set of data has already tried to be passed from the Get Surreal to the computer, but the port isn't open until you click the Start LIDAR button.

#51  

Ok. Thanks. That should show at least a virtual wall or boundary if the Lidar does not see an object at that angle.

#53  

@David, I just got home, been a long day. I will try it in a few. Thanks

#55  

@David, I am win7 loaded new project install Lidar plugin and set to com2 4096 and it is working. Thanks,

Question, I need help watching the variables. At the top it has type, size, and value.

I have many 500s and 600 orate for value, nothing In type. How do I see angles?

Thank you for fixing

#56  

Right after typing my last post my Lidar stop turning and my pic said device not connected, going to down load the getsurreal drive, and try again