|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: paper: Killer Bees BuzzXVI Code and Auto Scripting
As we were looking through the code you gave for auton scripting and the code you used for competetion, we saw that in the scripting example the CreatCommands.vi was outside the Auto_Initalization.vi , but in the code you used at competetion you had the CreatCommand.vi inside the Auto_Initialization.vi. Why is this? Any help would be appreciated, Thanks
![]() |
|
#2
|
|||||
|
|||||
|
Re: paper: Killer Bees BuzzXVI Code and Auto Scripting
The scripting example setup commands and auto init (sensors) as different things. No real reason.
|
|
#3
|
||||
|
||||
|
Re: paper: Killer Bees BuzzXVI Code and Auto Scripting
Ok, We got it working yesterday. I am the mentor, and did not dig into the code, to research the issue we were having, but I wanted to post incase someone else uses the code, and so you know of the issue we tripped up on. It seems there is a problem with passing non-integer data between the script to the code. In our drive straight command, we are choosing the motor speed drive at, the raw -1 to 1 motor speed. So in our script one of the arguments is 0.5 for motor speed.
The code that populates the driver station message box, says that it read 0.5 and everything was good. But when we probed the data in labview, it was either a 0 or a 1. We then made the data in the script 50 and in the adjusted the labview code to divide the speed value by 100, we got it to work and drive at 50% speed as intended. (This was not the only error made this weekend, there were many others that were self imposed. ) I am guessing that the message box is populated with the string values from the script file and not from the converted string to fixed (or interger) data the labview code is seeing. Thanks again for sharing, and responding to all the questions, we now have our torc drive straight auto and wait working in beescript, now to get the turns done. We could not have done it without your help. Scott McBride. |
|
#4
|
||||
|
||||
|
Re: paper: Killer Bees BuzzXVI Code and Auto Scripting
One more question...
Where do you tell the code how many parameters are passed from the script file to the command cluster/array? We added additional data to the drive_strait script file but it does not read back through the dashboard. I was thinking that you would be creating the parameters on the fly from the script file, parsing until the end EOL character was found, but it appears that is not how it works. Scott McBride |
|
#5
|
|||||
|
|||||
|
Re: paper: Killer Bees BuzzXVI Code and Auto Scripting
My guess is that you are exceeding the character limit for the line of the Driver Station and it's getting truncated. That display does not line wrap, it truncates extra characters.
If you open Execute File, there are several VI's which do the actual processing of a file into arrays of lines and later arrays of arguments. I believe the first one is read_auto_file and the second is part of ExecuteCommand. It's never explicitly defined how many arguments to expect. The interpreter passes all arguments to the command and lets each command deal with it - Some do, some don't. For the actual breaking up into lines, it first breaks them up by newline into an array of lines, then FOR's through each item. If it's not a comment or blank line, it executes the command on that line. That VI breaks up the line into an array of strings separated by spaces. The first one is the command name, the rest are arguments. It finds the command with a matching name to the command called, and calls it with an array of arguments. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|