joint_impedance_example_controller.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 <memory>
6 #include <string>
7 #include <vector>
8 
13 #include <ros/node_handle.h>
14 #include <ros/time.h>
15 
16 #include <franka_example_controllers/JointTorqueComparison.h>
19 #include <franka_hw/trigger_rate.h>
20 
22 
24  franka_hw::FrankaModelInterface,
25  hardware_interface::EffortJointInterface,
26  franka_hw::FrankaPoseCartesianInterface> {
27  public:
28  bool init(hardware_interface::RobotHW* robot_hw, ros::NodeHandle& node_handle) override;
29  void starting(const ros::Time&) override;
30  void update(const ros::Time&, const ros::Duration& period) override;
31 
32  private:
33  // Saturation
34  std::array<double, 7> saturateTorqueRate(
35  const std::array<double, 7>& tau_d_calculated,
36  const std::array<double, 7>& tau_J_d); // NOLINT (readability-identifier-naming)
37 
38  std::unique_ptr<franka_hw::FrankaCartesianPoseHandle> cartesian_pose_handle_;
39  std::unique_ptr<franka_hw::FrankaModelHandle> model_handle_;
40  std::vector<hardware_interface::JointHandle> joint_handles_;
41 
42  static constexpr double kDeltaTauMax{1.0};
43  double radius_{0.1};
44  double acceleration_time_{2.0};
45  double vel_max_{0.05};
46  double angle_{0.0};
47  double vel_current_{0.0};
48 
49  std::vector<double> k_gains_;
50  std::vector<double> d_gains_;
51  double coriolis_factor_{1.0};
52  std::array<double, 7> dq_filtered_;
53  std::array<double, 16> initial_pose_;
54 
56  std::array<double, 7> last_tau_d_{};
58 };
59 
60 } // namespace franka_example_controllers
std::unique_ptr< franka_hw::FrankaCartesianPoseHandle > cartesian_pose_handle_
void update(const ros::Time &, const ros::Duration &period) override
realtime_tools::RealtimePublisher< JointTorqueComparison > torques_publisher_
std::array< double, 7 > saturateTorqueRate(const std::array< double, 7 > &tau_d_calculated, const std::array< double, 7 > &tau_J_d)
bool init(hardware_interface::RobotHW *robot_hw, ros::NodeHandle &node_handle) override


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