franka_cartesian_command_interface.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 
9 
10 namespace franka_hw {
11 
16  public:
17  FrankaCartesianPoseHandle() = delete;
18 
26  FrankaCartesianPoseHandle(const FrankaStateHandle& franka_state_handle,
27  std::array<double, 16>& command,
28  std::array<double, 2>& elbow)
29  : FrankaStateHandle(franka_state_handle), command_(&command), elbow_(&elbow) {}
30 
36  void setCommand(const std::array<double, 16>& command) noexcept {
37  *command_ = command;
38  *elbow_ = {};
39  }
40 
47  void setCommand(const std::array<double, 16>& command,
48  const std::array<double, 2>& elbow) noexcept {
49  *command_ = command;
50  *elbow_ = elbow;
51  }
52 
58  const std::array<double, 16>& getCommand() const noexcept { return *command_; }
59 
60  private:
61  std::array<double, 16>* command_;
62  std::array<double, 2>* elbow_;
63 };
64 
69  : public hardware_interface::HardwareResourceManager<FrankaCartesianPoseHandle,
70  hardware_interface::ClaimResources> {};
71 
76  public:
78 
85  std::array<double, 6>& command,
86  std::array<double, 2>& elbow)
87  : FrankaStateHandle(franka_state_handle), command_(&command), elbow_(&elbow) {}
88 
94  void setCommand(std::array<double, 6>& command) noexcept {
95  *command_ = command;
96  *elbow_ = {};
97  }
98 
105  void setCommand(const std::array<double, 6>& command,
106  const std::array<double, 2>& elbow) noexcept {
107  *command_ = command;
108  *elbow_ = elbow;
109  }
110 
116  const std::array<double, 6>& getCommand() const noexcept { return *command_; }
117 
118  private:
119  std::array<double, 6>* command_;
120  std::array<double, 2>* elbow_;
121 };
122 
127  : public hardware_interface::HardwareResourceManager<FrankaCartesianVelocityHandle,
128  hardware_interface::ClaimResources> {};
129 
130 } // namespace franka_hw
Hardware interface to command Cartesian poses.
void setCommand(const std::array< double, 16 > &command, const std::array< double, 2 > &elbow) noexcept
Sets the given command.
Handle to read the complete state of a robot.
void setCommand(const std::array< double, 6 > &command, const std::array< double, 2 > &elbow) noexcept
Sets the given command.
ROSLIB_DECL std::string command(const std::string &cmd)
void setCommand(const std::array< double, 16 > &command) noexcept
Sets the given command.
const std::array< double, 16 > & getCommand() const noexcept
Gets the current command.
Handle to read and command a Cartesian velocity.
Handle to read and command a Cartesian pose.
void setCommand(std::array< double, 6 > &command) noexcept
Sets the given command.
const std::array< double, 6 > & getCommand() const noexcept
Gets the current command.
Hardware interface to command Cartesian velocities.
FrankaCartesianPoseHandle(const FrankaStateHandle &franka_state_handle, std::array< double, 16 > &command, std::array< double, 2 > &elbow)
Creates an instance of a FrankaCartesianPoseHandle.
FrankaCartesianVelocityHandle(const FrankaStateHandle &franka_state_handle, std::array< double, 6 > &command, std::array< double, 2 > &elbow)


franka_hw
Author(s): Franka Emika GmbH
autogenerated on Fri Oct 23 2020 03:47:05