void Robot::set_state_name(const char* name)
{
sched.getActualHandle()->state_name = name;
+ trans_callback();
}
+
+void Robot::trans_callback()
+{
+ if (MAIN == sched.getActualHandle()) {
+ strncpy(robot.orte.fsm_main.state_name, MAIN->state_name, sizeof(robot.orte.fsm_main.state_name));
+ ORTEPublicationSend(robot.orte.publication_fsm_main);
+ } else if (MOTION == sched.getActualHandle()) {
+ strncpy(robot.orte.fsm_motion.state_name, MOTION->state_name, sizeof(robot.orte.fsm_motion.state_name));
+ ORTEPublicationSend(robot.orte.publication_fsm_motion);
+ }
+}
+
#include <iostream>
#include <events.h>
#include <scheduler.hpp>
+#ifndef __LOCAL
#include <robot.h>
#include <cxxabi.h>
-
+#endif
namespace sc = boost::statechart;
namespace mpl = boost::mpl;
public:
TimedState(typename base_type::my_context ctx ) : base_type( ctx ) {
handle_ = base_type::outermost_context().my_handle();
- handle_->state_name = abi::__cxa_demangle(typeid(MostDerived).name(),0,0,&status);
+ #ifndef __LOCAL
+ robot.set_state_name(abi::__cxa_demangle(typeid(MostDerived).name(),0,0,&status));
+ #endif
}
~TimedState() {
if(handle_->timer_list_.timeouts.size()>0 && active_timers.size()>0)
typedef TimedSimpleState base_state;
public:
TimedSimpleState() : handle_owned(false) {
+ #ifndef __LOCAL
robot.set_state_name(abi::__cxa_demangle(typeid(MostDerived).name(),0,0,&status));
+ #endif
}
~TimedSimpleState() {
if(handle_owned)