-
Write a basic code in ROS 2 writing an action server and the action client. However, the service request is received by subscribing a topic. If the topic is published at higher rate, it should be able to abort the previous goal and send a new one. The action server should wait for 5 seconds before succeeding and any abortion within 5 seconds should be properly handled
-
Write a generic subscriber that can subscribe to a topic of any message type. Write different publishers to test the code, whenever it receives a message from a topic, print also the type of message that is received
Currently Project is TESTED AND IMPLEMENTED ON ROS2 HUMBLE
- Follow the steps to build the project
mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src git clone https://github.com/Tanishq30052002/action-mux-ros2.git <!-- Third Party Lib from OSRF --> git clone https://github.com/osrf/dynamic_message_introspection.git cd ~/ros2_ws colcon build <!-- Add the following command in you setup.zsh/setup.bashrc --> source ~/ros2_ws/install/setup.bash ## For bash users source ~/ros2_ws/install/setup.zsh ## For zsh users
-
Follow the steps to run the TASK - 1
<!-- Terminal - 1 (Action Server) --> ros2 run calculator run_server_calculate <!-- Terminal - 2 (Action Client) --> ros2 run calculator run_client_calculate ### without feedback printing ros2 run calculator run_client_calculate --ros-args --log-level calculator_action_client:=DEBUG ### with feedback printing <!-- Terminal - 3 (Goal Publisher) --> ros2 run calculator run_calculator_goal_publisher <TIME_DIFF_BETWEEN_2_GOALS in secs>
-
Follow the steps to run the TASK - 2
<!-- Terminal - 1 (Generic Subscriber) --> ##### TO RUN GENERIC SUBSCRIBER IN C++ #### ros2 run generic_subscriber run_generic_subscriber ##### TO RUN GENERIC SUBSCRIBER IN PYTHON ##### ros2 run generic_subscriber_py run_generic_subscriber <!-- Terminal - 2 (Testing Publisher) --> ros2 run generic_subscriber run_testing_publisher <MODE (1-4)> # Mode -1: For String, Mode -2: Bool, Mode -3: Twist, Mode -4: Pose
The project is organized into several directories:
-
TASK - 1
calculator_msgsROS2 pkg which contains thecustom msgsandcustom actionsused for action client and action server implementationactionCustom action for the ROS2 action.msgCustom msg for the ROS2 action and Goal Publisher.
calculatorROS2 pkg which contains the ROS2 action implementation and goal publisher code.calculatorModule responsible for the creation of the actions and publisherssrcFinal codes responsible for executing the code.
-
TASK - 2
-
C++ Implementation
generic_subscriberROS2 pkg which contains C++ code for generic subscriber and testing publishergeneric_subscriberModule responsible for the creation of the generic subscriber and testing publisher in c++srcFinal codes responsible for executing the code.
-
Python Implementation
generic_subscriber_pyROS2 pkg which contains python code for generic subscribergeneric_subscriber_pyModule responsible for the creation of the generic subscriber in python
-