ros2_control - rolling
Loading...
Searching...
No Matches
mujoco_ros2_control_plugins_base.hpp
1// Copyright 2026 PAL Robotics S.L.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef MUJOCO_ROS2_CONTROL_PLUGINS__PLUGIN_BASE_HPP_
16#define MUJOCO_ROS2_CONTROL_PLUGINS__PLUGIN_BASE_HPP_
17
18#include <mujoco/mujoco.h>
19#include <rclcpp/rclcpp.hpp>
20
21namespace mujoco_ros2_control_plugins
22{
23
32{
33public:
34 virtual ~MuJoCoROS2ControlPluginBase() = default;
35
46 virtual bool init(rclcpp::Node::SharedPtr node, const mjModel* model, mjData* data) = 0;
47
58 virtual void update(const mjModel* model, mjData* data) = 0;
59
63 virtual void cleanup() = 0;
64};
65
66} // namespace mujoco_ros2_control_plugins
67
68#endif // MUJOCO_ROS2_CONTROL_PLUGINS__PLUGIN_BASE_HPP_
Base class for MuJoCo ROS 2 control plugins.
Definition mujoco_ros2_control_plugins_base.hpp:32
virtual void update(const mjModel *model, mjData *data)=0
Update the plugin (called every simulation step)
virtual bool init(rclcpp::Node::SharedPtr node, const mjModel *model, mjData *data)=0
Initialize the plugin.