clang-tidy: fix issues (#26498)

This commit is contained in:
Jacob Dahl
2026-02-17 14:09:43 -09:00
committed by GitHub
parent 6b67ccb0ad
commit d5ddc9135d
7 changed files with 16 additions and 11 deletions
@@ -111,7 +111,7 @@ Vector4f MecanumActControl::computeInverseKinematics(float throttle_body_x, floa
const Matrix<float, 3, 1> input(input_data);
const float m_data[12] = {1.f, -1.f, -1.f, 1.f, 1.f, 1.f, 1.f, 1.f, -1.f, 1.f, -1.f, 1.f};
const Matrix<float, 4, 3> m(m_data);
const Vector4f motor_commands = m * input;
Vector4f motor_commands = m * input;
return motor_commands;
}
+1 -1
View File
@@ -132,7 +132,7 @@ protected:
// Use trapezoidal integration to calculate the delta integral
_integrated_samples++;
_integral_dt += dt;
const matrix::Vector3f delta_alpha{(val + _last_val) *dt * 0.5f};
matrix::Vector3f delta_alpha{(val + _last_val) *dt * 0.5f};
_last_val = val;
return delta_alpha;
@@ -277,7 +277,7 @@ void BuoyancyPrivate::CheckForNewEntities(const EntityComponentManager &_ecm)
[&](const Entity & _entity,
const components::Link *,
const components::Inertial *) -> bool {
if (this->basicBuoyancy == true) return true;
if (this->basicBuoyancy == true) { return true; }
// Skip if the entity already has a volume and center of volume
if (_ecm.EntityHasComponentType(_entity,
components::CenterOfVolume().TypeId()) &&
@@ -334,16 +334,18 @@ void SpacecraftThrusterModelPrivate::UpdateForcesAndMoments(
// d: cycle period
double targetDutyCycle = normalizedInput * (1.0 / this->dutyCycleFrequency);
if (this->actuatorNumber == 0)
if (this->actuatorNumber == 0) {
gzdbg << this->actuatorNumber
<< ": target duty cycle: " << targetDutyCycle << std::endl;
}
// Calculate cycle start time
if (this->samplingTime >= 1.0 / this->dutyCycleFrequency) {
if (this->actuatorNumber == 0)
if (this->actuatorNumber == 0) {
gzdbg << this->actuatorNumber
<< ": Cycle completed. Resetting cycle start time."
<< std::endl;
}
this->cycleStartTime = this->simTime;
}
@@ -351,22 +353,24 @@ void SpacecraftThrusterModelPrivate::UpdateForcesAndMoments(
// Calculate sampling time instant within the cycle
this->samplingTime = this->simTime - this->cycleStartTime;
if (this->actuatorNumber == 0)
if (this->actuatorNumber == 0) {
gzdbg << this->actuatorNumber
<< ": PWM Period: " << 1.0 / this->dutyCycleFrequency
<< " Cycle Start time: " << this->cycleStartTime
<< " Sampling time: " << this->samplingTime << std::endl;
}
// Apply force if the sampling time is less than the target ON duty cycle
double force = this->samplingTime <= targetDutyCycle ? this->maxThrust : 0.0;
if (targetDutyCycle < 1e-9) { force = 0.0; }
if (this->actuatorNumber == 0)
if (this->actuatorNumber == 0) {
gzdbg << this->actuatorNumber
<< ": Force: " << force
<< " Sampling time: " << this->samplingTime
<< " Tgt duty cycle: " << targetDutyCycle << std::endl;
}
// Apply force to the link
Link link(this->linkEntity);
@@ -374,10 +378,11 @@ void SpacecraftThrusterModelPrivate::UpdateForcesAndMoments(
link.AddWorldForce(_ecm,
worldPose->Rot().RotateVector(math::Vector3d(0, 0, force)));
if (this->actuatorNumber == 0)
if (this->actuatorNumber == 0) {
gzdbg << this->actuatorNumber
<< ": Input Value: " << msg->velocity(this->actuatorNumber)
<< " Calc. Force: " << force << std::endl;
}
}
GZ_ADD_PLUGIN(SpacecraftThrusterModel,