Skip to content

Commit dd430bf

Browse files
committed
Simplify
1 parent 6d4c7db commit dd430bf

File tree

1 file changed

+1
-9
lines changed

1 file changed

+1
-9
lines changed

crates/control/src/motion/step_planner.rs

+1-9
Original file line numberDiff line numberDiff line change
@@ -88,15 +88,7 @@ impl StepPlanner {
8888
let target_pose = match segment {
8989
PathSegment::LineSegment(line_segment) => {
9090
let direction = line_segment.1 - line_segment.0;
91-
let rotation = if direction.coords().norm_squared() < f32::EPSILON {
92-
Orientation2::identity()
93-
} else {
94-
let normalized_direction = direction.coords().normalize();
95-
Orientation2::from_cos_sin_unchecked(
96-
normalized_direction.x(),
97-
normalized_direction.y(),
98-
)
99-
};
91+
let rotation = Orientation2::from_vector(direction);
10092
Pose2::from_parts(line_segment.1, rotation)
10193
}
10294
PathSegment::Arc(arc, orientation) => {

0 commit comments

Comments
 (0)