• Welcome to Redshift Project Depot.
 

C++ / Java: Can not conditionally run commands in a command group

Started by Louis L, May 23, 2017, 04:51:57 PM

Previous topic - Next topic

Louis L

Got this from Brayden; followed up searching on Chief Delphi.

It seems command groups are constructed once when the robot first starts. This means the command group can not obtain an external value at a later time (ex: read a sensor value) and then conditionally do something based on that value. Values must be set when the command group is constructed; not later. The same command group object is reused each time it is called (ex: in response to a button press). The workaround for this is to create multiple command groups and externally execute the conditional which then fires off the correct command group.