model.h
Go to the documentation of this file.
1 // Copyright (c) 2017 Franka Emika GmbH
2 // Use of this source code is governed by the Apache-2.0 license, see LICENSE
3 #pragma once
4 
5 #include <array>
6 #include <memory>
7 
8 #include <franka/robot.h>
9 #include <franka/robot_state.h>
10 
16 namespace franka {
17 
21 enum class Frame {
22  kJoint1,
23  kJoint2,
24  kJoint3,
25  kJoint4,
26  kJoint5,
27  kJoint6,
28  kJoint7,
29  kFlange,
32 };
33 
43 Frame operator++(Frame& frame, int /* dummy */) noexcept;
44 
45 class ModelLibrary;
46 class Network;
47 
51 class Model {
52  public:
64  explicit Model(franka::Network& network);
65 
71  Model(Model&& model) noexcept;
72 
80  Model& operator=(Model&& model) noexcept;
81 
85  ~Model() noexcept;
86 
97  std::array<double, 16> pose(Frame frame, const franka::RobotState& robot_state) const;
98 
111  std::array<double, 16> pose(
112  Frame frame,
113  const std::array<double, 7>& q,
114  const std::array<double, 16>& F_T_EE, // NOLINT(readability-identifier-naming)
115  const std::array<double, 16>& EE_T_K) // NOLINT(readability-identifier-naming)
116  const;
117 
128  std::array<double, 42> bodyJacobian(Frame frame, const franka::RobotState& robot_state) const;
129 
142  std::array<double, 42> bodyJacobian(
143  Frame frame,
144  const std::array<double, 7>& q,
145  const std::array<double, 16>& F_T_EE, // NOLINT(readability-identifier-naming)
146  const std::array<double, 16>& EE_T_K) // NOLINT(readability-identifier-naming)
147  const;
148 
159  std::array<double, 42> zeroJacobian(Frame frame, const franka::RobotState& robot_state) const;
160 
173  std::array<double, 42> zeroJacobian(
174  Frame frame,
175  const std::array<double, 7>& q,
176  const std::array<double, 16>& F_T_EE, // NOLINT(readability-identifier-naming)
177  const std::array<double, 16>& EE_T_K) // NOLINT(readability-identifier-naming)
178  const;
179 
187  std::array<double, 49> mass(const franka::RobotState& robot_state) const noexcept;
188 
202  std::array<double, 49> mass(
203  const std::array<double, 7>& q,
204  const std::array<double, 9>& I_total, // NOLINT(readability-identifier-naming)
205  double m_total,
206  const std::array<double, 3>& F_x_Ctotal) // NOLINT(readability-identifier-naming)
207  const noexcept;
208 
217  std::array<double, 7> coriolis(const franka::RobotState& robot_state) const noexcept;
218 
234  std::array<double, 7> coriolis(
235  const std::array<double, 7>& q,
236  const std::array<double, 7>& dq,
237  const std::array<double, 9>& I_total, // NOLINT(readability-identifier-naming)
238  double m_total,
239  const std::array<double, 3>& F_x_Ctotal) // NOLINT(readability-identifier-naming)
240  const noexcept;
241 
255  std::array<double, 7> gravity(
256  const std::array<double, 7>& q,
257  double m_total,
258  const std::array<double, 3>& F_x_Ctotal, // NOLINT(readability-identifier-naming)
259  const std::array<double, 3>& gravity_earth = {{0., 0., -9.81}}) const noexcept;
260 
270  std::array<double, 7> gravity(const franka::RobotState& robot_state,
271  const std::array<double, 3>& gravity_earth = {
272  {0., 0., -9.81}}) const noexcept;
273 
275  Model(const Model&) = delete;
276  Model& operator=(const Model&) = delete;
278 
279  private:
280  std::unique_ptr<ModelLibrary> library_;
281 };
282 
283 } // namespace franka
Contains the franka::Robot type.
Frame operator++(Frame &frame, int) noexcept
Post-increments the given Frame by one.
Contains the franka::RobotState types.
Calculates poses of joints and dynamic properties of the robot.
Definition: model.h:51
Frame
Enumerates the seven joints, the flange, and the end effector of a robot.
Definition: model.h:21
std::unique_ptr< ModelLibrary > library_
Definition: model.h:280
Describes the robot state.
Definition: robot_state.h:35


libfranka
Author(s): Franka Emika GmbH
autogenerated on Tue Jul 9 2019 03:32:01