Giter Club home page Giter Club logo

Comments (7)

BlueBirdHouse avatar BlueBirdHouse commented on August 21, 2024 1

I problem occurs because the goal pose is added to the global_path at the end of the example code. The pose, which is given by the user, contains the wrong time stamp.
To fix it, just comment on the line.

// global_path.poses.push_back(goal);

I also comment on the lines

// pose.header.stamp = clock_->now();
// pose.header.frame_id = global_frame_;

because I don't think the time stamp is needed in this exercise.

The NAV2 seems fragile at this point. I understand that the robot needs to move to a certain place at a certain time in some mission. So, it is completely necessary to add a timestamp for a plain. However, if the timing information is not right, or it contains no timing information, the NAV2 should just give a warning and adapt it.

from navigation2_tutorials.

SteveMacenski avatar SteveMacenski commented on August 21, 2024

Use sim time is inconsistently set.

from navigation2_tutorials.

root-robot avatar root-robot commented on August 21, 2024

Hi @SteveMacenski
Although I was over-writing the use_sim_time parameter value from the terminal, still I changed all the use_sim_time
values to true and still the error remains the same.

from navigation2_tutorials.

root-robot avatar root-robot commented on August 21, 2024

Also when running the nav2_navfn_planner and the smac_planner there was no error and navigation executed perfectly.
Hence a conclusion can be made that the error is not due to the controller but due to the planner.
Currently I am using the nav2_dwb_controller.

Also thanks for the quick response to the issue.

from navigation2_tutorials.

dhruv-rightbot avatar dhruv-rightbot commented on August 21, 2024

Hey @SteveMacenski , @shivaang12 ,
Any update or solution would be very helpful.

Thanks

from navigation2_tutorials.

shivaang12 avatar shivaang12 commented on August 21, 2024

Did you wrote the planner from the article or cloned from here https://github.com/ros-planning/navigation2_tutorials ?

from navigation2_tutorials.

dhruv-rightbot avatar dhruv-rightbot commented on August 21, 2024

Hey, @shivaang12 thanks for the reply.

I cloned it from here a1028c5.
https://github.com/ros-planning/navigation2_tutorials and a1028c5 are basically the same the only difference was that the master branch used weak pointers and the latter used shared pointers.

Any thoughts on why is this happening ??

bool transformPose(
  const std::shared_ptr<tf2_ros::Buffer> tf,
  const std::string frame,
  const geometry_msgs::msg::PoseStamped & in_pose,
  geometry_msgs::msg::PoseStamped & out_pose,
  rclcpp::Duration & transform_tolerance
)
{
  if (in_pose.header.frame_id == frame) {
    out_pose = in_pose;
    return true;
  }

  try {
    tf->transform(in_pose, out_pose, frame);
    return true;
  } catch (tf2::ExtrapolationException & ex) {
    auto transform = tf->lookupTransform(
      frame,
      in_pose.header.frame_id,
      tf2::TimePointZero
    );
    if (
      (rclcpp::Time(in_pose.header.stamp) - rclcpp::Time(transform.header.stamp)) >
      transform_tolerance)
    {
      RCLCPP_ERROR(
        rclcpp::get_logger("tf_help"),
        "Transform data too old when converting from %s to %s",
        in_pose.header.frame_id.c_str(),
        frame.c_str()
      );
      RCLCPP_ERROR(
        rclcpp::get_logger("tf_help"),
        "Data time: %ds %uns, Transform time: %ds %uns",
        in_pose.header.stamp.sec,
        in_pose.header.stamp.nanosec,
        transform.header.stamp.sec,
        transform.header.stamp.nanosec
      );
      return false;
    } else {
      tf2::doTransform(in_pose, out_pose, transform);
      return true;
    }
  } catch (tf2::TransformException & ex) {
    RCLCPP_ERROR(
      rclcpp::get_logger("tf_help"),
      "Exception in transformPose: %s",
      ex.what()
    );
    return false;
  }
  return false;

Because when I print the values in this loop inside the controller server, the values seem to be inside the tolerance range.
And the loop returns true.
So the error is also not arising from here. Currently, I am unable to figure out from where the error is arising.

Thanks

from navigation2_tutorials.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.