tue-robotics-graveyard / robot_smach_states

A library of smach states and state machine using the robot_skills API
2 stars 1 forks source link

VariableDesignators: Make clear which states sets the variable and which only read them #40

Closed LoyVanBeek closed 8 years ago

rokusottervanger commented 9 years ago

Do you mean by naming conventions?

LoyVanBeek commented 9 years ago

Nope, was working on making variable designators unwritable unless explicitly marked as writeable.

rokusottervanger commented 9 years ago

What exactly would you do with an unwritable variable designator?

2015-08-26 13:10 GMT+02:00 Loy notifications@github.com:

Nope, was working on making variable designators unwritable unless explicitly marked as writeable.

— Reply to this email directly or view it on GitHub https://github.com/tue-robotics/robot_smach_states/issues/40#issuecomment-134950019 .

LoyVanBeek commented 9 years ago

Just get data from it, as you would with any designator. But to write to it, the writing state has to have the variable explicitly as writeable. In your code, you can see exactly which states then write to any VariableDesignator and which just read. Suggestions welcome.

rokusottervanger commented 9 years ago

So when one state needs to write to a designator, and a second one needs to read that information, the designator should be writable, right? If that's the case, could you give an example of a situation where a designator should not be writable?

LoyVanBeek commented 9 years ago

Well, the reader does not need to know that a designator is a VariableDesignator or whatever. Only the writer must know that it can write, and should check that it is writeable. Readers should only check the resolve_type.