0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

franka_hw実装調査

Last updated at Posted at 2022-07-15

franka_hw.h

libfrankaのヘッダファイルを使用

#include <franka/control_types.h>
#include <franka/duration.h>
#include <franka/rate_limiting.h>
#include <franka/robot.h>
#include <franka/robot_state.h>
namespace franka_hw {
class FrankaHW : public hardware_interface::RobotHW {
  franka::RobotState robot_state_libfranka_{};
  franka::JointPositions position_joint_command_libfranka_;
  franka::JointVelocities velocity_joint_command_libfranka_;
  franka::Torques effort_joint_command_libfranka_;
  franka::CartesianPose pose_cartesian_command_libfranka_;
  franka::CartesianVelocities velocity_cartesian_command_libfranka_;
  std::unique_ptr<franka::Robot> robot_;
};
}  // namespace franka_hw

franka_hw.cpp

#include <franka_hw/franka_hw.h>
void FrankaHW::connect() {
  if (!robot_) {
    robot_ = std::make_unique<franka::Robot>(robot_ip_, realtime_config_);
    robot_->setCollisionBehavior(collision_config_.lower_torque_thresholds_acceleration,
                                 collision_config_.upper_torque_thresholds_acceleration,
                                 collision_config_.lower_torque_thresholds_nominal,
                                 collision_config_.upper_torque_thresholds_nominal,
                                 collision_config_.lower_force_thresholds_acceleration,
                                 collision_config_.upper_force_thresholds_acceleration,
                                 collision_config_.lower_force_thresholds_nominal,
                                 collision_config_.upper_force_thresholds_nominal);
  }
}
void FrankaHW::initRobot() {
  connect();
  model_ = std::make_unique<franka_hw::Model>(robot_->loadModel());
  update(robot_->readOnce());
}
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?