View Single Post
  #10   Spotlight this post!  
Unread 24-04-2016, 20:46
Ben Wolsieffer Ben Wolsieffer is offline
Dartmouth 2020
AKA: lopsided98
FRC #2084 (Robots by the C)
Team Role: Alumni
 
Join Date: Jan 2011
Rookie Year: 2011
Location: Manchester, MA (Hanover, NH)
Posts: 520
Ben Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud ofBen Wolsieffer has much to be proud of
Wink Re: JAVA Command Group Question

Quote:
Originally Posted by Pault View Post
That is an interesting way of doing it. But I still stand by my annoyance with CommandGroups. They are extremely limited in what they can do, and that is a result of the way they are designed. Sure there are some clever workarounds like that which can make it do things it normally cant, but the fact that you need to be that clever just to make any sort of decision live is a huge flaw. There are plenty of other ways they could have been designed to avoid these problems. Over the summer I decided to code my own version, and my way of working around these problems was simply to put the execution of the CommandGroup on a separate thread, that way the method could be run live and actually iterate through the code in real time instead of just throwing a bunch of commands in a queue.

Right now the code is has a couple of bugs in certain edge cases, but I hope to release it publicly soon.
This is kind of getting off topic, but my solution to this problem is to use Double/Boolean/WhateverSuppliers for the parameters, rather than passing the actual values. Since we are using Java 8, I just pass a lambda or method reference into the constructor. This adds a little complexity to the command code, but gains a lot of flexibility. For example, it makes it possible to update a parameter while the command is running.
__________________



2016 North Shore District - Semifinalists and Excellence in Engineering Award
2015 Northeastern University District - Semifinalists and Creativity Award
2014 Granite State District - Semifinalists and Innovation in Control Award
2012 Boston Regional - Finalists
Reply With Quote