Robotics StackExchange | Archived questions

Units for poses used in SMAC planner code

Hello,

While studying the SMAC planner, I got confused by the various units/coords used to describe a "pose".*

So far I identified three frames in which coordinates of a pose are expressed:

But I'm confused with this piece of code: https://github.com/ros-planning/navigation2/blob/3bb9a95719539fcdfedf520c63339bc3157f80b4/nav2_smac_planner/src/node_lattice.cpp#L252

    // Convert primitive pose into grid space if it should be checked
    prim_pose._x = initial_pose._x + (it->_x / grid_resolution);
    prim_pose._y = initial_pose._y + (it->_y / grid_resolution);
    // If reversing, invert the angle because the robot is backing into the primitive
    // not driving forward with it
    if (is_backwards) {
      prim_pose._theta = std::fmod(it->_theta + M_PI, 2.0 * M_PI);
    } else {
      prim_pose._theta = it->_theta;
    }
    if (collision_checker->inCollision(
        prim_pose._x,
        prim_pose._y,
        prim_pose._theta / bin_size /*bin in collision checker*/,
        traverse_unknown))
    {
      return false;
    }

Then:

Then inCollision() is here called using the wrong units ? (prim_pose being lattice grid coords, but inCollision() expecting costmap's coords ?)

Am I missing something ?

Thanks,

Asked by PatoInso on 2023-06-23 07:42:13 UTC

Comments

Answers