sas
Modularised monitoring, logging, and control of robots.
Loading...
Searching...
No Matches
serial_manipulator_simulator_friendly.hpp
Go to the documentation of this file.
1#pragma once
2/*
3# Copyright (c) 2016-2025 Murilo Marques Marinho
4#
5# This file is part of sas_core.
6#
7# sas_core is free software: you can redistribute it and/or modify
8# it under the terms of the GNU Lesser General Public License as published by
9# the Free Software Foundation, either version 3 of the License, or
10# (at your option) any later version.
11#
12# sas_core is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15# GNU Lesser General Public License for more details.
16#
17# You should have received a copy of the GNU Lesser General Public License
18# along with sas_core. If not, see <https://www.gnu.org/licenses/>.
19#
20# ################################################################
21#
22# Author: Murilo M. Marinho, email: murilomarinho@ieee.org
23#
24# ################################################################*/
25
31
32#include <memory>
33#include <stdexcept>
34#include <vector>
35
36#include <dqrobotics/robot_modeling/DQ_SerialManipulator.h>
37
38namespace marinholab::sas::core::modeling
39{
40
41// The dqrobotics types this model builds on. (The Eigen types used in the
42// signatures, e.g. Eigen::MatrixXd/Eigen::VectorXd, are injected into the global namespace
43// by the dqrobotics headers.)
44using DQ_robotics::DQ;
45using DQ_robotics::DQ_SerialManipulator;
46using DQ_robotics::DQ_JointType;
47
57class SerialManipulatorSimulatorFriendly: public DQ_SerialManipulator
58{
59public:
61 enum class ActuationType{
68 };
69protected:
70 std::vector<DQ> offset_before_;
71 std::vector<DQ> offset_after_;
72 std::vector<ActuationType> actuation_types_;
73
74 DQ _get_w(const int& ith) const;
75 DQ _joint_transformation(const double& q, const int& ith) const;
76public:
77
78
89 SerialManipulatorSimulatorFriendly(const std::vector<DQ>& offset_before,
90 const std::vector<DQ>& offset_after,
91 const std::vector<ActuationType>& actuation_types);
92
93 using DQ_SerialManipulator::raw_pose_jacobian;
94 using DQ_SerialManipulator::raw_pose_jacobian_derivative;
95 using DQ_SerialManipulator::raw_fkm;
96
101 std::vector<DQ_JointType> get_supported_joint_types() const override;
102
109 Eigen::MatrixXd raw_pose_jacobian(const Eigen::VectorXd& q_vec, const int& to_ith_link) const override;
117 Eigen::MatrixXd raw_pose_jacobian_derivative(const Eigen::VectorXd& q, const Eigen::VectorXd& q_dot, const int& to_ith_link) const override;
124 DQ raw_fkm(const Eigen::VectorXd &q_vec, const int &to_ith_link) const override;
125};
126
127}
A serial manipulator whose joints carry explicit pre/post offsets.
Definition serial_manipulator_simulator_friendly.hpp:58
Eigen::MatrixXd raw_pose_jacobian(const Eigen::VectorXd &q_vec, const int &to_ith_link) const override
Raw pose Jacobian of the chain up to a given link.
Definition serial_manipulator_simulator_friendly.cpp:166
Eigen::MatrixXd raw_pose_jacobian_derivative(const Eigen::VectorXd &q, const Eigen::VectorXd &q_dot, const int &to_ith_link) const override
Time derivative of the raw pose Jacobian.
Definition serial_manipulator_simulator_friendly.cpp:187
DQ _get_w(const int &ith) const
Returns the spatial axis (as a dual quaternion) of the joint.
Definition serial_manipulator_simulator_friendly.cpp:126
DQ raw_fkm(const Eigen::VectorXd &q_vec, const int &to_ith_link) const override
Raw forward kinematics of the chain up to a given link.
Definition serial_manipulator_simulator_friendly.cpp:152
ActuationType
The actuation type and axis of a single joint.
Definition serial_manipulator_simulator_friendly.hpp:61
@ TZ
Translation along the z-axis.
Definition serial_manipulator_simulator_friendly.hpp:65
@ RZ
Revolution about the z-axis.
Definition serial_manipulator_simulator_friendly.hpp:62
@ TX
Translation along the x-axis.
Definition serial_manipulator_simulator_friendly.hpp:67
@ RY
Revolution about the y-axis.
Definition serial_manipulator_simulator_friendly.hpp:63
@ TY
Translation along the y-axis.
Definition serial_manipulator_simulator_friendly.hpp:66
@ RX
Revolution about the x-axis.
Definition serial_manipulator_simulator_friendly.hpp:64
std::vector< DQ_JointType > get_supported_joint_types() const override
Joint types this model can represent.
Definition serial_manipulator_simulator_friendly.cpp:224