6 #include <franka_example_controllers/teleop_paramConfig.h> 10 #include <control_msgs/GripperCommandAction.h> 12 #include <dynamic_reconfigure/server.h> 17 #include <sensor_msgs/JointState.h> 18 #include <std_msgs/Float64.h> 19 #include <visualization_msgs/MarkerArray.h> 21 #include <Eigen/Dense> 49 hardware_interface::EffortJointInterface,
50 franka_hw::FrankaStateInterface> {
149 const std::string&
arm_id,
161 double neg_x_asymptote,
162 double pos_x_asymptote,
163 double shift_along_x,
164 double increase_factor);
166 template <
typename T>
169 if (!nh.
getParam(param_name, vec) || vec.size() != 7) {
170 throw std::invalid_argument(
"TeleopJointPDExampleController: Invalid or no parameter " +
172 " provided, aborting controller init!");
179 template <
typename T>
182 if (!nh.
getParam(param_name, out)) {
183 throw std::invalid_argument(
"TeleopJointPDExampleController: Invalid or no parameter " +
186 "aborting controller init!");
192 const std::vector<std::string>& joint_names,
193 std::array<double, 7>& upper_joint_soft_limit,
194 std::array<double, 7>& lower_joint_soft_limit);
205 std::unique_ptr<dynamic_reconfigure::Server<franka_example_controllers::teleop_paramConfig>>
207 void teleopParamCallback(franka_example_controllers::teleop_paramConfig& config, uint32_t level);
realtime_tools::RealtimePublisher< std_msgs::Float64 > follower_contact_pub_
std::vector< hardware_interface::JointHandle > joint_handles
Eigen::Matrix< double, 6, 1 > Vector6d
Vector7d k_d_leader_lower_
realtime_tools::RealtimePublisher< sensor_msgs::JointState > leader_target_pub_
double contact_force_threshold
std::unique_ptr< dynamic_reconfigure::Server< franka_example_controllers::teleop_paramConfig > > dynamic_server_teleop_param_
void publishFollowerContact()
Eigen::Matrix< double, 7, 7 > Matrix7d
Vector7d dq_max_leader_lower_
std::array< std::string, 7 > joint_names
void publishLeaderTarget()
Vector7d get7dParam(const std::string ¶m_name, ros::NodeHandle &nh)
realtime_tools::RealtimePublisher< std_msgs::Float64 > leader_contact_pub_
ros::NodeHandle dynamic_reconfigure_teleop_param_node_
Vector7d k_d_follower_align_
realtime_tools::RealtimePublisher< visualization_msgs::MarkerArray > marker_pub_
void updateArm(FrankaDataContainer &arm_data)
void initArm(hardware_interface::RobotHW *robot_hw, ros::NodeHandle &node_handle, FrankaDataContainer &arm_data, const std::string &arm_id, const std::vector< std::string > &joint_names)
Controller class for ros_control that allows force-feedback teleoperation of a follower arm from a le...
double contact_ramp_increase
double rampParameter(double x, double neg_x_asymptote, double pos_x_asymptote, double shift_along_x, double increase_factor)
TeleopStateMachine current_state_
void update(const ros::Time &, const ros::Duration &period) override
Computes the control-law and commands the resulting joint torques to the robots.
franka_hw::TriggerRate publish_rate_
bool getParam(const std::string &key, std::string &s) const
Vector7d prev_alignment_error_
const double kAlignmentTolerance_
Vector7d alignment_error_
double force_feedback_idle_
FrankaDataContainer leader_data_
double follower_stiffness_scaling_
Contains functions for calculating torques generated by virtual walls.
double leader_damping_scaling_
T get1dParam(const std::string ¶m_name, ros::NodeHandle &nh)
Vector7d k_p_follower_align_
void starting(const ros::Time &) override
Prepares the controller for the real-time execution.
double force_feedback_guiding_
bool init(hardware_interface::RobotHW *robot_hw, ros::NodeHandle &node_handle) override
Initializes the controller class to be ready to run.
FrankaDataContainer follower_data_
void publishFollowerTarget()
double velocity_ramp_increase_
Vector7d dq_max_leader_upper_
const std::string & getNamespace() const
TeleopStateMachine
Finite state machine that defines the states of the teleoperation phases.
double velocity_ramp_shift_
Vector7d saturateAndLimit(const Vector7d &x_calc, const Vector7d &x_last, const Vector7d &x_max, const Vector7d &dx_max, double delta_t)
std::vector< T > getJointParams(const std::string ¶m_name, ros::NodeHandle &nh)
std::unique_ptr< JointWallContainer< 7 > > virtual_joint_wall
Eigen::Matrix< double, 7, 1 > Vector7d
Vector7d leaderDamping(const Vector7d &dq)
std::unique_ptr< franka_hw::FrankaStateHandle > state_handle
realtime_tools::RealtimePublisher< sensor_msgs::JointState > follower_target_pub_
Vector7d k_d_leader_upper_
void teleopParamCallback(franka_example_controllers::teleop_paramConfig &config, uint32_t level)
void publishLeaderContact()
static void getJointLimits(ros::NodeHandle &nh, const std::vector< std::string > &joint_names, std::array< double, 7 > &upper_joint_soft_limit, std::array< double, 7 > &lower_joint_soft_limit)
std::mutex dynamic_reconfigure_mutex_