Skip to content

Commit 1bd2cd9

Browse files
committed
test fixes
1 parent 96c20c1 commit 1bd2cd9

6 files changed

Lines changed: 26 additions & 21 deletions

File tree

src/proto/message_translation/tbots_protobuf.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,7 @@ double convertMaxAllowedSpeedModeToMaxAllowedSpeed(
513513
switch (max_allowed_speed_mode)
514514
{
515515
case TbotsProto::MaxAllowedSpeedMode::PHYSICAL_LIMIT:
516-
return robot_constants.robot_max_speed_trajectory_m_per_s;
516+
return robot_constants.robot_trajectory_max_speed_m_per_s;
517517
case TbotsProto::MaxAllowedSpeedMode::STOP_COMMAND:
518518
return STOP_COMMAND_ROBOT_MAX_SPEED_METERS_PER_SECOND -
519519
STOP_COMMAND_SPEED_SAFETY_MARGIN_METERS_PER_SECOND;

src/shared/robot_constants.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ struct RobotConstants
9090

9191
// The maximum speed that the trajectory planner is allowed to command the robot to
9292
// move at, while still leaving headroom for the PID to apply correction on lag. [m/s]
93-
float robot_max_speed_trajectory_m_per_s;
93+
float robot_trajectory_max_speed_m_per_s;
9494

9595
// The maximum acceleration achievable by our robots [m/s^2]
9696
float robot_max_acceleration_m_per_s_2;
@@ -159,14 +159,14 @@ constexpr RobotConstants createRobotConstants()
159159

160160
// Robot's linear movement constants
161161
.robot_max_speed_m_per_s = 3.0f,
162-
.robot_max_speed_trajectory_m_per_s = 2.5f,
163-
.robot_max_acceleration_m_per_s_2 = 2.0f,
164-
.robot_max_deceleration_m_per_s_2 = 1.5f,
162+
.robot_trajectory_max_speed_m_per_s = 3.0f,
163+
.robot_max_acceleration_m_per_s_2 = 3.0f,
164+
.robot_max_deceleration_m_per_s_2 = 3.0f,
165165

166166
// Robot's angular movement constants
167-
.robot_max_ang_speed_rad_per_s = 6.0f,
168-
.robot_max_ang_speed_trajectory_rad_per_s = 5.0f,
169-
.robot_max_ang_acceleration_rad_per_s_2 = 10.0f,
167+
.robot_max_ang_speed_rad_per_s = 10.0f,
168+
.robot_max_ang_speed_trajectory_rad_per_s = 7.0f,
169+
.robot_max_ang_acceleration_rad_per_s_2 = 30.0f,
170170

171171
.wheel_radius_meters = 0.03f,
172172

src/software/ai/evaluation/intercept.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ Point findOvershootInterceptPosition(const Robot& robot, const Point intercept_p
9797
Point best_position = intercept_position;
9898
double final_speed = step_speed;
9999
bool finished = false;
100-
double max_speed = robot.robotConstants().robot_max_speed_trajectory_m_per_s;
100+
double max_speed = robot.robotConstants().robot_trajectory_max_speed_m_per_s;
101101
double max_acc = robot.robotConstants().robot_max_acceleration_m_per_s_2;
102102

103103
while (!finished)

src/software/embedded/primitive_executor.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,11 @@ void PrimitiveExecutor::updateState(const Point& position, const Vector& velocit
6969
orientation_ = orientation;
7070
angular_velocity_ = angular_velocity;
7171

72+
if (!current_primitive_.has_move())
73+
{
74+
return;
75+
}
76+
7277
// If we are lagging behind trajectory too much, we have stalled! We need to
7378
// regenerate trajectory.
7479
if (trajectory_path_.has_value())

src/software/embedded/thunderloop.cpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -291,20 +291,20 @@ inline void Thunderloop::processLocalizationUpdates()
291291
localToGlobalVelocity(createVector(status.local_velocity()),
292292
robot_localizer_.getOrientation()),
293293
createAngularVelocity(status.angular_velocity())});
294+
}
294295

295-
Vector linear_acceleration;
296-
if (imu_poll.has_value() && imu_poll->linear_acceleration.has_value())
297-
{
298-
const auto accel = imu_poll->linear_acceleration.value();
299-
linear_acceleration = Vector(accel[0], accel[1]);
300-
}
296+
Vector linear_acceleration;
297+
if (imu_poll.has_value() && imu_poll->linear_acceleration.has_value())
298+
{
299+
const auto accel = imu_poll->linear_acceleration.value();
300+
linear_acceleration = Vector(accel[0], accel[1]);
301+
}
301302

302-
robot_localizer_.step(linear_acceleration);
303+
robot_localizer_.step(linear_acceleration);
303304

304-
primitive_executor_.updateState(
305-
robot_localizer_.getPosition(), robot_localizer_.getVelocity(),
306-
robot_localizer_.getOrientation(), robot_localizer_.getAngularVelocity());
307-
}
305+
primitive_executor_.updateState(
306+
robot_localizer_.getPosition(), robot_localizer_.getVelocity(),
307+
robot_localizer_.getOrientation(), robot_localizer_.getAngularVelocity());
308308
}
309309

310310
inline void Thunderloop::processPrimitiveExecution(

src/software/world/robot.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ Duration Robot::getTimeToPosition(const Point& destination,
219219
double final_velocity_1d = final_velocity.dot(dist_vector.normalize());
220220

221221
return getTimeToTravelDistance(dist,
222-
robot_constants_.robot_max_speed_trajectory_m_per_s,
222+
robot_constants_.robot_trajectory_max_speed_m_per_s,
223223
robot_constants_.robot_max_acceleration_m_per_s_2,
224224
initial_velocity_1d, final_velocity_1d);
225225
}

0 commit comments

Comments
 (0)