You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Section 8 (v2, rev 1) of the white paper talks about the "Command Bus":
Toast comes with a simple CommandBus implementation. The Command Bus is an interface
that takes in data from the Command Line (or a remote console) and passes it to Toast or the
appropriate module to be processed. This means modules can register their own commands
that invoke and action when used.
I'd like to cause inputs on the simulator to change through external manipulation so that my code can respond to those changes. It sounds like this is what the Command Bus can do, but it's not clear how to access it.
Two questions:
Is my understanding of the purpose of the Command Bus correct?
How can I gain access the Command Bus interface? For example, should I try to ssh into the simulator? (have tried, but don't know port/username/password)
I've successfully installed ToastAPI on Ubuntu 16.04 using Eclipse, can run the simulator, and have written a few simple modules, all following the tutorials. But I'm new to programming the RoboRio, so it's possible I'm missing something obvious.
You are correct, you can use the command bus in that manner. You can access
the command bus either through STDIN on the simulator, or running the gradlew toastConsole command on your development machine.
To add your own commands, see the registration functions in the CommandBusclass. They must implement AbstractCommand, and examples can
be found in the jaci.openrio.toast.core.command package.
Section 8 (v2, rev 1) of the white paper talks about the "Command Bus":
Toast comes with a simple CommandBus implementation. The Command Bus is an
interface
that takes in data from the Command Line (or a remote console) and passes
it to Toast or the
appropriate module to be processed. This means modules can register their
own commands
that invoke and action when used.
I'd like to cause inputs on the simulator to change externally so that my
code can respond to those changes. It sounds like this is what the Command
Bus can do, but it's not clear how to access it.
Two questions:
Is my understanding of the purpose of the Command Bus correct?
How can I gain access the Command Bus interface? For example,
should I try to ssh into the simulator? (have tried, but don't know
port/username/password)
I've successfully installed ToastAPI on Ubuntu 16.04 using Eclipse, can
run the simulator, and have written a few simple modules, all following the
tutorials. But I'm new to programming the RoboRio, so it's possible I'm
missing something obvious.
while the simulator was running (launched from Eclipse).
I got back:
Trying to override old definition of datatype scp
Trying to override old definition of datatype sshexec
:toastConsole
Attempting via Hostname roboRIO-1000-frc.local...
Client Disconnected
> Building 0% > :toastConsole
I get the same message regardless of the phase the simulator is in (Disabled, Autonomous, Teleop, Test).
Do I need to configure my hosts file or change something else to make the roboRIO-1000-frc.local domain active?
You can access the command bus either through STDIN ...
Is that possible through Eclipse? If not, how would I run the project is such a way that I can enter commands through STDIN?
Regarding the second point, I think I've found the answer. Just type commands into the bottom "Console" window in Eclipse (looks read-only, but it will take commands).
Using the help command I can see various commands through list, but none appear to be aimed at directly causing inputs to change value. Would this be something I need to add myself through a subclass of AbstractCommand? If so, are there any examples you can point me to? I found the four AbstractCommand subclasses in the jaci.openrio.toast.core.command package, but they don't seem to be aimed at manipulating inputs.
Regarding the second point, I think I've found the answer. Just type
commands into the bottom "Console" window in Eclipse (looks read-only, but
it will take commands).
Using the help command I can see various commands through list, but none
appear to be aimed at directly causing inputs to change value. Would this
be something I need to add myself through a subclass of AbstractCommand? If
so, are there any examples you can point me to? I found the four
AbstractCommand subclasses in the jaci.openrio.toast.core.command
package, but they don't seem to be aimed at manipulating inputs.
If you want to change inputs, you will need to write your own command. All
the variables you need to change will be located in the SimulationData
class
Regarding the second point, I think I've found the answer. Just type
commands into the bottom "Console" window in Eclipse (looks read-only, but
it will take commands).
Using the help command I can see various commands through list, but none
appear to be aimed at directly causing inputs to change value. Would this
be something I need to add myself through a subclass of AbstractCommand? If
so, are there any examples you can point me to? I found the four
AbstractCommand subclasses in the jaci.openrio.toast.core.command
package, but they don't seem to be aimed at manipulating inputs.
If you want to change inputs, you will need to write your own command. All
the variables you need to change will be located in the SimulationData
class
Regarding the second point, I think I've found the answer. Just type
commands into the bottom "Console" window in Eclipse (looks read-only, but
it will take commands).
Using the help command I can see various commands through list, but
none appear to be aimed at directly causing inputs to change value. Would
this be something I need to add myself through a subclass of
AbstractCommand? If so, are there any examples you can point me to? I found
the four AbstractCommand subclasses in the
jaci.openrio.toast.core.command package, but they don't seem to be
aimed at manipulating inputs.
This makes a bit more sense now - thanks. I'm able to change values using the static setX methods on SimulationData. I'll look into making a few Commands.
The ToastAPI document states: "For example, a team may use the CommandBus to define the layout of the Outer Works in the 2016 Stronghold Tournament (hint, hint)."
That sounds intriguing, but I'm not sure I follow. Can you point me to a simple example that would illustrate using the Command Bus to define a "layout" of a game field? I'm somewhat familiar with Stronghold.
Aside from what's outlined in the "Contributing to Toast" document, are there any requirements around unit tests or some other QA for pull requests?
We used the CommandBus to set the outerworks layout this year in our code, but the change was later reverted in favour of a WebUI. The arguments passed to the invokeCommand method can be used to gather arguments for the command (i.e. if I type myCommand someText someOtherText, the args parameter will be an array of [someText, someOtherText]. With some clever code, this can be used to configure the layout of the Outer Works before a match, if your autonomous relies on it.
There are no other requirements around contributing to Toast. I leave it with good faith in the community that if the initial travis build passes, and I give it a quick lookover that the PR is good to go.
Activity
JaciBrunning commentedon May 27, 2016
You are correct, you can use the command bus in that manner. You can access
the command bus either through STDIN on the simulator, or running the
gradlew toastConsolecommand on your development machine.To add your own commands, see the registration functions in the
CommandBusclass. They must implementAbstractCommand, and examples canbe found in the
jaci.openrio.toast.core.commandpackage.On Fri, 27 May 2016 10:48 Richard Apodaca notifications@github.com wrote:
rapodaca commentedon May 27, 2016
Thanks for the quick response.
In my project, I tried:
while the simulator was running (launched from Eclipse).
I got back:
I get the same message regardless of the phase the simulator is in (Disabled, Autonomous, Teleop, Test).
Do I need to configure my hosts file or change something else to make the roboRIO-1000-frc.local domain active?
Is that possible through Eclipse? If not, how would I run the project is such a way that I can enter commands through STDIN?
rapodaca commentedon May 27, 2016
Regarding the second point, I think I've found the answer. Just type commands into the bottom "Console" window in Eclipse (looks read-only, but it will take commands).
Using the
helpcommand I can see various commands throughlist, but none appear to be aimed at directly causing inputs to change value. Would this be something I need to add myself through a subclass of AbstractCommand? If so, are there any examples you can point me to? I found the four AbstractCommand subclasses in thejaci.openrio.toast.core.commandpackage, but they don't seem to be aimed at manipulating inputs.JaciBrunning commentedon May 27, 2016
Yup, toastConsole is for a roborio connection. The eclipse console window
is STDIN for simulation
On Fri, 27 May 2016 13:26 Richard Apodaca notifications@github.com wrote:
JaciBrunning commentedon May 27, 2016
If you want to change inputs, you will need to write your own command. All
the variables you need to change will be located in the SimulationData
class
On Fri, 27 May 2016 14:00 Jaci Brunning jaci.brunning@gmail.com wrote:
JaciBrunning commentedon May 27, 2016
If you like, submit a pull request to Toast if you want to add the command
into the toast core
On Fri, 27 May 2016 14:02 Jaci Brunning jaci.brunning@gmail.com wrote:
rapodaca commentedon May 27, 2016
This makes a bit more sense now - thanks. I'm able to change values using the static setX methods on SimulationData. I'll look into making a few Commands.
The ToastAPI document states: "For example, a team may use the CommandBus to define the layout of the Outer Works in the 2016 Stronghold Tournament (hint, hint)."
That sounds intriguing, but I'm not sure I follow. Can you point me to a simple example that would illustrate using the Command Bus to define a "layout" of a game field? I'm somewhat familiar with Stronghold.
Aside from what's outlined in the "Contributing to Toast" document, are there any requirements around unit tests or some other QA for pull requests?
JaciBrunning commentedon May 27, 2016
We used the CommandBus to set the outerworks layout this year in our code, but the change was later reverted in favour of a WebUI. The arguments passed to the
invokeCommandmethod can be used to gather arguments for the command (i.e. if I typemyCommand someText someOtherText, theargsparameter will be an array of [someText,someOtherText]. With some clever code, this can be used to configure the layout of the Outer Works before a match, if your autonomous relies on it.There are no other requirements around contributing to Toast. I leave it with good faith in the community that if the initial travis build passes, and I give it a quick lookover that the PR is good to go.