@@ -146,8 +146,8 @@ void PInverse(const Eigen::MatrixXd &M, Eigen::MatrixXd &M_inv,
146146 S_inv.setZero ();
147147 double damping = damping_factor * damping_factor;
148148 for (int i = 0 ; i < singular_vals.size (); i++) {
149- S_inv (i, i) = singular_vals (i) /
150- (singular_vals (i) * singular_vals (i) + damping);
149+ S_inv (i, i) =
150+ singular_vals (i) / (singular_vals (i) * singular_vals (i) + damping);
151151 }
152152 M_inv = Eigen::MatrixXd (svd.matrixV () * S_inv * svd.matrixU ().transpose ());
153153}
@@ -193,15 +193,14 @@ void Franka::controller_set_joint_position(const common::Vector7d &desired_q) {
193193 throw std::runtime_error (
194194 " Desired joint configuration is too far from current configuration. "
195195 " Distance: " +
196- std::to_string (joint_dist) +
197- " rad, Limit: " + std::to_string (this ->cfg .max_joint_dist .value ()) +
198- " rad." );
196+ std::to_string (joint_dist) + " rad, Limit: " +
197+ std::to_string (this ->cfg .max_joint_dist .value ()) + " rad." );
199198 }
200199 }
201200
202- this ->joint_interpolator .reset (
203- this -> controller_time , current_q, desired_q, policy_rate, traj_rate,
204- traj_interpolation_time_fraction);
201+ this ->joint_interpolator .reset (this -> controller_time , current_q, desired_q,
202+ policy_rate, traj_rate,
203+ traj_interpolation_time_fraction);
205204
206205 // if not thread is running, then start
207206 if (this ->running_controller == Controller::none) {
@@ -237,18 +236,18 @@ void Franka::osc_set_cartesian_position(
237236
238237 // Safety check for distance
239238 if (this ->cfg .max_cartesian_pos_dist .has_value ()) {
240- double dist = (curr_pose. translation () -
241- desired_pose_EE_in_base_frame.translation ())
242- .norm ();
239+ double dist =
240+ (curr_pose. translation () - desired_pose_EE_in_base_frame.translation ())
241+ .norm ();
243242 if (dist > this ->cfg .max_cartesian_pos_dist .value ()) {
244243 if (this ->running_controller == Controller::osc) {
245244 this ->interpolator_mutex .unlock ();
246245 }
247246 throw std::runtime_error (
248- " Desired cartesian position is too far from current position (dist: " +
249- std::to_string (dist) +
250- " m, max: " + std::to_string (cfg. max_cartesian_pos_dist . value ()) +
251- " m)" );
247+ " Desired cartesian position is too far from current position "
248+ " (dist: " +
249+ std::to_string (dist) + " m, max: " +
250+ std::to_string (cfg. max_cartesian_pos_dist . value ()) + " m)" );
252251 }
253252 }
254253 // Safety check for orientation
@@ -263,9 +262,8 @@ void Franka::osc_set_cartesian_position(
263262 throw std::runtime_error (
264263 " Desired cartesian orientation is too far from current orientation "
265264 " (dist: " +
266- std::to_string (angle) +
267- " rad, max: " + std::to_string (cfg.max_cartesian_ori_dist .value ()) +
268- " rad)" );
265+ std::to_string (angle) + " rad, max: " +
266+ std::to_string (cfg.max_cartesian_ori_dist .value ()) + " rad)" );
269267 }
270268 }
271269
0 commit comments