Skip to content

Commit 1119c77

Browse files
committed
Remove unneeded abs for motors thrust in simulation
1 parent fbe33ea commit 1119c77

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

gazebo/simulator.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,10 @@ class ModelFlix : public ModelPlugin {
9292
const double maxThrust = 0.03 * ONE_G; // ~30 g, https://youtu.be/VtKI4Pjx8Sk?&t=78
9393

9494
const float scale0 = 1.0, scale1 = 1.1, scale2 = 0.9, scale3 = 1.05; // imitating motors asymmetry
95-
float mfl = scale0 * maxThrust * abs(motors[MOTOR_FRONT_LEFT]);
96-
float mfr = scale1 * maxThrust * abs(motors[MOTOR_FRONT_RIGHT]);
97-
float mrl = scale2 * maxThrust * abs(motors[MOTOR_REAR_LEFT]);
98-
float mrr = scale3 * maxThrust * abs(motors[MOTOR_REAR_RIGHT]);
95+
float mfl = scale0 * maxThrust * motors[MOTOR_FRONT_LEFT];
96+
float mfr = scale1 * maxThrust * motors[MOTOR_FRONT_RIGHT];
97+
float mrl = scale2 * maxThrust * motors[MOTOR_REAR_LEFT];
98+
float mrr = scale3 * maxThrust * motors[MOTOR_REAR_RIGHT];
9999

100100
body->AddLinkForce(Vector3d(0.0, 0.0, mfl), Vector3d(dist, dist, 0.0));
101101
body->AddLinkForce(Vector3d(0.0, 0.0, mfr), Vector3d(dist, -dist, 0.0));

0 commit comments

Comments
 (0)