Skip to content

Commit

Permalink
Simplify
Browse files Browse the repository at this point in the history
  • Loading branch information
rmburg committed Oct 5, 2024
1 parent 6d4c7db commit dd430bf
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions crates/control/src/motion/step_planner.rs
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,7 @@ impl StepPlanner {
let target_pose = match segment {
PathSegment::LineSegment(line_segment) => {
let direction = line_segment.1 - line_segment.0;
let rotation = if direction.coords().norm_squared() < f32::EPSILON {
Orientation2::identity()
} else {
let normalized_direction = direction.coords().normalize();
Orientation2::from_cos_sin_unchecked(
normalized_direction.x(),
normalized_direction.y(),
)
};
let rotation = Orientation2::from_vector(direction);
Pose2::from_parts(line_segment.1, rotation)
}
PathSegment::Arc(arc, orientation) => {
Expand Down

0 comments on commit dd430bf

Please sign in to comment.