Redshift Project Depot

General Topics => Things we learned and other useful info => Topic started by: Louis L on May 23, 2017, 04:51:57 PM

Title: C++ / Java: Can not conditionally run commands in a command group
Post by: Louis L on May 23, 2017, 04:51:57 PM
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.