CreOS SDK
The CreOS SDK allows you to interact with Avular robots
 
Loading...
Searching...
No Matches
setpoint_control_interface.hpp
1// Copyright (C) 2024 Avular Holding B.V. - All Rights Reserved
2// You may use this code under the terms of the Avular
3// Software End-User License Agreement.
4//
5// You should have received a copy of the Avular
6// Software End-User License Agreement license with
7// this file, or download it from: avular.com/eula
8//
9/*****************************************************************************
10 * Created on: 2024 August 21
11 * Author: Robbert-Jan de Jager
12 *
13 * Declaration of the ISetpointControlInterface class.
14 ****************************************************************************/
15#pragma once
16
17#include <creos/client_global.hpp>
18#include <creos/messages/command.hpp>
19#include <creos/messages/control_source.hpp>
20#include <creos/messages/interface_info.hpp>
21#include <creos/messages/state_reference.hpp>
22#include <creos/messages/twist.hpp>
23#include <creos/subscription.hpp>
24
25namespace creos {
26
30class CREOS_CLIENT_API ISetpointControlInterface {
31public:
32 static constexpr char name[] = "setpoint_control";
33 static constexpr unsigned version = 1;
34
35 virtual ~ISetpointControlInterface() = default;
36
47 virtual void publishVelocityCommand(const creos_messages::Twist& cmd_vel) = 0;
48
60 virtual void setControlSource(const creos_messages::ControlSource& source, int timeout_ms = 5000) = 0;
61
73 const std::function<void(const creos_messages::ControlSource&)>& callback) = 0;
74
86 virtual creos_messages::ControlSource getCurrentControlSource(int timeout_ms = 1500) = 0;
87
98 virtual void sendCommand(const creos_messages::Command command, int timeout_ms = 5000) = 0;
99
110 virtual void sendCommand(const creos_messages::CommandStamped command, int timeout_ms = 5000) = 0;
111
121 virtual void publishStateReference(const creos_messages::StateReference& state_reference) = 0;
122};
123} // namespace creos
The interface for sending control setpoints to an Avular robot.
Definition setpoint_control_interface.hpp:30
virtual creos_messages::ControlSource getCurrentControlSource(int timeout_ms=1500)=0
Get the current control source of the robot.
virtual void publishStateReference(const creos_messages::StateReference &state_reference)=0
Publish a state reference to the robot.
virtual void publishVelocityCommand(const creos_messages::Twist &cmd_vel)=0
Publish a velocity command to the robot.
virtual void sendCommand(const creos_messages::CommandStamped command, int timeout_ms=5000)=0
Send a command with timestamp to the robot to trigger a one-time action.
virtual void setControlSource(const creos_messages::ControlSource &source, int timeout_ms=5000)=0
Set the control source of the robot.
virtual void sendCommand(const creos_messages::Command command, int timeout_ms=5000)=0
Send a command to the robot to trigger a one-time action.
virtual SubscriptionId subscribeToCurrentControlSource(const std::function< void(const creos_messages::ControlSource &)> &callback)=0
Subscribe to the current control source of the robot.
This type holds an subscription ID.
Definition subscription.hpp:22
ControlSource
Control source message containing the control source of the robot.
Definition control_source.hpp:28
The main namespace for the CreOS client library.
Command message containing the command to send to the robot.
Definition command.hpp:26
Command message containing the command to send to the robot, with a timestamp.
Definition command.hpp:49
State reference message containing the pose, velocity and acceleration of the robot.
Definition state_reference.hpp:31
The Twist message contains the linear and angular velocity of the robot.
Definition twist.hpp:27