README
State Machine Diagram
Description
Demonstrates sharing data across multiple states using superstate member variables. A superstate (SsMission) owns initialPosition and targetPosition fields directly. Client behaviors access these fields without a component: they call this->getCurrentState()->getParentState() to navigate up the state hierarchy and dynamic_cast<SsMission*> to obtain the typed superstate pointer — the behavior-accessible equivalent of context<SsMission>() which is available only inside state classes. CbStoreData1 stores the initial position, CbStoreData2 stores the target position, and CbProcessData reads both, computes the Euclidean distance, logs the result, and resets the data for the next cycle.Build Instructions
First, source your ros2 installation.
source /opt/ros/jazzy/setup.bash
Before you build, make sure you’ve installed all the dependencies…
rosdep install --ignore-src --from-paths src -y -r
Then build with colcon build…
colcon build
Operating Instructions
After you build, remember to source the workspace...source install/setup.bash
And then run the launch file…
ros2 launch sm_data_sharing_2 sm_data_sharing_2.launch.py
Viewer Instructions
If you have the SMACC2 Runtime Analyzer installed then type...ros2 run smacc2_rta smacc2_rta
If you don’t have the SMACC2 Runtime Analyzer click here.