|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
RobotBuilder Extensions
Reading the documentation I noticed RobotBuilder support extensions. I was able to create a component, with a custom base class.
Now I would like to create a custom command base. Pretty sure at the very least I need different keys in my Java Export.yaml file, and quite likely would want/need custom export files. Before I start reading the source code, I was hoping someone else had already tried this and might be able to share an example. Thanks |
|
#2
|
||||||
|
||||||
|
What do you mean by custom command base?
I've only made components. |
|
#3
|
|||
|
|||
|
Re: RobotBuilder Extensions
Based on what I have seen reading the source YAML. I have been able to create a "TimedCommand". The many of our commands should complete quickly or timeout -- I would like to capture that idea in robot builder and have a timeout parameter. The generated code would include the isFinished command using the timeout parameter.
I have been able to create the timed command in our command palette, and add the timeout parameter, but have not yet been able to customize the code generator for my the timed command. |
|
#4
|
|||
|
|||
|
Re: RobotBuilder Extensions
Okay found my problem (my silly mistake of course) -- I had a typo in the Java Export.yaml and the section name did not match my Command name.
I was able to generate my command, and add parameters, but the ClassName in the YAML is ignored. If I go into the the RobotBuilder source code and make the following changes: Code:
+#macro( klass $cmd )#if( "#type($cmd)" == "" )Command#else#type($cmd)#end#end
import edu.wpi.first.wpilibj.command.Command;
import ${package}.Robot;
/**
*
*/
-public class #class($command.name) extends Command {
+public class #class($command.name) extends #klass($command) {
|
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|