Skip to content

Commit

Permalink
fix bit shift logic :woozy:
Browse files Browse the repository at this point in the history
  • Loading branch information
henrygerardmoore committed Nov 8, 2024
1 parent 9d32f8a commit 3456e8e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions fuse_tutorials/src/apriltag_simulator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ tf2_msgs::msg::TFMessage aprilTagPoses(Robot const& robot)
// calculate offset of each april tag
// we start with offset 1, 1, 1 and switch the z, y, then x as if they were binary digits based off of the april tag
// number see the launch file for a more readable offset for each april tag
bool const x_positive = ((i >> 3) & 1) == 0u;
bool const y_positive = ((i >> 2) & 1) == 0u;
bool const z_positive = ((i >> 1) & 1) == 0u;
bool const x_positive = ((i >> 2) & 1) == 0u;
bool const y_positive = ((i >> 1) & 1) == 0u;
bool const z_positive = ((i >> 0) & 1) == 0u;

// robot position with offset and noise
april_to_base.transform.translation.x = x_positive ? 1. : -1.;
Expand Down Expand Up @@ -231,9 +231,9 @@ tf2_msgs::msg::TFMessage simulateAprilTag(const Robot& robot)
// calculate offset of each april tag
// we start with offset 1, 1, 1 and switch the z, y, then x as if they were binary digits based off of the april tag
// number see the launch file for a more readable offset for each april tag
bool const x_positive = ((i >> 3) & 1) == 0u;
bool const y_positive = ((i >> 2) & 1) == 0u;
bool const z_positive = ((i >> 1) & 1) == 0u;
bool const x_positive = ((i >> 2) & 1) == 0u;
bool const y_positive = ((i >> 1) & 1) == 0u;
bool const z_positive = ((i >> 0) & 1) == 0u;

double const x_offset = x_positive ? 1. : -1.;
double const y_offset = y_positive ? 1. : -1.;
Expand Down

0 comments on commit 3456e8e

Please sign in to comment.