Coder Social home page Coder Social logo

robosoft-ai / smacc Goto Github PK

View Code? Open in Web Editor NEW
288.0 288.0 50.0 16.91 MB

An Event-Driven, Asynchronous, Behavioral State Machine Library for ROS (Robotic Operating System) applications written in C++

Home Page: https://smacc.dev

License: BSD 3-Clause "New" or "Revised" License

CMake 19.60% C++ 77.66% Python 1.46% Dockerfile 0.50% Shell 0.58% C 0.20%
c-plus-plus mobile-robots navigation ros ros-packages state-machine statechart

smacc's People

Contributors

brettpac avatar pabloinigoblasco avatar rbtchun3 avatar reelrobotics avatar tylerjw avatar vicfergar avatar yassiezar avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

smacc's Issues

remove boilerplate comments from cmake files

What are your thoughts on removing some of the boilderplate commented out sections from the cmake files in the examples? This would make reading those cmake files much easier because we could remove all the stuff that is not used in the example ros package.

I could make an example PR for this so you know what I'm suggesting. Would that be useful/welcome?

Any support to smacc_action_server_client.h ?

Hi, I am planning to do GUI that interacts with the state machine with action call. However, currently there is no action_server client available in SMACC, or am I missing something? Alternative would be to have another interface that receives the action call from the GUI and interacts with the state machine through service call.

Any suggestion are welcome. Thanks!

┆Issue is synchronized with this Jira Task by Unito
┆Link To Issue: https://robosoft-ai.atlassian.net/browse/SMACC1-4

Build failing

I tried to do the intro tutorial . But smacc does not build on my machine and I cannot figure out the problem. I am running ros noetic on wsl2 with ubuntu 20.04. Can you help me with the problem?

$ catkin build
----------------------------------------------------------
Profile:                     default
Extending:          [cached] /opt/ros/noetic
Workspace:                   /home/bauma/catkin_ws
----------------------------------------------------------
Build Space:        [exists] /home/bauma/catkin_ws/build
Devel Space:        [exists] /home/bauma/catkin_ws/devel
Install Space:      [unused] /home/bauma/catkin_ws/install
Log Space:          [exists] /home/bauma/catkin_ws/logs
Source Space:       [exists] /home/bauma/catkin_ws/src
DESTDIR:            [unused] None
----------------------------------------------------------
Devel Space Layout:          linked
Install Space Layout:        None
----------------------------------------------------------
Additional CMake Args:       None
Additional Make Args:        None
Additional catkin Make Args: None
Internal Make Job Server:    True
Cache Job Environments:      False
----------------------------------------------------------
Buildlisted Packages:        None
Skiplisted Packages:         None
----------------------------------------------------------
Workspace configuration appears valid.
----------------------------------------------------------
[build] Found '49' packages in 0.0 seconds.                                                                                                                                                                
[build] Package table is up to date.                                                                                                                                                                       
Starting  >>> forward_global_planner                                                                                                                                                                       
Starting  >>> forward_local_planner                                                                                                                                                                        
Starting  >>> move_eye_client                                                                                                                                                                              
Starting  >>> pure_spinning_local_planner                                                                                                                                                                  
Finished  <<< move_eye_client                                  [ 0.2 seconds ]                                                                                                                             
Finished  <<< forward_global_planner                           [ 1.9 seconds ]                                                                                                                             
Starting  >>> backward_global_planner                                                                                                                                                                      
Finished  <<< forward_local_planner                            [ 2.3 seconds ]                                                                                                                             
Starting  >>> backward_local_planner                                                                                                                                                                       
Finished  <<< pure_spinning_local_planner                      [ 2.9 seconds ]                                                                                                                             
Finished  <<< backward_global_planner                          [ 2.7 seconds ]                                                                                                                             
Starting  >>> smacc_msgs                                                                                                                                                                                   
Starting  >>> undo_path_global_planner                                                                                                                                                                     
Finished  <<< backward_local_planner                           [ 2.9 seconds ]                                                                                                                             
Finished  <<< smacc_msgs                                       [ 4.6 seconds ]                                                                                                                                                                                                                                                      
Starting  >>> smacc                                                                                                                                                                                        
Finished  <<< undo_path_global_planner                         [ 5.4 seconds ]                                                                                                                             
Starting  >>> smacc_runtime_test                                                                                                                                                                           
Finished  <<< smacc                                            [ 2.1 seconds ]                                                                                                                             
Starting  >>> battery_monitor_client                                                                                                                                                                       
Starting  >>> eg_conditional_generator                                                                                                                                                                     
Starting  >>> eg_random_generator                                                                                                                                                                          
Finished  <<< smacc_runtime_test                               [ 1.0 seconds ]                                                                                                                             
Starting  >>> keyboard_client                                                                                                                                                                              
Finished  <<< battery_monitor_client                           [ 0.5 seconds ]                                                                                                                             
Starting  >>> microstrain_mips_client                                                                                                                                                                      
Finished  <<< keyboard_client                                  [ 0.4 seconds ]                                                                                                                             
Finished  <<< eg_random_generator                              [ 1.9 seconds ]                                                                                                                             
Starting  >>> move_base_z_client_plugin                                                                                                                                                                    
Starting  >>> move_group_interface_client                                                                                                                                                                  
Finished  <<< eg_conditional_generator                         [ 1.9 seconds ]                                                                                                                             
Starting  >>> multirole_sensor_client                                                                                                                                                                      
Finished  <<< multirole_sensor_client                          [ 0.3 seconds ]                                                                                                                             
Starting  >>> ros_publisher_client                                                                                                                                                                         
Finished  <<< ros_publisher_client                             [ 0.4 seconds ]                                                                                                                             
___________________________________________________________________________________________________________________________________________________________________________________________________________
Errors     << microstrain_mips_client:cmake /home/bauma/catkin_ws/logs/microstrain_mips_client/build.cmake.004.log                                                                                         
CMake Warning (dev) at CMakeLists.txt:2 (project):
  Policy CMP0048 is not set: project() command manages VERSION variables.
  Run "cmake --help-policy CMP0048" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The following variable(s) would be set to empty:

    CMAKE_PROJECT_VERSION
    CMAKE_PROJECT_VERSION_MAJOR
    CMAKE_PROJECT_VERSION_MINOR
    CMAKE_PROJECT_VERSION_PATCH
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package):
  Could not find a package configuration file provided by "microstrain_mips"
  with any of the following names:

    microstrain_mipsConfig.cmake
    microstrain_mips-config.cmake

  Add the installation prefix of "microstrain_mips" to CMAKE_PREFIX_PATH or
  set "microstrain_mips_DIR" to a directory containing one of the above
  files.  If "microstrain_mips" provides a separate development package or
  SDK, be sure it has been installed.
