Skip to content

Commit 7a0422d

Browse files
committed
Added an example to show the new HTTP client in action. Example based on SM_ATOMIC
1 parent 72c9cd2 commit 7a0422d

File tree

18 files changed

+629
-0
lines changed

18 files changed

+629
-0
lines changed
Lines changed: 114 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,114 @@
1+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
2+
Changelog for package sm_atomic
3+
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
4+
5+
Forthcoming
6+
-----------
7+
8+
* creating feature smacc_runtime test
9+
* Merge branch 'master' into melodic-devel
10+
* adding xterm dependency to examples
11+
* Final CbTimer Push
12+
* Merge branch 'master' into melodic-devel
13+
* fixed Doxygen Client Namespaces
14+
* refactoring client namespaces names
15+
* Merge branch 'master' into melodic-devel
16+
* Merge branch 'master' of https://github.com/reelrbtx/SMACC
17+
* Update README.md
18+
* sm_atomic diagrams
19+
* Update README.md
20+
* Update README.md
21+
* Update README.md
22+
* Merge branch 'master' of https://github.com/reelrbtx/SMACC
23+
* Improved sm_atomic
24+
* more formatting & commenting
25+
* renaming runtimeConfiguration to runtimeConfigure
26+
* pushing renaming of runtimeConfigure
27+
* more on smacc behaviors
28+
* Changed static_configure to configure_orthogonal
29+
* unpushed code
30+
* Replaced all smacc::transition's with Transition
31+
* Merge branch 'master' of https://github.com/reelrbtx/SMACC
32+
* Update README.md
33+
* Update README.md
34+
* Adding sm images
35+
* Update README.md
36+
* Update README.md
37+
* Merge branch 'master' of https://github.com/reelrbtx/SMACC
38+
* Update README.md
39+
* adding launch file to sm_atomic
40+
* Renaming transition
41+
* sm dance bot and refactoring namings
42+
* namespaces iteration 3, orthogonal recurrent pattern, more tsts on sm_dance_bot_2
43+
* more refactoring and renaming examples and namespaces
44+
* progressing in the API and testing timers and callbacks
45+
* ros timer client behaviors, refactoring sm_atomic and logic unit hierarchy. other improvements on rosout
46+
* Update README.md
47+
* Update README.md
48+
* Update README.md
49+
* Update README.md
50+
* Update README.md
51+
* Update README.md
52+
* Create README.md
53+
* more naming refactoring in move_base_z_client
54+
* renaming move_base client to ClMoveBaseZ (zorro)
55+
* renaming orthogonals
56+
* more on refactoring renaming
57+
* adding object tagging to clients, specifically action clients
58+
* renaming consistently SmAtomic
59+
* testing countdown logic unit more refactoring and analyzing propagating issue
60+
* Contributors: Brett Aldrich, Pablo Iñigo Blasco, Pabo Iñigo Blasco, Unknown, Víctor Ferrer García, [email protected], brettpac, pablo.inigo.blasco, reelrbtx
61+
62+
* creating feature smacc_runtime test
63+
* Merge branch 'master' into melodic-devel
64+
* adding xterm dependency to examples
65+
* Final CbTimer Push
66+
* Merge branch 'master' into melodic-devel
67+
* fixed Doxygen Client Namespaces
68+
* refactoring client namespaces names
69+
* Merge branch 'master' into melodic-devel
70+
* Merge branch 'master' of https://github.com/reelrbtx/SMACC
71+
* Update README.md
72+
* sm_atomic diagrams
73+
* Update README.md
74+
* Update README.md
75+
* Update README.md
76+
* Merge branch 'master' of https://github.com/reelrbtx/SMACC
77+
* Improved sm_atomic
78+
* more formatting & commenting
79+
* renaming runtimeConfiguration to runtimeConfigure
80+
* pushing renaming of runtimeConfigure
81+
* more on smacc behaviors
82+
* Changed static_configure to configure_orthogonal
83+
* unpushed code
84+
* Replaced all smacc::transition's with Transition
85+
* Merge branch 'master' of https://github.com/reelrbtx/SMACC
86+
* Update README.md
87+
* Update README.md
88+
* Adding sm images
89+
* Update README.md
90+
* Update README.md
91+
* Merge branch 'master' of https://github.com/reelrbtx/SMACC
92+
* Update README.md
93+
* adding launch file to sm_atomic
94+
* Renaming transition
95+
* sm dance bot and refactoring namings
96+
* namespaces iteration 3, orthogonal recurrent pattern, more tsts on sm_dance_bot_2
97+
* more refactoring and renaming examples and namespaces
98+
* progressing in the API and testing timers and callbacks
99+
* ros timer client behaviors, refactoring sm_atomic and logic unit hierarchy. other improvements on rosout
100+
* Update README.md
101+
* Update README.md
102+
* Update README.md
103+
* Update README.md
104+
* Update README.md
105+
* Update README.md
106+
* Create README.md
107+
* more naming refactoring in move_base_z_client
108+
* renaming move_base client to ClMoveBaseZ (zorro)
109+
* renaming orthogonals
110+
* more on refactoring renaming
111+
* adding object tagging to clients, specifically action clients
112+
* renaming consistently SmAtomic
113+
* testing countdown logic unit more refactoring and analyzing propagating issue
114+
* Contributors: Brett Aldrich, Pablo Iñigo Blasco, Pabo Iñigo Blasco, Unknown, Víctor Ferrer García, [email protected], brettpac, pablo.inigo.blasco, reelrbtx
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
cmake_minimum_required(VERSION 2.8.3)
2+
project(sm_atomic_http)
3+
4+
## Find catkin macros and libraries
5+
find_package(catkin REQUIRED smacc ros_timer_client)
6+
7+
include(FetchContent)
8+
FetchContent_Declare(
9+
cpr
10+
GIT_REPOSITORY https://github.com/libcpr/cpr.git
11+
GIT_TAG 6ea2dec23c3df14ac3b27b7d2d6bbff0cb7ba1b0
12+
) # The commit hash for 1.8.1. Replace with the latest from: https://github.com/libcpr/cpr/releases
13+
FetchContent_MakeAvailable(cpr)
14+
15+
###################################
16+
## catkin specific configuration ##
17+
###################################
18+
catkin_package()
19+
20+
###########
21+
## Build ##
22+
###########
23+
set(CMAKE_CXX_STANDARD 14)
24+
add_compile_options(-std=c++11) #workaround for ubuntu 16.04, to extinguish
25+
26+
## Specify additional locations of header files
27+
## Your package locations should be listed before other locations
28+
include_directories(
29+
include
30+
${catkin_INCLUDE_DIRS}
31+
)
32+
33+
## Declare a C++ executable
34+
add_executable(${PROJECT_NAME}_node src/sm_atomic_http_node.cpp)
35+
36+
## Specify libraries to link a library or executable target against
37+
target_link_libraries(${PROJECT_NAME}_node
38+
${catkin_LIBRARIES}
39+
cpr::cpr
40+
)
41+
42+
#############
43+
## Install ##
44+
#############
45+
46+
## Mark executables for installation
47+
install(TARGETS ${PROJECT_NAME}_node
48+
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
49+
)
50+
51+
## Mark other files for installation (e.g. launch and config files, etc.)
52+
install(FILES
53+
launch/sm_atomic.launch
54+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch
55+
)
56+
57+
install(DIRECTORY
58+
config/
59+
DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/config
60+
)
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<h2>State Machine Diagram</h2>
2+
<img src="https://github.com/reelrbtx/SMACC/blob/master/smacc_sm_reference_library/sm_atomic/docs/smacc_state_machine_20200207-004740.dot.svg" width="950" align="center" border="10"/>
3+
4+
<h2>Description</h2> A completely minimal state machine example.<br></br>
5+
<a href="https://reelrbtx.github.io/SMACC_Documentation/master/html/namespacesm__atomic.html">Doxygen Namespace & Class Reference</a>
6+
7+
<h2>Build Instructions</h2>
8+
Before you build, make sure you've installed all the dependencies...
9+
10+
```
11+
rosdep install --from-paths src --ignore-src -r -y
12+
```
13+
14+
Then you build with either catkin build or catkin make...
15+
16+
```
17+
catkin build
18+
```
19+
<h2>Operating Instructions</h2>
20+
After you build, remember to source the proper devel folder...
21+
22+
```
23+
source ~/catkin_ws/devel/setup.bash
24+
```
25+
26+
And then run the launch file...
27+
28+
```
29+
roslaunch sm_atomic sm_atomic.launch
30+
```
31+
32+
<h2>Viewer Instructions</h2>
33+
If you have the SMACC Viewer installed then type...
34+
35+
```
36+
rosrun smacc_viewer smacc_viewer_node.py
37+
```
38+
39+
If you don't have the SMACC Viewer installed, click <a href="http://smacc.ninja/smacc-viewer/">here</a> for instructions.
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
SmAtomicHttp:
2+
signal_detector_loop_freq: 20
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
state_machine_rosparam_ws: /SmAtomicHttp
2+
success_switch:
3+
- type: state_reached
4+
state_name: "sm_atomic_http::State2"
5+
failure_switch:
6+
- type: timeout
7+
duration: 10.0 # sec
Binary file not shown.
Lines changed: 150 additions & 0 deletions
Loading
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#include <smacc/client_bases/smacc_http_client.h>
2+
#include <smacc/smacc.h>
3+
4+
namespace sm_atomic_http {
5+
6+
template <typename TSource, typename TOrthogonal>
7+
struct EvHttp : sc::event<EvHttp<TSource, TOrthogonal>> {};
8+
9+
class ClHttp : public smacc::client_bases::SmaccHttpClient {
10+
public:
11+
ClHttp(const std::string& server, const int& timeout)
12+
: smacc::client_bases::SmaccHttpClient(server, timeout) {}
13+
};
14+
} // namespace sm_atomic_http

0 commit comments

Comments
 (0)