Skip to content

Commit df600fd

Browse files
committed
style: format cpp
1 parent 6c00126 commit df600fd

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

extensions/rcs_fr3/src/hw/Franka.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,15 @@ FrankaConfig* Franka::get_config() {
7373
return cfg;
7474
}
7575

76-
FrankaState *Franka::get_state() {
76+
FrankaState* Franka::get_state() {
7777
franka::RobotState current_robot_state;
7878
if (this->running_controller == Controller::none) {
7979
current_robot_state = this->robot.readOnce();
8080
} else {
8181
std::lock_guard<std::mutex> lock(this->interpolator_mutex);
8282
current_robot_state = this->curr_state;
8383
}
84-
auto *state = new FrankaState();
84+
auto* state = new FrankaState();
8585
state->robot_state = current_robot_state;
8686
return state;
8787
}
@@ -141,7 +141,7 @@ void Franka::set_guiding_mode(bool x, bool y, bool z, bool roll, bool pitch,
141141
this->robot.setGuidingMode(activated, elbow);
142142
}
143143

144-
void PInverse(const Eigen::MatrixXd &M, Eigen::MatrixXd &M_inv,
144+
void PInverse(const Eigen::MatrixXd& M, Eigen::MatrixXd& M_inv,
145145
double damping_factor = 0.05) {
146146
Eigen::JacobiSVD<Eigen::MatrixXd> svd(
147147
M, Eigen::ComputeFullU | Eigen::ComputeFullV);
@@ -158,8 +158,8 @@ void PInverse(const Eigen::MatrixXd &M, Eigen::MatrixXd &M_inv,
158158
M_inv = Eigen::MatrixXd(svd.matrixV() * S_inv * svd.matrixU().transpose());
159159
}
160160

161-
void TorqueSafetyGuardFn(std::array<double, 7> &tau_d_array,
162-
const std::array<double, 7> &max_torques) {
161+
void TorqueSafetyGuardFn(std::array<double, 7>& tau_d_array,
162+
const std::array<double, 7>& max_torques) {
163163
for (size_t i = 0; i < tau_d_array.size(); i++) {
164164
tau_d_array[i] =
165165
std::max(std::min(tau_d_array[i], max_torques[i]), -max_torques[i]);
@@ -348,7 +348,7 @@ void Franka::osc() {
348348
avoidance_weights_ << 1., 1., 1., 1., 1., 10., 10.;
349349

350350
try {
351-
this->robot.control([&](const franka::RobotState &robot_state,
351+
this->robot.control([&](const franka::RobotState& robot_state,
352352
franka::Duration period) -> franka::Torques {
353353
std::chrono::high_resolution_clock::time_point t1 =
354354
std::chrono::high_resolution_clock::now();
@@ -534,7 +534,7 @@ void Franka::osc() {
534534

535535
return tau_d_rate_limited;
536536
});
537-
} catch (const franka::Exception &e) {
537+
} catch (const franka::Exception& e) {
538538
std::cerr << "Franka::osc() caught exception: " << e.what() << std::endl;
539539
std::cerr << "Attempting to recover from exception..." << std::endl;
540540
this->automatic_error_recovery();
@@ -570,7 +570,7 @@ void Franka::joint_controller() {
570570
joint_min_ << -2.8973, -1.7628, -2.8973, -3.0718, -2.8973, -0.0175, -2.8973;
571571

572572
try {
573-
this->robot.control([&](const franka::RobotState &robot_state,
573+
this->robot.control([&](const franka::RobotState& robot_state,
574574
franka::Duration period) -> franka::Torques {
575575
std::chrono::high_resolution_clock::time_point t1 =
576576
std::chrono::high_resolution_clock::now();
@@ -653,7 +653,7 @@ void Franka::joint_controller() {
653653

654654
return tau_d_rate_limited;
655655
});
656-
} catch (const franka::Exception &e) {
656+
} catch (const franka::Exception& e) {
657657
std::cerr << "Franka::joint_controller() caught exception: " << e.what()
658658
<< std::endl;
659659
std::cerr << "Attempting to recover from exception..." << std::endl;
@@ -682,7 +682,7 @@ void Franka::zero_torque_controller() {
682682

683683
this->controller_time = 0.0;
684684
try {
685-
this->robot.control([&](const franka::RobotState &robot_state,
685+
this->robot.control([&](const franka::RobotState& robot_state,
686686
franka::Duration period) -> franka::Torques {
687687
this->interpolator_mutex.lock();
688688
this->curr_state = robot_state;
@@ -694,7 +694,7 @@ void Franka::zero_torque_controller() {
694694
}
695695
return franka::Torques({0, 0, 0, 0, 0, 0, 0});
696696
});
697-
} catch (const franka::Exception &e) {
697+
} catch (const franka::Exception& e) {
698698
std::cerr << "Franka::zero_torque_controller() caught exception: "
699699
<< e.what() << std::endl;
700700
std::cerr << "Attempting to recover from exception..." << std::endl;

extensions/rcs_fr3/src/pybind/rcs.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,12 +99,12 @@ PYBIND11_MODULE(_core, m) {
9999
.def_readonly("O_ddP_EE_c", &franka::RobotState::O_ddP_EE_c)
100100
.def_readonly("theta", &franka::RobotState::theta)
101101
.def_readonly("dtheta", &franka::RobotState::dtheta)
102-
// .def_readonly("current_errors", &franka::RobotState::current_errors)
103-
// .def_readonly("last_motion_errors",
104-
// &franka::RobotState::last_motion_errors)
102+
// .def_readonly("current_errors", &franka::RobotState::current_errors)
103+
// .def_readonly("last_motion_errors",
104+
// &franka::RobotState::last_motion_errors)
105105
.def_readonly("control_command_success_rate",
106106
&franka::RobotState::control_command_success_rate)
107-
// .def_readonly("time", &franka::RobotState::time)
107+
// .def_readonly("time", &franka::RobotState::time)
108108
.def_readonly("robot_mode", &franka::RobotState::robot_mode);
109109

110110
py::object robot_state =

0 commit comments

Comments
 (0)