Call Stack (most recent call first):
  CMakeLists.txt:10 (find_package)


cd /home/bauma/catkin_ws/build/microstrain_mips_client; catkin build --get-env microstrain_mips_client | catkin env -si  /usr/bin/cmake /home/bauma/catkin_ws/src/SMACC/smacc_client_library/microstrain_mips_client --no-warn-unused-cli -DCATKIN_DEVEL_PREFIX=/home/bauma/catkin_ws/devel/.private/microstrain_mips_client -DCMAKE_INSTALL_PREFIX=/home/bauma/catkin_ws/install; cd -

...........................................................................................................................................................................................................
Failed     << microstrain_mips_client:cmake                    [ Exited with code 1 ]                                                                                                                      
Failed    <<< microstrain_mips_client                          [ 5.2 seconds ]                                                                                                                             
Abandoned <<< ros_timer_client                                 [ Unrelated job failed ]                                                                                                                    
Abandoned <<< smacc_rviz_plugin                                [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sr_all_events_go                                 [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sr_conditional                                   [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sr_event_countdown                               [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_atomic_cb                                     [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_coretest_transition_speed_1                   [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_coretest_x_y_1                                [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_coretest_x_y_2                                [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_coretest_x_y_3                                [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_fetch_screw_loop_1                            [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_fetch_six_table_pick_n_sort_1                 [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_fetch_two_table_pick_n_place_1                [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_fetch_two_table_whiskey_pour                  [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_ridgeback_barrel_search_1                     [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_ridgeback_barrel_search_2                     [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_subscriber                                    [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_update_loop                                   [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_atomic                                        [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_atomic_services                               [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_calendar_week                                 [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_ferrari                                       [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_packml                                        [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_respira_1                                     [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_starcraft_ai                                  [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_three_some                                    [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_viewer_sim                                    [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_dance_bot                                     [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_dance_bot_2                                   [ Unrelated job failed ]                                                                                                                    
Abandoned <<< sm_dance_bot_strikes_back                        [ Unrelated job failed ]                                                                                                                    
Finished  <<< move_base_z_client_plugin                        [ 3.9 seconds ]                                                                                                                             
___________________________________________________________________________________________________________________________________________________________________________________________________________
Errors     << move_group_interface_client:make /home/bauma/catkin_ws/logs/move_group_interface_client/build.make.004.log                                                                                   
/home/bauma/catkin_ws/src/SMACC/smacc_client_library/move_group_interface_client/src/move_group_interface_client/client_behaviors/cb_move_end_effector_trajectory.cpp: In member function ‘cl_move_group_interface::ComputeJointTrajectoryErrorCode cl_move_group_interface::CbMoveEndEffectorTrajectory::computeJointSpaceTrajectory(moveit_msgs::RobotTrajectory&)’:
/home/bauma/catkin_ws/src/SMACC/smacc_client_library/move_group_interface_client/src/move_group_interface_client/client_behaviors/cb_move_end_effector_trajectory.cpp:69:28: error: ‘moveit_msgs::GetPositionIKRequest_<std::allocator<void> >::_ik_request_type’ {aka ‘struct moveit_msgs::PositionIKRequest_<std::allocator<void> >’} has no member named ‘attempts’
   69 |             req.ik_request.attempts = 20;
      |                            ^~~~~~~~
make[2]: *** [CMakeFiles/move_group_interface_client.dir/build.make:180: CMakeFiles/move_group_interface_client.dir/src/move_group_interface_client/client_behaviors/cb_move_end_effector_trajectory.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:239: CMakeFiles/move_group_interface_client.dir/all] Error 2
make: *** [Makefile:141: all] Error 2
cd /home/bauma/catkin_ws/build/move_group_interface_client; catkin build --get-env move_group_interface_client | catkin env -si  /usr/bin/make --jobserver-auth=3,4; cd -

...........................................................................................................................................................................................................
Failed     << move_group_interface_client:make                 [ Exited with code 2 ]                                                                                                                      
Failed    <<< move_group_interface_client                      [ 12.6 seconds ]                                                                                                                            
[build] Summary: 18 of 49 packages succeeded.                                                                                                                                                              
[build]   Ignored:   None.                                                                                                                                                                                 
[build]   Warnings:  None.                                                                                                                                                                                 
[build]   Abandoned: 30 packages were abandoned.                                                                                                                                                           
[build]   Failed:    2 packages failed.                                                                                                                                                                    
[build] Runtime: 27.1 seconds total.

State machine crashes on state transitions

This seems to be caused by state reactors and client behaviours that are destructed while their callback functions are running.

Is there a way to prevent such scenarios?
For custom objects it is possible to use mutexes to circumvent the issue, but for standard objects such as 'sr_all_events_go' this is less than ideal.

Compiling SMACC

Hi guys,

I tried to follow your Getting Started video, but I am getting a lot of problems at the compiling part.
Please see my log below and let me know if you've encountered similar problems.

Catkin Build Summary
[build] Summary: 4 of 50 packages succeeded.
[build] Ignored: None.
[build] Warnings: None.
[build] Abandoned: 42 packages were abandoned.
[build] Failed: 4 packages failed.
[build] Runtime: 1 minute and 34.7 seconds total.
[build] Note: Workspace packages have changed, please re-source setup files to use them.

Actual Log
[build] Found '49' packages in 0.0 seconds.
[build] Updating package table.
Starting >>> catkin_tools_prebuild
Finished <<< catkin_tools_prebuild [ 2.0 seconds ]
Starting >>> forward_global_planner
Starting >>> move_eye_client
Starting >>> pure_spinning_local_planner
Starting >>> smacc_msgs
Finished <<< move_eye_client [ 2.0 seconds ]
Finished <<< smacc_msgs [ 8.9 seconds ]
Starting >>> smacc
Starting >>> smacc_runtime_test
Starting >>> smacc_rviz_plugin


Errors << pure_spinning_local_planner:make /home/evangelos/Desktop/catkin_smacc/logs/pure_spinning_local_planner/build.make.000.log
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/pure_spinning_local_planner.dir/src/pure_spinning_local_planner/pure_spinning_local_planner.cpp.o] Error 4
make[1]: *** [CMakeFiles/pure_spinning_local_planner.dir/all] Error 2
make: *** [all] Error 2
cd /home/evangelos/Desktop/catkin_smacc/build/pure_spinning_local_planner; catkin build --get-env pure_spinning_local_planner | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed << pure_spinning_local_planner:make [ Exited with code 2 ]
Failed <<< pure_spinning_local_planner [ 19.4 seconds ]
Abandoned <<< backward_global_planner [ Unrelated job failed ]
Abandoned <<< backward_local_planner [ Unrelated job failed ]
Abandoned <<< forward_local_planner [ Unrelated job failed ]
Abandoned <<< battery_monitor_client [ Unrelated job failed ]
Abandoned <<< eg_conditional_generator [ Unrelated job failed ]
Abandoned <<< eg_random_generator [ Unrelated job failed ]
Abandoned <<< keyboard_client [ Unrelated job failed ]
Abandoned <<< microstrain_mips_client [ Unrelated job failed ]
Abandoned <<< move_base_z_client_plugin [ Unrelated job failed ]
Abandoned <<< move_group_interface_client [ Unrelated job failed ]
Abandoned <<< multirole_sensor_client [ Unrelated job failed ]
Abandoned <<< ros_publisher_client [ Unrelated job failed ]
Abandoned <<< ros_timer_client [ Unrelated job failed ]
Abandoned <<< sm_atomic_cb [ Unrelated job failed ]
Abandoned <<< sm_coretest_transition_speed_1 [ Unrelated job failed ]
Abandoned <<< sm_coretest_x_y_1 [ Unrelated job failed ]
Abandoned <<< sm_coretest_x_y_2 [ Unrelated job failed ]
Abandoned <<< sm_coretest_x_y_3 [ Unrelated job failed ]
Abandoned <<< sm_fetch_screw_loop_1 [ Unrelated job failed ]
Abandoned <<< sm_fetch_six_table_pick_n_sort_1 [ Unrelated job failed ]
Abandoned <<< sm_fetch_two_table_pick_n_place_1 [ Unrelated job failed ]
Abandoned <<< sm_fetch_two_table_whiskey_pour [ Unrelated job failed ]
Abandoned <<< sm_ridgeback_barrel_search_1 [ Unrelated job failed ]
Abandoned <<< sm_ridgeback_barrel_search_2 [ Unrelated job failed ]
Abandoned <<< sm_update_loop [ Unrelated job failed ]
Abandoned <<< sm_atomic [ Unrelated job failed ]
Abandoned <<< sr_all_events_go [ Unrelated job failed ]
Abandoned <<< sm_calendar_week [ Unrelated job failed ]
Abandoned <<< sm_ferrari [ Unrelated job failed ]
Abandoned <<< sm_packml [ Unrelated job failed ]
Abandoned <<< sm_respira_1 [ Unrelated job failed ]
Abandoned <<< sm_starcraft_ai [ Unrelated job failed ]
Abandoned <<< sm_three_some [ Unrelated job failed ]
Abandoned <<< sm_viewer_sim [ Unrelated job failed ]
Abandoned <<< sr_conditional [ Unrelated job failed ]
Abandoned <<< sr_event_countdown [ Unrelated job failed ]
Abandoned <<< sm_dance_bot [ Unrelated job failed ]
Abandoned <<< sm_dance_bot_2 [ Unrelated job failed ]
Abandoned <<< sm_dance_bot_strikes_back [ Unrelated job failed ]
Abandoned <<< sm_ridgeback_floor_coverage_dynamic_1 [ Unrelated job failed ]
Abandoned <<< sm_ridgeback_floor_coverage_static_1 [ Unrelated job failed ]
Abandoned <<< undo_path_global_planner [ Unrelated job failed ]


Errors << forward_global_planner:make /home/evangelos/Desktop/catkin_smacc/logs/forward_global_planner/build.make.000.log
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/forward_global_planner.dir/src/forward_global_planner.cpp.o] Error 4
make[1]: *** [CMakeFiles/forward_global_planner.dir/all] Error 2
make: *** [all] Error 2
cd /home/evangelos/Desktop/catkin_smacc/build/forward_global_planner; catkin build --get-env forward_global_planner | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed << forward_global_planner:make [ Exited with code 2 ]
Failed <<< forward_global_planner [ 27.3 seconds ]


Errors << smacc:make /home/evangelos/Desktop/catkin_smacc/logs/smacc/build.make.000.log
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/smacc.dir/src/smacc/client.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/smacc.dir/src/smacc/common.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/smacc.dir/src/smacc/client_bases/smacc_action_client.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/smacc.dir/src/smacc/components/cp_ros_control_interface.cpp.o] Error 4
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/smacc.dir/src/smacc/introspection/string_type_walker.cpp.o] Error 4
make[1]: *** [CMakeFiles/smacc.dir/all] Error 2
make: *** [all] Error 2
cd /home/evangelos/Desktop/catkin_smacc/build/smacc; catkin build --get-env smacc | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed << smacc:make [ Exited with code 2 ]
Failed <<< smacc [ 1 minute and 18.4 seconds ]
Finished <<< smacc_runtime_test [ 1 minute and 21.6 seconds ]


Errors << smacc_rviz_plugin:make /home/evangelos/Desktop/catkin_smacc/logs/smacc_rviz_plugin/build.make.000.log
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/smacc_rviz_plugin.dir/src/smacc_rviz_display.cpp.o] Error 4
make[2]: *** Waiting for unfinished jobs....
c++: internal compiler error: Killed (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See file:///usr/share/doc/gcc-7/README.Bugs for instructions.
make[2]: *** [CMakeFiles/smacc_rviz_plugin.dir/smacc_rviz_plugin_autogen/mocs_compilation.cpp.o] Error 4
make[1]: *** [CMakeFiles/smacc_rviz_plugin.dir/all] Error 2
make: *** [all] Error 2
cd /home/evangelos/Desktop/catkin_smacc/build/smacc_rviz_plugin; catkin build --get-env smacc_rviz_plugin | catkin env -si /usr/bin/make --jobserver-fds=6,7 -j; cd -
...............................................................................
Failed << smacc_rviz_plugin:make [ Exited with code 2 ]
Failed <<< smacc_rviz_plugin [ 1 minute and 23.4 seconds ]

Best regards,
Evangelos.

OK, I found the problem

OK, I found the problem. Basically, when SMACC walks through the state machine and follows transitions among the various states, it uses a function named getTypeInfoFromType, which then makes a string of the type name and calls getTypeInfoFromString. Transition types are things like this:

smacc::transition<pickpal_controller_interface::EvGoalReceived<pickpal_msgs::SpatulaGripperControlAction_<std::allocator > >, pickpal_controller_interface::StReceivedSpatulaGoal, smacc::default_transition_name, boost::statechart::detail::no_context<pickpal_controller_interface::EvGoalReceived<pickpal_msgs::SpatulaGripperControlAction_<std::allocator > > >, &boost::statechart::detail::no_context<pickpal_controller_interface::EvGoalReceived<pickpal_msgs::SpatulaGripperControlAction_<std::allocator > > >::no_function>

and it goes through and identifies all the more basic type names (like, "smacc::default_transition_name", or "std::allocator", and starts making a little database of each type, replacing it with a little symbol... so it might take std::allocator and replace it with "$T0". It does this kind of recursively, so maybe pickpal_controller_interface::EvGoalReceived<pickpal_msgs::SpatulaGripperControlAction_<std::allocator > >
will become
pickpal_controller_interface::EvGoalReceived<pickpal_msgs::SpatulaGripperControlAction_<$T0 > >
which then becomes
pickpal_controller_interface::EvGoalReceived<$T1 >
and finally:
$T2
where there's a list of what $T0, $T1, and $T2 replace.

The problem came when you went over 10 replacements. When you have $T10, your code was replacing $T10 with (the value of $T1)0. This caused bad things, eventually resulting in a crash.

I'll try to put together a pull request tomorrow with the change. Right now, I'm been at work for 14 hours and I'm kind of burned out. Once I fixed it, though, the crash went away.

Credit to Mr. Bob Pitha for this ticket

GPG ERROR when installing smacc-viewer

Environment

  • amd64 PC
  • Ubuntu2004

Behavior

When I execute cmd

curl -s  https://b0e12e65a4f16bfc4594206c69dce2a49a5eabd04efb7540:@packagecloud.io/install/repositories/reelrbtx/SMACC_viewer/script.deb.sh  | sudo bash

I ran into such error output.

W: GPG error: https://packagecloud.io/reelrbtx/SMACC_viewer/ubuntu focal InRelease: The following signatures couldn't be verified because the public key is not available: NO_PUBKEY F504394FF0062D60
E: The repository 'https://packagecloud.io/reelrbtx/SMACC_viewer/ubuntu focal InRelease' is not signed.
N: Updating from such a repository can't be done securely, and is therefore disabled by default.
N: See apt-secure(8) manpage for repository creation and user configuration details.
N: Usage of apt_auth.conf(5) should be preferred over embedding login information directly in the sources.list(5) entry for 'https://packagecloud.io/reelrbtx/SMACC_viewer/ubuntu'

Comment

  1. How to solve this installation problem?
  2. Is there aarch64 version of smacc-viewer?

Thanks!

migrate to github actions for CI

Would you like me to make a PR to migrate the CI from travis to github actions? We have migrated the moveit repos to github actions as travis has gotten slower and slower and github actions is much more nicely integrated into github.

CMake Error

Following the Getting Started Tutorial, when I have to compile the workspace (after using rosdep install) I get the following error:

`
CMake Error at /opt/ros/melodic/share/catkin/cmake/custom_install.cmake:13 (_install):
_install TARGETS given target "opencv_perception_node" which does not exist
in this directory.
Call Stack (most recent call first):
SMACC/smacc_sm_reference_library/sm_ridgeback_barrel_search_1/CMakeLists.txt:111 (install)

CMake Error at SMACC/smacc_sm_reference_library/sm_ridgeback_barrel_search_2/CMakeLists.txt:92 (add_executable):
add_executable cannot create target "opencv_perception_node" because
another target with the same name already exists. The existing target is
an executable created in source directory
"/home/davide/catkin_ws/src/SMACC/smacc_sm_reference_library/sm_ridgeback_barrel_search_1".
See documentation for policy CMP0002 for more details.
`

And tons of related error cause opencv_perception_node is not build.

I'm running ROS Melodic, using an empty workspace.

SMACC for noetic

ROSDEP does not install dependencies.

rosdep install --from-paths src --ignore-src -r -y

ERROR: the following packages/stacks could not have their rosdep keys resolved
to system dependencies:
sm_fetch_six_table_pick_n_sort_1: Cannot locate rosdep definition for [fetch_navigation]
sm_dance_bot: Cannot locate rosdep definition for [ridgeback_navigation]
sm_dance_bot_2: Cannot locate rosdep definition for [ridgeback_navigation]
sm_ridgeback_barrel_search_2: Cannot locate rosdep definition for [ridgeback_navigation]
sm_fetch_two_table_pick_n_place_1: Cannot locate rosdep definition for [fetch_navigation]
sm_dance_bot_strikes_back: Cannot locate rosdep definition for [ridgeback_navigation]
sm_ridgeback_barrel_search_1: Cannot locate rosdep definition for [ridgeback_navigation]
microstrain_mips_client: Cannot locate rosdep definition for [microstrain_mips]
sm_fetch_two_table_whiskey_pour: Cannot locate rosdep definition for [fetch_navigation]
Continuing to install resolvable dependencies...
#All required rosdeps installed successfully

Any solution ?

Transition back to previous state using history

Hi, I have a state, stateA, which is accessible from nearly every other state, stateB, stateC, etc. (similar to the recovery and operation ModeStates from the SmDanceBot examples). However, I'd like to implement a transition from stateA back to whichever state it transitioned in from - kind of like an interrupt state. For example,

stateB -> stateA -> stateB
stateB -> stateC -> stateA -> stateC

etc.

I've tried using the ModeStates from the DanceBot examples, but it looks like the transition back into the run modestate takes you to the pre-defined initial state, i.e. StAquireSensors, which isn't quite what I'm looking for. I also considered using a universally-accessible component which basically stores the previous state and allows it to be transitioned into. This doesn't seem like the most elegant solution though, so I was wondering if there was some other way to do this by possibly leveraging the deep_history stored by Boost::StateChart? I'm not too familiar with that library so not entirely sure how to proceed there either

Fast state transition caused segfault

Hey,

I got the error while spamming smacc with button press ros messages to trigger fast state transitions,
```__pthread_mutex_lock: Assertion `mutex->__data.__owner == 0' failed

I wonder if any has seen this and possible way to debug this.

[BUG] Linux output redirection causes segfault.

This odd_manager_node is a SMACC-based ros node that handles system error of robotics.

/home/nvidia/catkin_ws_drivers/devel/lib/odd_manager/odd_manager_node > /dev/null 2>&1
Segmentation fault

Any Idea of avoiding this?

Thanks.

SMACC Viewer License

Hello,

This is not really an issue but a question regarding the license of the SMACC viewer. Sorry if this is not the appropriate place to post this question but I really couldn't find anywhere else:

The SMACC Viewer's license agreement mentions that a license may be purchased in the case of commercial use, can I please get more information regarding this?

Regards,
Omar

┆Issue is synchronized with this Jira Task by Unito
┆Link To Issue: https://robosoft-ai.atlassian.net/browse/SMACC1-2

Possible race condition in smacc::run

The "signalDetector" thread might reference the state machine before it is really created.
(You might never notice this issue, it is usually innocuous)

The signalDetector Loop should not start until the state machine is fully created.
However, keep in mind that the signaldetector should be created before the state machine.

Order:

  • create signal detector
  • create state machine (it initializes the signal detector)
  • start state machine loop (in the main ros thread)
//create a thread for the asynchronous state machine processor execution
boost::thread otherThread(boost::bind(&sc::fifo_scheduler<>::operator(), &scheduler1, 0));

// use the  main thread for the signal detector component (waiting actionclient requests)
signalDetector.pollingLoop();

Research about dynamic memory allocation in smacc-core for realtimeness

Research/review the smacc core code to check if there are places where we are using dynamic memory allocation and fix them with static memory allocation or using c++ allocators.

One of the places that should be reviewed is the usage of client_behaviors vectors inside orthogonals where there might be some dynamic memory allocation.

The current plan is to setup some fixed number of client behaviors per state (or allocating dynamically at startup a maximum number of client behaviors per state)

SMACC viewer -> Current state not highlighted?

Hello!

I am using SMACC with the SMACC viewer on ros noetic. The sm_atomic demo runs fine, but the current state is not highlighted in the SMACC viewer on the left side of the viewer. Transitions are shown in the trnasition log however.

Any idea how I can fix this?

Thanks!

Keyboard Orthogonal Issue

Action server result events may happen out of the scope of the original state request.

For example:
We are located in state S1 and we make a request to the MoveBaseActionClient. We are waiting the result, but meanwhile some other event (ie: keyboard event) make us transit to the next state S2.

The issue then appears: S2 is also dependent on the Actionserver result, it also makes a call to the MoveBaseActionClient. Some undeterministic behavior may happen:

- We may get an action server result of preempt for the first request (in this case could not be a problem for many applications)

 - Nonetheless there is a race condition. The success result of the request made in State S1 could happen before we make the request from S2 to the moveBase action server, then the transition from S2 to S3 would happen. (non expected behavior)

We may have several solutions to this. For instance:

  • Should (navigation) SubstateBehaviors such as (forward, backward, rotate) cancel the request to the moveBase action server onExit before we leave to the next state?
    some solution could be some code like this:

void onInitialize()
{
auto rotateBehavior = new SbRotate(/30/-90)
rotateBehavior.cancelAliveMotionRequestOnExit = true; // by default is false
this->configure(rotateBehavior);
}

if we are in on SbRotate::onExit function and we know that the request we did in SbRotate::onEntry is still alive, then we make another request to cancel (probably we need to block the main thread to avoid more problems in S2)

Another solution is the following:
The solution is located in the MoveBaseAction client, it is able to know if there is an open request alive. If that is the case and it receives another new motion request then: it must send a cancel request to the movebase action server and wait to that cancellation (blocking the thread), then send the second request.

A third option (based in second option) that would skip the need of blocking the main thread would be to create a queue of requests. If there is a motion request in process and it receives a new motion request we enqueue the second one. Without blocking the main thread we send a cancel message to cancel the first request (meanwhile we may be already in state S2). When the cancel request is totally accepted, then the movebaseactionclient send the second request (associated to state S2) and the process continues seamlessly.

compile error while calling function

in tutorial(https://github.com/reelrbtx/SMACC#creatingaccessing-to-smacccomponents
compile error in line this->requiresComponent(moveBaseClient_); like below

error: no matching function for call to ‘smacc_tutorial::BaseStateMachine::requiresComponent(smacc::SmaccMoveBaseActionClient*&, ros::NodeHandle&, std::__cxx11::string&, bool&)’
     base_type::outermost_context().requiresComponent(storage, nh, value, verbose);

...

error: no matching function for call to ‘processTransition(boost::statechart::transition<smacc::EvActionResult<smacc::SmaccMoveBaseActionClient>, smacc_tutorial::State2>*&, std::shared_ptr<smacc::SmaccStateInfo>&)’
     processTransition(dummy, sourceState);

could you please fix this bag

How to use orthogonal lines?

How can one use multiple parallel orthogonal lines in a SMACC state machine as illustrated below?

https://github.com/pabloinigoblasco/SMACC/blob/master/documentation/orthogonal_lines.png?raw=true

I tried using the examples from here but they don't seem to work.

Updatable loop occasionally fails to start

Issue:

I have an updatable client behaviour defined which is activated within the state machine's initial state. However, I've noticed that the update loop occasionally fails to begin getting called and the update callback is never entered. This seems to be totally random and I'm not able to trigger it manually

Analysis:

I've taken a look at the update loop here and noticed that, at times, the client behaviour table is updated here before all the client behaviours have finished being added and initialised. Then, at the next loop when the CBs have actually been added, the table is not updated (since now lastState_ == currentState) and no update() functions can be executed. The log output below shows the behaviour I'm talking about where the CB table is updated to soon:

...
[ INFO] [1658248892.188056645]: [sm::StRest] Configuring orthogonal: sm::OrHttp
[ INFO] [1658248892.188219663]: [PollOnce] current state: 2
[ INFO] [1658248892.188328821]: [PollOnce] last state: 0
[ INFO] [1658248892.188391033]: [PollOnce] detected new state, refreshing updatable client behavior table
[ INFO] [1658248892.188716652]: updatable state elements: 0
[ INFO] [1658248892.188908727]: [Orthogonal sm::OrHttp] adding client behavior: sm::CbRobotStatusUpdate
[ INFO] [1658248892.189014429]: [sm::StRest] Creating static client behavior: sm::CbAthenaTeleopActivate
[ INFO] [1658248892.189069920]: [sm::StRest] Configuring orthogonal: sm::OrAthena
[ INFO] [1658248892.189136324]: [Orthogonal fox_rt::OrAthena] adding client behavior: fox_rt::CbAthenaTeleopActivate
[ INFO] [1658248892.189194567]: [sm::StRest] ---- END STATIC DESCRIPTION
[ INFO] [1658248892.189241322]: [sm::StRest] State runtime configuration
[ INFO] [1658248892.189299437]: [Orthogonal sm::OrAthena] runtimeConfigure, current Behavior: sm::CbAthenaTeleopActivate
[ INFO] [1658248892.189358129]: [Orthogonal sm::OrHttp] runtimeConfigure, current Behavior: sm::CbRobotStatusUpdate
[ INFO] [1658248892.189444054]: [Orthogonal sm::OrTeleop] runtimeConfigure, current Behavior: sm::CbTeleopActivate
[ WARN] [1658248892.189534459]: [StateMachine] setting state active : sm::MsAutonomousOperationMode/sm::StRest
[ INFO] [1658248892.189664259]: [sm::StRest] State OnEntry
[ WARN] [1658248892.189789194]: Required client [sm::ClTeleopSafeStopService] not found in current orthogonal. Searching in other orthogonals.
[ WARN] [1658248892.189890032]: Required client [sm::ClTeleopSafeStopService] found in other orthogonal.
[ WARN] [1658248892.189974741]: Brakes already active
[ INFO] [1658248892.190018167]: In rest state
[ INFO] [1658248892.190064186]: [sm::StRest] State OnEntry code finished
[ INFO] [1658248892.190115645]: [Orthogonal sm::OrAthena] OnEntry, current Behavior: sm::CbAthenaTeleopActivate
[ INFO] [1658248892.190658684]: [StateMachine] life-time constrained smacc signal subscription created. Subscriber is sm::CbAthenaTeleopActivate
[ INFO] [1658248892.190730497]: [Orthogonal sm::OrFollowMe] OnEntry
[ INFO] [1658248892.190783524]: [Orthogonal sm::OrFrontZedCamera] OnEntry
[ INFO] [1658248892.190879113]: [Orthogonal sm::OrGpio] OnEntry
[ INFO] [1658248892.190928492]: [Orthogonal sm::OrHttp] OnEntry, current Behavior: sm::CbRobotStatusUpdate
[ INFO] [1658248892.191234302]: [StateMachine] life-time constrained smacc signal subscription created. Subscriber is sm::CbRobotStatusUpdate
[ INFO] [1658248892.191296961]: [Orthogonal sm::OrMapping] OnEntry
[ INFO] [1658248892.191341444]: [Orthogonal sm::OrNavigation] OnEntry
[ INFO] [1658248892.191384166]: [Orthogonal sm::OrRearZedCamera] OnEntry
[ INFO] [1658248892.191426505]: [Orthogonal sm::OrRfid] OnEntry
[ INFO] [1658248892.191468683]: [Orthogonal sm::OrScales] OnEntry
[ INFO] [1658248892.191517230]: [Orthogonal sm::OrTeleop] OnEntry, current Behavior: fox_rt::CbTeleopActivate
[ INFO] [1658248892.192057838]: [StateMachine] life-time constrained smacc signal subscription created. Subscriber is sm::CbTeleopActivate
[ INFO] [1658248892.192154355]: [Orthogonal sm::OrTimer] OnEntry
[ WARN] [1658248892.192233112]: [StateMachine] setting state active : sm::MsAutonomousOperationMode/sm::StRest
[ INFO] [1658248892.238259719]: [PollOnce] current state: 2
[ INFO] [1658248892.238412271]: [PollOnce] last state: 2
[ INFO] [1658248892.238478035]: updatable state elements: 0
[ INFO] [1658248892.288266301]: [PollOnce] current state: 2
...

Possible fix:

I'm not sure how to approach this. My guess is that the checks here should prevent this behaviour, but its not doing so reliably (at least in this case). The workaround we're using is to start a timer at the CB's initialisation which executes a state transition back into the state to recreate everything, if the timer isn't stopped within an allotted time.

┆Issue is synchronized with this Jira Task by Unito

Using a std::function as a callback signal

At the moment, message callbacks are handled by defining a function to receive a message and create a boost signal by passing said function and its attached parent object. Is there any way to define the callback as a std::function variable instead and register it as a callback with the signal manager instead? This would make it a bit less verbose to write a simple 1-line functions that fires a state transition event, for example.

┆Issue is synchronized with this Jira Task by Unito
┆Link To Issue: https://robosoft-ai.atlassian.net/browse/SMACC1-3

States, Topics & Data Structures

Hi,

I had a look at sm_fetch_six_table_pick_n_sort_1 and the sm_atomic of the reference library and want to ask you a few questions about their functionalities.

  1. sm_atomic: I want to create a naive publisher (e.g. publish an int array) in state_1, where should I do it? As the state comes in the form of the header file, I cannot initialize a ros node handler there, right?
  2. sm_fetch_six_table_pick_n_sort_1 : You store the moveit plan in a moveit_msgs/DisplayTrajectory.msg, however moveit usually saves it in the RobotTrajectory component of the above data structure. Why do you use the above message and not the RobotTrajectory one? I'm referring particularly at the /move_group/display_generated_plan topic.
  3. sm_fetch_six_table_pick_n_sort_1 : How does the moveit client translate the generated plan into joint movement in you gazebo simulation? Can you please point me at the specific part of the code?

Thank you!

SMACC vs BT

Hi, I would like to start a discussion with SMACC vs BTs and have the opportunity to show my point. I am afraid you have been using BTs in the wrong context.

I consider the points that you raised up in the webpage here:

Orthogonality/Concurrency

I agree that having concurrent actions that need to be synchronized represents a challenge (and it is my current research interest now), however, I fail to see where SMACC is better than BTs in these contexts. In particular, you clam:

What happens when you have 26 orthogonals, corresponding to 26 physical subsystems, say on a military uav. Are you going to run 26 processes and deal with all the interprocess communication? How would you debug such a system, and the inevitable race conditions that would almost certainly arise?

It is my firm belief that this will not work because it will not scale

Will it scale with SMACC?

Recovery Modes/States

  • How do you handle recovery sequences?

    • I need an example here, but I would put a Fallback operator of the two subtrees: the one for the nominal behavior and the one for the recovery behavior. But with an example, I think I can be more precise.
    • How would you with SMACC?
  • Do you put them in the beginning of the cycle, or the end?

    • I would like to see an example (also with the SMACC design).
  • if it’s at the beginning, how is this going to be fast, since you loop through it every time?

    • I am not sure what do you mean by that. We can consider a recovery behavior as a subtree (with a higher priority than the nominal behavior) with guarding conditions as the BT. Where the guarding conditions represent the conditions under which the recovery routine has to kick in.
  • How do you handle orthogonals again? – see above

    • The problem is when you have non-orthogonal concurrent executions.

Behavior Trees and Gaming

Actually, I see a lot of similarity at the behavior level between complex robots and NPC. Sure, the actuations and sensing capability are different, but at the deliberation layer they both have to act and react to unexpected changes in the environment.

Where are the robots?

I also had issues with finding public references for that. Companies don't expose their know-how. I found a few examples:

Readability

From the web page

Try an experiment out for yourself. Find someone, who has never taken a computer science course in their life, and ask them a question like…

“How do you bake a cake?”

I think you are using the wrong example here. I would not use a BT for a static sequence of actions (or I would use simple BT formed by a sequence with memory with all the actions or a FSM).

Performance

And, I don’t think the condition based flow (polling) lends itself to high performance, vis a vis an event-based system. Particularly in asynchronous environments.

That depends on the implementation. However, also in FSM, you need to poll conditions to verify if it has to jump to another state (with the additional problem that you must ensure that the conditions are mutually exclusive, otherwise you get an undefined behavior).

States really do exist

Again from your page:

In the final analysis, it should be obvious that although they are a mental construct, states really do exist…

  • In an airplane, you’re either in the air or on the ground
  • A car is either moving, or its not
  • A handgun is either loaded, or it’s not
  • Your mother-in-law has either joined you for dinner, or she hasn’t

You actually stated conditions that could be either true or false.

In BT you don't pretend that state does not exist, you consider only what matters. Take your first example "In an airplane, you’re either in the air or on the ground": you check the condition "if it is in the air" and not really the state. Depending on the state space representation, if you are sitting in the Business or Economy class can be represented as different states.

Conclusions

To conclude, I think SMACC and BT have to be used for different problems (BT to model the robot deliberation that needs to react to several system changes and SMACC to model linear action sequencing). However, since you raised up some downsides of BTs, I would be really happy to see how SMACC outperforms them.

Regards

Michele Colledanchise

┆Issue is synchronized with this Jira Task by Unito
┆Link To Issue: https://robosoft-ai.atlassian.net/browse/SMACC1-7

SMACC Viewer does not show the currently active state

I'm running SMACC on Ubuntu 20.04 using ROS noetic. I was trying to run the examples, and even though the state machine itself seems to be working fine, I cannot see the currently active state on the viewer.

image

I have installed SMACC Viewer using apt (sudo apt-get install ros-noetic-smacc-viewer) but I also had to install wx manually using sudo pip install -U wxPython. Please let me know if I can assist with something else.

Any plan to release arm64 deb packages?

Hi,

First I want to say it's a great work for statemachines with ROS.

And I wonder if there is any plan to provide arm64 based deb packages so we can deploy it into arm based systems like NVIDIA Jetson devices.

SMACC Viewer For Ubuntu20.04

hello ,now I can run smacc in 20.04 by delete some client and modify the boost.But I alse want to use SMACC Viewer in 20.04.Can you release version 20.04?

Doxygen not updating...

Hi Pablo,
The doxygen builds are being pushed through anymore..

  • If you go into the ghpages branch, master folder, the last push was on 3/1

  • If you look at the folder renaming I did (state_machine_templates for instance), they are not showing up in doxygen (which is displaying the old name.

  • I made some updates to the doxyfile (related to types of graphs produced by doxygen), and I made some edits to the gh-pages.sh script, (also related to the types of graphs produced by doxygen), where I needed to have graphviz on the TRAVIS CI build in order to create the graphs in question (dot graphs).
    Anyways, but if you go into the Travis Dashboard, and view the raw logs, everything I did seems to be working (dot graphs are being produced, caller graphs are being produced).

One potential issue, look at gh-pages.sh, line 15, and you'll see a reference to your fork and not this repo.

ClientBehavior life-cycle parameters (overriding client parameters)

This issue discuss about the need of a feature about "configuring client and component parameters from client behaviors".

Some questions arise: How we can override the configuration of some parameter of a client temporally via client behaviors? How a client could provide an optional parameter override default values?

Optional parameters of a client
A client represents some "permanent state element". We may want to configure some specific parameter permanently. We face this in the following way:

When a client is developed with some optional parameter, it should be declared as a boost::optional (or std::optional in higher versions) class attribute of the client or the component.

Optional parameters on client behaviors
This can be done manually using on entry and on exit functions. for example: (https://github.com/reelrbtx/SMACC/blob/master/smacc_client_library/move_base_z_client/move_base_z_client_plugin/src/client_behaviors/cb_navigate_forward.cpp)

More thoughts

This is a a very interesting feature about a problem we needed to face several times creating ad-hoc solutions. A navigation example:

  • We want to navigate to some point in the map, but some specific motion must be done with some kind of goal precision.

The idea is simple: we want to be able to modify the parameters of a client or a component dynamically

A client behavior overrides (during its lifetime) the value of some parameter of a client (or a component).

The possible combinations are wide. Some examples:

  • The client have an optional parameter, that can set by the user. If not set, some default value is used.

  • The client have an optional parameter. A client behavior changes some optional parameter of the client during its lifetime.

  • The client behavior could also have optional parameters that also overwrites optional parameters of the client.

  • Both, the client optional parameter and the client behavior parameters are set (some kind of precedence should be used, IMO: CBs overrites Clients)

  • A client behavior changes something (not one of the optional parameters) in the state of the client during its lifecycle. The state should be reseted back to the original state.


We propose a pattern that could/should be enough for a wide of complicated scenarios.

Issue running SMACC atomic demo on melodic

Hi I was following the getting started tutorial and faced issue running the atomic example. The following error,
smacc_runtime_test_node-3] process has died [pid 27462, exit code 255, was printed after running roslaunch sm_atomic sm_atomic.launch

In addition, smacc_viewer_node, have both wxversion 2.8 is not installed, installed versions are ['3.0-gtk3'] error message, and an exception with the following trace output:

Exception in thread Thread-6: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner self.run() File "/usr/lib/python2.7/threading.py", line 754, in run self.__target(*self.__args, **self.__kwargs) File "/opt/ros/melodic/lib/smacc_viewer/smacc_viewer_node.py", line 1914, in _update_server_list self.select_state_machine(state_machine_names[0]) File "/opt/ros/melodic/lib/smacc_viewer/smacc_viewer_node.py", line 1963, in select_state_machine newtransitionhistory = self.transition_log_history_srv[server_name]() File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 442, in __call__ return self.call(*args, **kwds) File "/opt/ros/melodic/lib/python2.7/dist-packages/rospy/impl/tcpros_service.py", line 532, in call raise ServiceException("transport error completing service call: %s"%(str(e))) ServiceException: transport error completing service call: receive_once[/SmAtomic/smacc/transition_log_history]: DeserializationError cannot deserialize: unknown error handler name 'rosmsg'
I wonder if there is any solution for this? Thanks

[Question] How to use CbDefaultPublishLoop?

Hi,

Help Needed.

I am tring to send rosmsg for 10 hz loop, and find CbDefaultPublishLoop in SMACC/smacc_client_library/, and I did not find

  • any example to send a msg
  • any example showing how to change the loop HZ.

I only find one line of code, It seems that this feature was not finished?

https://github.com/reelrbtx/SMACC/blob/65cea9471f84daf5eb2f10649be2e7e3c1a2bb9f/smacc_sm_reference_library/sm_packml/include/sm_packml/states/st_aborting.h#L24

Could you give this feature a guide for this repo?

Thanks @pabloinigoblasco

University project

I am a student and I am writing my diploma project about BTs and also about SMACC. I do not know a lot about SMACC even though I tried examining your documentation and tutorials. Is there any possibility that You could help me and explain to me how to create a simple state machine using SMACC. I am supposed to create two state machines: one- very simple just to show the transitions between states (example of opening a fridge and getting a drink from it), two - more complicated state machine working on a simulation of a robot (for example pick and place). I would be very thankful for any help from You.

Events have unknown source

Hi,

I noticed that, in the smacc viewer, all events have an unknown source. This makes debugging and visualising virtually impossible, especially for large state-machines.

I noticed that the command line info output for the state information structure does not contain any of the following elements:

  • Event Source
  • Event ObjectTag
  • Event Label

Any ideas on this issue? (I am using the noetic-devel branch by the way)

Thanks!

Below is the output for StiState1 in the sm_three_some_node example, but the behaviour is not limited to this example alone.

[ INFO][/sm_three_some][1634634724.076027382]: **** State: sm_three_some::SS1::sm_three_some::inner_states::StiState1
**** State: sm_three_some::SS1::sm_three_some::inner_states::StiState1
Index: 5
StateLevel:
 Childstates:
 Transitions:
 - Transition.
      - Index: 0
      - Transition Name: smacc::default_transition_tags::CONTINUELOOP
      - Transition Type: smacc::default_transition_tags::CONTINUELOOP
      - Event Type :smacc::default_events::EvLoopContinue
      - Event Source:
      - Event ObjectTag:
      - Event Label:
      - Destiny State: sm_three_some::SS1::sm_three_some::inner_states::StiState2
      - Owner State: sm_three_some::SS1::sm_three_some::inner_states::StiState2
      - Is History Node: 0
      - TransitionC++Type: smacc::Transition<smacc::default_events::EvLoopContinue<sm_three_some::SS1::sm_three_some::inner_states::StiState1>, sm_three_some::S S1::sm_three_some::inner_states::StiState2, smacc::default_transition_tags::CONTINUELOOP, boost::statechart::detail::no_context<smacc::default_events::EvLoopContinue<sm_three_some::SS1::sm_three_some::inner_states::StiState1> >, &boost::statechart::detail::no_context<smacc::default_events::EvLoopContinue<sm_three_some::SS1::sm_three_some::inner_states::StiState1> >::no_function>
      - EventC++Type: smacc::default_events::EvLoopContinue<sm_three_some::SS1::sm_three_some::inner_states::StiState1>                                                                                                                                                                           
 Orthogonals:
 - orthogonal: sm_three_some::OrKeyboard
          - NO Client BEHAVIORS -
          - client: cl_keyboard::ClKeyboard
 - orthogonal: sm_three_some::OrSubscriber
          - NO Client BEHAVIORS -
          - client: sm_three_some::cl_subscriber::ClSubscriber
 - orthogonal: sm_three_some::OrTimer
          - NO Client BEHAVIORS -
          - client: cl_ros_timer::ClRosTimer
 - orthogonal: sm_three_some::OrUpdatablePublisher
          - NO Client BEHAVIORS -
          - client: cl_ros_publisher::ClRosPublisher
 State event generators:
 State reactors:
- NO STATE REACTORS -

Not compiling the sm_atomic and other code examples

Hello,

Somehow when running catkin_make I have compiling errors with the sm_atomic example and probably the others:

In file included from /usr/include/boost/statechart/fifo_scheduler.hpp:13,
from /usr/include/boost/statechart/asynchronous_state_machine.hpp:12,
from /home/user/Workspace/ws_catkin/src/SMACC/smacc/include/smacc/common.h:11,
from /home/user/Workspace/ws_catkin/src/SMACC/smacc/include/smacc/smacc.h:7,
from /home/user/Workspace/ws_catkin/src/SMACC/smacc_sm_reference_library/sm_atomic/include/sm_atomic/sm_atomic.h:1,
from /home/user/Workspace/ws_catkin/src/SMACC/smacc_sm_reference_library/sm_atomic/src/sm_atomic_node.cpp:1:

/usr/include/boost/statechart/processor_container.hpp: In instantiation of ‘void boost::statechart::processor_container<Scheduler, WorkItem, Allocator>::create_processor_impl1(const processor_holder_ptr_type&, const boost::statechart::processor_container<Scheduler, WorkItem, Allocator>::processor_context&, Arg1) [with Processor = sm_atomic::SmAtomic; Arg1 = smacc::SignalDetector*; Scheduler = boost::statechart::fifo_scheduler<boost::statechart::fifo_worker<std::allocator >, std::allocator >; WorkItem = boost::function0; Allocator = std::allocator; boost::statechart::processor_container<Scheduler, WorkItem, Allocator>::processor_holder_ptr_type = boost::shared_ptr<std::auto_ptr<boost::statechart::event_processor<boost::statechart::fifo_scheduler<boost::statechart::fifo_worker<std::allocator >, std::allocator > > > >]’:
/usr/include/boost/statechart/processor_container.hpp:136:20: required from ‘WorkItem boost::statechart::processor_container<Scheduler, WorkItem, Allocator>::create_processor(boost::statechart::processor_container<Scheduler, WorkItem, Allocator>::processor_handle&, Scheduler&, Arg1) [with Processor = sm_atomic::SmAtomic; Arg1 = smacc::SignalDetector*; Scheduler = boost::statechart::fifo_scheduler<boost::statechart::fifo_worker<std::allocator >, std::allocator >; WorkItem = boost::function0; Allocator = std::allocator; boost::statechart::processor_container<Scheduler, WorkItem, Allocator>::processor_handle = boost::weak_ptr<std::auto_ptr<boost::statechart::event_processor<boost::statechart::fifo_scheduler<boost::statechart::fifo_worker<std::allocator >, std::allocator > > > >]’
/usr/include/boost/statechart/fifo_scheduler.hpp:62:17: required from ‘boost::statechart::fifo_scheduler<FifoWorker, Allocator>::processor_handle boost::statechart::fifo_scheduler<FifoWorker, Allocator>::create_processor(Arg1) [with Processor = sm_atomic::SmAtomic; Arg1 = smacc::SignalDetector*; FifoWorker = boost::statechart::fifo_worker<std::allocator >; Allocator = std::allocator; boost::statechart::fifo_scheduler<FifoWorker, Allocator>::processor_handle = boost::weak_ptr<std::auto_ptr<boost::statechart::event_processor<boost::statechart::fifo_scheduler<boost::statechart::fifo_worker<std::allocator >, std::allocator > > > >]’
/home/linuxsocke/Nextcloud/Workspace/ws_catkin/src/SMACC/smacc/include/smacc/smacc_signal_detector.h:89:42: required from ‘void smacc::run() [with StateMachineType = sm_atomic::SmAtomic]’
/home/linuxsocke/Nextcloud/Workspace/ws_catkin/src/SMACC/smacc_sm_reference_library/sm_atomic/src/sm_atomic_node.cpp:9:37: required from here
/usr/include/boost/statechart/processor_container.hpp:324:44:
error: no matching function for call to ‘sm_atomic::SmAtomic::SmAtomic(const boost::statechart::processor_container<boost::statechart::fifo_scheduler<boost::statechart::fifo_worker<std::allocator >, std::allocator >, boost::function0, std::allocator >::processor_context&, smacc::SignalDetector*&)’
324 | *pProcessor = processor_holder_type( new Processor( context, arg1 ) );

Is this version issue with boost? I am using Ubnunt 20.04 with ros-noetic.

When checking my boost is says:
libboost-all-dev is already the newest version (1.71.0.0).

Side note: Currently looking for a state machine and I am impressed by your work and effort 👍

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.