Go to Post It doesn't take money, just desire. - BillP [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 14-11-2016, 15:53
phurley67 phurley67 is offline
Programming Mentor
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Michigan
Posts: 62
phurley67 is an unknown quantity at this point
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
Reply With Quote
  #2   Spotlight this post!  
Unread 15-11-2016, 23:55
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,542
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
What do you mean by custom command base?

I've only made components.
Reply With Quote
  #3   Spotlight this post!  
Unread 16-11-2016, 07:01
phurley67 phurley67 is offline
Programming Mentor
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Michigan
Posts: 62
phurley67 is an unknown quantity at this point
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.
Reply With Quote
  #4   Spotlight this post!  
Unread 20-11-2016, 01:32
phurley67 phurley67 is offline
Programming Mentor
FRC #0862 (Lightning Robotics)
Team Role: Mentor
 
Join Date: Apr 2014
Rookie Year: 2013
Location: Michigan
Posts: 62
phurley67 is an unknown quantity at this point
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) {
It seems to work (sorry if my velocity templating is goofy, I just sort of hacked at it till I got it to work). What I really would like to do is provide my own velocity templates for my own components -- any chance of making this a possibility? (or is it and I totally missed it :-)
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 01:12.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi