Skip to content

Implement ROS2 actions #60

@RobertoRoos

Description

@RobertoRoos

Title says it all: it would be cool to support ROS2 actions.

Potentially duplicates RobotecAI/ros2-for-unity#48

I'm currently trying to write this, PR will hopefully follow.

An overview on how the different APIs look so far:

Langague Publisher Service Action
Python
from std_msgs.msg import String

self.create_publisher(String, 'topic', 10)
from example_interfaces.srv import AddTwoInts

self.create_service(AddTwoInts, 'add_two_ints', self.add_two_ints_callback)
from action_tutorials_interfaces.action import Fibonacci

ActionServer(
            self,
            Fibonacci,
            'fibonacci',
            self.execute_callback)
C++
#include "std_msgs/msg/string.hpp"

this->create_publisher<std_msgs::msg::String>("topic", 10);
#include "example_interfaces/srv/add_two_ints.hpp"

this->create_service<example_interfaces::srv::AddTwoInts>("add_two_ints", &add);
#include "action_tutorials_interfaces/action/fibonacci.hpp"

rclcpp_action::create_server<Fibonacci>(
      this,
      "fibonacci",
      std::bind(&FibonacciActionServer::handle_goal, this, _1, _2),
      std::bind(&FibonacciActionServer::handle_cancel, this, _1),
      std::bind(&FibonacciActionServer::handle_accepted, this, _1));
C#
using std_msgs.msg;

node.CreatePublisher<String>("chatter");
using example_interfaces.srv;

node.CreateService<AddTwoInts_Request, AddTwoInts_Response>("add_two_ints", recv_callback);
Missing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions