@@ -293,9 +293,7 @@ CallbackReturn SwerveController::on_configure(const rclcpp_lifecycle::State & /*
293293 }
294294 received_velocity_msg_ptr_.writeFromNonRT (std::move (msg));
295295 });
296- }
297- else
298- {
296+ }else {
299297 velocity_command_unstamped_subscriber_ = get_node ()->create_subscription <Twist>(
300298 DEFAULT_COMMAND_UNSTAMPED_TOPIC, rclcpp::SystemDefaultsQoS (),
301299 [this , logger](const std::shared_ptr<Twist> msg) -> void
@@ -325,9 +323,7 @@ CallbackReturn SwerveController::on_configure(const rclcpp_lifecycle::State & /*
325323 if (tf_prefix == " /" )
326324 {
327325 tf_prefix = " " ;
328- }
329- else
330- {
326+ }else {
331327 tf_prefix = tf_prefix + " /" ;
332328 }
333329
@@ -536,39 +532,31 @@ controller_interface::return_type SwerveController::update(
536532 {
537533 front_left_axle_handle_->set_position (front_left_angle);
538534 front_left_wheel_handle_->set_velocity (front_left_velocity);
539- }
540- else
541- {
535+ }else {
542536 RCLCPP_ERROR (logger, " Front Left Axle Handle or Wheel Handle is NULLPTR" );
543537 }
544538
545539 if (front_right_axle_handle_ != nullptr && front_right_wheel_handle_ != nullptr )
546540 {
547541 front_right_axle_handle_->set_position (front_right_angle);
548542 front_right_wheel_handle_->set_velocity (front_right_velocity);
549- }
550- else
551- {
543+ }else {
552544 RCLCPP_ERROR (logger, " Front Right Axle Handle or Wheel Handle is NULLPTR" );
553545 }
554546
555547 if (rear_left_axle_handle_ != nullptr && rear_left_wheel_handle_ != nullptr )
556548 {
557549 rear_left_axle_handle_->set_position (rear_left_angle);
558550 rear_left_wheel_handle_->set_velocity (rear_left_velocity);
559- }
560- else
561- {
551+ }else {
562552 RCLCPP_ERROR (logger, " Rear Left Axle or Wheel Handle is NULLPTR" );
563553 }
564554
565555 if (rear_right_axle_handle_ != nullptr && rear_right_wheel_handle_ != nullptr )
566556 {
567557 rear_right_axle_handle_->set_position (rear_right_angle);
568558 rear_right_wheel_handle_->set_velocity (rear_right_velocity);
569- }
570- else
571- {
559+ }else {
572560 RCLCPP_ERROR (logger, " Rear Right Axle or Wheel Handle is NULLPTR" );
573561 }
574562 }
@@ -590,9 +578,7 @@ controller_interface::return_type SwerveController::update(
590578 front_left_angle, front_right_angle, rear_left_angle, rear_right_angle};
591579 odometry_ =
592580 swerveDriveKinematics_.update_odometry (velocity_array, steering_angles, update_dt.seconds ());
593- }
594- else
595- {
581+ }else {
596582 double front_left_wheel_angle = front_left_axle_handle_->get_feedback ();
597583 double front_right_wheel_angle = front_right_axle_handle_->get_feedback ();
598584 double rear_left_wheel_angle = rear_left_axle_handle_->get_feedback ();
0 commit comments