Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/proto/message_translation/er_force_world_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <gtest/gtest.h>

#include "software/geom/angular_velocity.h"
#include "software/test_util/test_util.h"


Expand Down Expand Up @@ -47,7 +48,7 @@ TEST(ErForceWorldTest, test_create_robot)
const Point expected_pos(sim_robot->p_x(), sim_robot->p_y());
const Vector expected_vel(sim_robot->v_x(), sim_robot->v_y());
RobotState expected_state(expected_pos, expected_vel, Angle::zero(),
Angle::fromRadians(5.0));
AngularVelocity::fromRadians(5.0));
EXPECT_EQ(0, test_robot.id());
EXPECT_TRUE(TestUtil::equalWithinTolerance(test_robot.currentState(), expected_state,
1e-6, Angle::fromDegrees(0)));
Expand Down
2 changes: 1 addition & 1 deletion src/proto/message_translation/tbots_geometry_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ TEST(TbotsProtobufTest, point_msg_test)

TEST(TbotsProtobufTest, angular_velocity_msg_test)
{
auto angular_velocity = Angle::fromRadians(4.20);
auto angular_velocity = AngularVelocity::fromRadians(4.20);
auto angular_velocity_msg = createAngularVelocityProto(angular_velocity);

EXPECT_EQ(angular_velocity_msg->radians_per_second(), angular_velocity.toRadians());
Expand Down
5 changes: 3 additions & 2 deletions src/proto/message_translation/tbots_protobuf.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "proto/message_translation/tbots_protobuf.h"

#include "software/ai/navigator/trajectory/bang_bang_trajectory_1d_angular.h"
#include "software/geom/angular_acceleration.h"
#include "software/logger/logger.h"


Expand Down Expand Up @@ -484,9 +485,9 @@ BangBangTrajectory1DAngular createAngularTrajectoryFromParams(
initial_velocity,
AngularVelocity::fromRadians(
robot_constants.robot_trajectory_max_ang_speed_rad_per_s),
AngularVelocity::fromRadians(
AngularAcceleration::fromRadians(
robot_constants.robot_max_ang_acceleration_rad_per_s_2),
AngularVelocity::fromRadians(
AngularAcceleration::fromRadians(
robot_constants.robot_max_ang_acceleration_rad_per_s_2));
}

Expand Down
2 changes: 1 addition & 1 deletion src/proto/message_translation/tbots_protobuf_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ TEST(TbotsProtobufTest, robot_state_msg_test)
auto position = Point(4.20, 4.20);
auto velocity = Vector(4.20, 4.20);
auto orientation = Angle::fromRadians(4.20);
auto angular_velocity = Angle::fromRadians(4.20);
auto angular_velocity = AngularVelocity::fromRadians(4.20);

Robot robot(0, position, velocity, orientation, angular_velocity,
Timestamp::fromSeconds(0));
Expand Down
4 changes: 2 additions & 2 deletions src/software/ai/hl/stp/play/passing_sim_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ def setup_pass_and_robots(
index,
location,
tbots_cpp.Vector(0.0, 0.0),
tbots_cpp.Angle.fromRadians(0),
tbots_cpp.Angle(),
tbots_cpp.AngularVelocity(),
tbots_cpp.Timestamp(),
)
for index, location in enumerate(blue_robot_locations)
Expand All @@ -81,8 +81,8 @@ def setup_pass_and_robots(
index,
location,
tbots_cpp.Vector(0.0, 0.0),
tbots_cpp.Angle.fromRadians(0),
tbots_cpp.Angle(),
tbots_cpp.AngularVelocity(),
tbots_cpp.Timestamp(),
)
for index, location in enumerate(enemy_robot_positions)
Expand Down
5 changes: 3 additions & 2 deletions src/software/ai/hl/stp/tactic/move_primitive.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "proto/primitive/primitive_msg_factory.h"
#include "software/ai/navigator/trajectory/bang_bang_trajectory_1d_angular.h"
#include "software/geom/algorithms/end_in_obstacle_sample.h"
#include "software/geom/angular_acceleration.h"


MovePrimitive::MovePrimitive(
Expand Down Expand Up @@ -42,9 +43,9 @@ MovePrimitive::MovePrimitive(
robot.orientation(), final_angle, robot.angularVelocity(),
AngularVelocity::fromRadians(
robot.robotConstants().robot_max_ang_speed_rad_per_s),
AngularVelocity::fromRadians(
AngularAcceleration::fromRadians(
robot.robotConstants().robot_max_ang_acceleration_rad_per_s_2),
AngularVelocity::fromRadians(
AngularAcceleration::fromRadians(
robot.robotConstants().robot_max_ang_acceleration_rad_per_s_2));

estimated_cost =
Expand Down
12 changes: 9 additions & 3 deletions src/software/geom/BUILD
Original file line number Diff line number Diff line change
@@ -1,9 +1,15 @@
package(default_visibility = ["//visibility:public"])

cc_library(
name = "generic_angle",
hdrs = ["generic_angle.h"],
deps = [":geom_constants"],
)

cc_library(
name = "angle",
hdrs = ["angle.h"],
deps = [":geom_constants"],
deps = [":generic_angle"],
)

cc_library(
Expand Down Expand Up @@ -36,13 +42,13 @@ cc_library(
cc_library(
name = "angular_velocity",
hdrs = ["angular_velocity.h"],
deps = [":angle"],
deps = [":generic_angle"],
)

cc_library(
name = "angular_acceleration",
hdrs = ["angular_acceleration.h"],
deps = [":angle"],
deps = [":generic_angle"],
)

cc_library(
Expand Down
Loading
Loading