Skip to content

Latest commit

 

History

History
58 lines (42 loc) · 954 Bytes

actioncpp.md

File metadata and controls

58 lines (42 loc) · 954 Bytes

Action Server Client C++ Implementation

CMakeLists.txt file modifications

Open session4_action/CMakeLists.txt and add following lines to the bottom of the file.

add_executable(ac_server src/ac_server.cpp)
target_link_libraries(ac_server ${catkin_LIBRARIES})
add_dependencies(ac_server ${session4_action_EXPORTED_TARGETS})


add_executable(ac_client src/ac_client.cpp)
target_link_libraries(ac_client ${catkin_LIBRARIES})
add_dependencies(ac_client ${session4_action_EXPORTED_TARGETS})

Build the code

Go to root of the workspace

cd ~/ros_workshop/
catkin build

or

catkin_make

Run the code

Open a terminal and run,

roscore

Open a 2nd terminal in the workspace root and run,

source devel/setup.bash
rosrun session4_action ac_server

Open a 3rd terminal in the workspace root and run,

source devel/setup.bash
rosrun session4_action ac_client