rt_manipulators_cpp: Rolling
  • Links
    • Rosindex
    • Repository
  • C++ API
    • Class Hierarchy
    • File Hierarchy
    • Full C++ API
      • Namespaces
        • Namespace config_file_parser
        • Namespace dynamixel_base
        • Namespace dynamixel_p
        • Namespace dynamixel_ph42
        • Namespace dynamixel_x
        • Namespace dynamixel_xh430
        • Namespace dynamixel_xh540
        • Namespace dynamixel_xm430
        • Namespace dynamixel_xm540
        • Namespace hardware_communicator
        • Namespace hardware_joints
        • Namespace joint
        • Namespace kinematics
        • Namespace kinematics_utils
        • Namespace manipulators_link
        • Namespace rt_manipulators_cpp
      • Classes and Structs
        • Class DynamixelBase
        • Class DynamixelP
        • Class DynamixelPH42
        • Class DynamixelX
        • Class DynamixelXH430
        • Class DynamixelXH540
        • Class DynamixelXM430
        • Class DynamixelXM540
        • Class Communicator
        • Class Joints
        • Class Joint
        • Class JointGroup
        • Class Link
        • Class Hardware
      • Functions
        • Function config_file_parser::parse
        • Function kinematics::forward_kinematics
        • Function kinematics::inverse_kinematics_LM
        • Function kinematics_utils::calc_basic_jacobian
        • Function kinematics_utils::calc_error
        • Function kinematics_utils::calc_error_p
        • Function kinematics_utils::calc_error_R
        • Function kinematics_utils::find_route
        • Function kinematics_utils::get_q_list
        • Function kinematics_utils::parse_link_config_file
        • Function kinematics_utils::print_links
        • Function kinematics_utils::rodrigues
        • Function kinematics_utils::rotation_from_euler_ZYX
        • Function kinematics_utils::rotation_to_axis_angle_representation
        • Function kinematics_utils::rotation_to_euler_ZYX
        • Function kinematics_utils::set_q_list
        • Function kinematics_utils::skew_symmetric_matrix_for_cross_product
      • Typedefs
        • Typedef config_file_parser::JointName
        • Typedef dynamixel_base::comm_t
        • Typedef hardware_communicator::dxl_address_t
        • Typedef hardware_communicator::dxl_byte_t
        • Typedef hardware_communicator::dxl_data_length_t
        • Typedef hardware_communicator::dxl_double_word_t
        • Typedef hardware_communicator::dxl_error_t
        • Typedef hardware_communicator::dxl_id_t
        • Typedef hardware_communicator::dxl_result_t
        • Typedef hardware_communicator::dxl_word_t
        • Typedef hardware_communicator::group_name_t
        • Typedef hardware_communicator::GroupSyncRead
        • Typedef hardware_communicator::GroupSyncWrite
        • Typedef hardware_joints::current_t
        • Typedef hardware_joints::dxl_id_t
        • Typedef hardware_joints::group_map_t
        • Typedef hardware_joints::group_name_t
        • Typedef hardware_joints::joint_name_t
        • Typedef hardware_joints::position_t
        • Typedef hardware_joints::temperature_t
        • Typedef hardware_joints::velocity_t
        • Typedef hardware_joints::voltage_t
        • Typedef kinematics_utils::link_id_t
        • Typedef kinematics_utils::links_t
        • Typedef kinematics_utils::q_list_t
        • Typedef rt_manipulators_cpp::JointGroupName
        • Typedef rt_manipulators_cpp::JointName
      • Directories
        • Directory include
      • Files
        • File config_file_parser.hpp
        • File dynamixel_base.hpp
        • File dynamixel_p.hpp
        • File dynamixel_ph42.hpp
        • File dynamixel_x.hpp
        • File dynamixel_xh430.hpp
        • File dynamixel_xh540.hpp
        • File dynamixel_xm430.hpp
        • File dynamixel_xm540.hpp
        • File hardware.hpp
        • File hardware_communicator.hpp
        • File hardware_joints.hpp
        • File joint.hpp
        • File kinematics.hpp
        • File kinematics_utils.hpp
        • File link.hpp
  • Standard Documents
    • README
      • RTマニピュレータC++ライブラリ
        • ライブラリのインストール
        • ライブラリのアンインストール
        • ライブラリの使い方
        • ライブラリのファイル構成
        • ライブラリのテスト
    • PACKAGE
    • CHANGELOG
      • Changelog for package rt_manipulators_cpp
        • 1.1.0 (2024-08-09)
        • 1.0.0 (2022-06-13)
  • Index
rt_manipulators_cpp: Rolling
  • C++ API
  • File link.hpp
  • Program Listing for File link.hpp
  • View page source

Program Listing for File link.hpp

↰ Return to documentation for file (include/link.hpp)

// Copyright 2021 RT Corporation
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef RT_MANIPULATORS_LIB_INCLUDE_LINK_HPP_
#define RT_MANIPULATORS_LIB_INCLUDE_LINK_HPP_

#include <eigen3/Eigen/Dense>

#include <algorithm>
#include <string>

namespace manipulators_link {

// Linkクラスの参考情報:
// 梶田秀司 編著, ヒューマノイドロボット 改訂2版, オーム社, 2020
class Link{
 public:
  Link():
    name("ダミーリンク"), sibling(0), child(0), parent(0), q(0), dq(0), ddq(0), m(0), dxl_id(0),
    min_q(0), max_q(0) {
    // 0ベクトル、単位行列で初期化
    p.setZero();
    R.setIdentity();
    v.setZero();
    w.setZero();
    a.setZero();
    b.setZero();
    c.setZero();
    I.setIdentity();
  }
  std::string name;  // リンク名
  int sibling;  // 姉妹兄弟リンクID
  int child;  // 子リンクID
  int parent;  // 親リンクID
  Eigen::Vector3d p;  // ワールド座標系での位置
  Eigen::Matrix3d R;  // ワールド座標系での姿勢
  Eigen::Vector3d v;  // ワールド座標系での速度
  Eigen::Vector3d w;  // ワールド座標系での角速度ベクトル
  double q;  // 関節位置
  double dq;  // 関節速度
  double ddq;  // 関節加速度
  Eigen::Vector3d a;  // 親リンクに対する関節軸ベクトル
  Eigen::Vector3d b;  // 親リンクに対する相対位置
  double m;  // 質量
  Eigen::Vector3d c;  // 自リンクに対する重心位置
  Eigen::Matrix3d I;  // 自リンクに対する慣性テンソル
  int dxl_id;  // 対応するDynamixelのID
  double min_q;  // 関節位置の下限値
  double max_q;  // 関節位置の上限値
  void set_q_within_limit(const double & desired_q) { q = std::clamp(desired_q, min_q, max_q); }
};

}  // namespace manipulators_link

#endif  // RT_MANIPULATORS_LIB_INCLUDE_LINK_HPP_
Previous Next

© Copyright The <rt_manipulators_cpp> Contributors. License: Apache License 2.0.

Built with Sphinx using a theme provided by Read the Docs.