![]() |
command line input...
This is going to sound very very crazy but...
Is there a way for a text input to be taken into the robot from the DS and have it function like a command prompt of sorts, ie. we have a function called runmotorx that takes in a float so we type in runmotorx (float value) and it takes it in and executes it. is something like this done with reasonable ease? hopefully with out 100's of if statements. any ideas on how to do this? |
Re: command line input...
can it be done? yes
is it competition legal? most likely not what would you need to do? lots you would need to manage a socket connection, and listen for incoming data, once you heard the enter key, the proceed to a switch or if's which would get the first word, and call that function (optional), then process the rest of the input and do the function. why you would want this (aside from the coolness factor) is beyond me. unless you have a expert typist, i would not want to control a robot like this this would definitely go in the summer project bin |
Re: command line input...
i was more thinking as a debugging tool, think about it, instead of having to remap buttons to do certain functions especially for debugging you could just type in the command and away you go,
the hangup on me just going off and playing is i have no idea how to evaluate a text input without large amounts of if statements which i was hoping to avoid, as for it being legal, if it was in the bandwidth for the dashboard wouldn't it fall in under the rule of being able to modify that code? |
Re: command line input...
If it is for debugging, why do you need to enter it through the DS? I was planning to develop an interactive debugger through the debug console (i.e. give you a prompt so that you can enter some debugger commands to the robot to do things such as turning on tracing, changing PID constants without recompiling code, dump some important states on demand etc.). But I do not have time to do it this season. So may be a summer project... The only difficult part was to figure out how I can prevent the input go into the cRIO kernel debugger instead of my interactive debugger.
|
Re: command line input...
You could probably bypass the whole socket/command-line thing and have it periodically check the robot's local storage for a text file with a certain name.
Something like Code:
The commands.txt file would just look like <motor channel> <motor power>. i.e. Code:
4 0.5 |
Re: command line input...
the reason for not using a command text file is that it requires a specified format, and order for the inputs, if any functions are added then the function that needs to read in the text file will also have to be changed, and it will always run everything in it, as for the input not having to be on the DS, no it doesn't have to be but i figured that since it already is connected to the robot, it couldn't hurt to use it over another laptop, but in the long run i don't think it matters
|
Re: command line input...
Quote:
What you can do with it is execute the same commands you would execute at the vxWorks shell prompt -- no more. The text file(s) need to be in a file system -- FTP them. It is not junior programmer stuff though and the interpreter doesn't know how to parse floating point arguments :-(. Search through Workbench Help for "shell commands" and "ptyDevCreate'. Unless you are very good *and* willing to work very hard, you probably won't be able to utilize it this year. Consider making it an off season project. I can help you with it -- I have example C code I can share. If you want it, send me an email gvarndell@hotmail.com |
Re: command line input...
willing to work hard check
very good, not so much, Thanks for the help |
Re: command line input...
I've got a web server running on our robot, allows us to change values and stuff like that. No text input at the moment, but doesn't mean you can't extend it to allow it. *Extremely* useful for debugging.
http://code.google.com/p/webdma/ |
Re: command line input...
Surely you are aware of the NetConsole application... it is a C interpreter that allows you to call C entry-points directly. It is not competition legal.
You can also use the dashboard video tcp connection, but that will require you defining your own set of commands (your many if statements). This is competition legal, but more work. |
Re: command line input...
Quote:
Does it parse floating point arguments? It's just a shell with re-wired stdin and stdout, right? |
Re: command line input...
Quote:
|
| All times are GMT -5. The time now is 12:36. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi