Hey guys!Thanks so much for the great work - this is a great library! :)
Unfortunately, I am running into a problem with namespaces. My states and events are in separate sub-namespaces for readability, like so:
namespace state {
class StateMachineContext;
class LocalizationContext;
class Uninitialized;
class Idle;
class Relocalization;
class Localization;
} // namespace state
namespace event {
class SetMap;
class SetPose;
class Initialize;
class Start;
class Stop;
} // namespace event
My state chart compiles and runs correctly, but fails to generate a visualization with the following error:
../include/localization-state-machine/localization_state_machine.h:80:7: error: Missing react method for event 'Initialize'
class Uninitialized
Quick snippet of some of the relevant code:
namespace state {
class Uninitialized
: public sc::simple_state<Uninitialized, StateMachineContext> {
public:
Uninitialized();
virtual ~Uninitialized() {}
sc::result react(const event::Initialize& event);
void setMap(const event::SetMap& event);
void setPose(const event::SetPose& event);
typedef mpl::list<sc::in_state_reaction<event::SetMap, Uninitialized,
&Uninitialized::setMap>,
sc::in_state_reaction<event::SetPose, Uninitialized,
&Uninitialized::setPose>,
sc::custom_reaction<event::Initialize> > reactions;
};
}
namespace event {
class SetMap : public sc::event<SetMap> {};
class SetPose : public sc::event<SetPose> {};
class Initialize : public sc::event<Initialize> {};
}
I guess this is a problem with how namespaces are resolved? Is there a work around for this issue?
Thanks so much for your help!
Helen