Strange behavior between move_base Navigation Stack and Rviz

asked 2018-11-22 12:00:12 -0600

karimemara17 gravatar image

updated 2018-11-23 00:49:18 -0600

This is my graduation project from college and I can't figure out the problem. I have an environment build specifically for this project and build a map of it with hector SLAM. The goal is for the Mobile robot moving around the static map for specific goal set by Rviz.

UPDATE THE OLD 2 BEHAVIORS ARE NOT HAPPENING ANYMORE: I ADJUSTED LINOROBOT COSTMAPS TO WORK FOR ME AND IT FIXED THOSE 2 ERRORS. HOWEVER, THIS SOLUTION INTRODUCED:

DWA planner failed to produce path

Off Map 1.098, -0.050

Old behaviors:

Rviz behavior Video: Google drive Rviz localization video

Rviz behavior when trying to estimate pose: Google drive estimate pose behavior NOTE: the robot was not in the designed environment when taking this video, this video is just for demonstration

The errors I'm getting: UPDATED

roswtf:

   WARNING The following node subscriptions are unconnected:
 * /amcl:
   * /tf_static
 * /rviz_1542954558890249147:
   * /move_base/TrajectoryPlannerROS/global_plan
   * /move_base/NavfnROS/plan
   * /tf_static
   * /map_updates
   * /move_base/TrajectoryPlannerROS/local_plan
 * /rqt_gui_py_node_27505:
   * /statistics
 * /move_base:
   * /tf_static
   * /move_base/cancel

WARNING Received out-of-date/future transforms:
 * receiving transform from [/amcl] that differed from ROS time by 1.176933497s


Found 1 error(s).

ERROR The following nodes should be connected but aren't:
 * /move_base->/move_base (/move_base/global_costmap/footprint)
 * /move_base->/move_base (/move_base/local_costmap/footprint)

AMCL warning: [ WARN] [1542907954.448988739]: Frame_id of map received:'/odom' doesn't match global_frame_id:'map'. This could cause issues with reading published topics FIXED BY MAKING MAP_SERVER FRAME ID TO BE MAP

Rviz Global option's fixed frame: map FIXED BY THE COSTMAP CONFIG Blockquote TF configuration: Tree --> odom --> base_link --> laser --> map

current updated TF configuration: map-->odom-->base_link-->laser

rqt_graph: rqt graph picture

Packages used:

  • Rplidar (for the lidar I have)
  • motor_hat (for the motor control)
  • robot_setup_tf (for publishing the tf information)
  • robot_drive (for publishing commands for the motor_hat)
  • differential_drive (for publishing odom, twist commands and the PID controller)
  • move_base (costmaps)
  • amcl (for localization)
  • map_server (to publish the map)

robot launch file:

<launch>

  <rosparam param="ticks_meter">6000</rosparam>
  <include file="$(find rplidar_ros)/launch/rplidar.launch"/>
  <node pkg="robot_setup_wheelencoders" type="rwheel.py" name="rwheel"/>
  <node pkg="robot_setup_wheelencoders" type="lwheel.py" name="lwheel"/>
  <node pkg="differential_drive" type="diff_tf.py" name="diff_tf" output="screen">
     <rosparam param="rate">8.0</rosparam>
     <rosparam param="base_width">0.294</rosparam>
  </node>
  <node pkg="robot_setup_tf" type="tf_broadcaster" name="tf_broadcaster"/>
  <node pkg="motor_hat" type="motor_hat_node" name="driving"/>
  <node pkg="robot_drive" type="robot_drive.py" name="drive_cmd"/>
  <node pkg="differential_drive" type="twist_to_motors.py" name="twist_to_motors" output="screen">
    <rosparam param="base_width">0.294</rosparam>
  </node>
  <node pkg="differential_drive" type="pid_velocity.py" name="lpid_velocity">
      <remap from="wheel" to="lwheel"/>
      <remap from="motor_cmd" to="lmotor_cmd"/>
      <remap from="wheel_vtarget" to="lwheel_vtarget"/>
      <remap from="wheel_vel" to="lwheel_vel"/>
      <rosparam param="Kp">75</rosparam>
      <rosparam param="Ki">148</rosparam>
      <rosparam param="Kd">0</rosparam>
      <rosparam param="out_min">-255</rosparam>
      <rosparam param="out_max">255</rosparam>
      <rosparam param="rate">30</rosparam>
      <rosparam param="timeout_ticks">4</rosparam>
      <rosparam param="rolling_pts">5</rosparam>
  </node>
  <node pkg="differential_drive" type="pid_velocity.py" name="rpid_velocity">
      <remap from="wheel" to="rwheel"/>
      <remap from="motor_cmd" to="rmotor_cmd"/>
      <remap from="wheel_vtarget ...
(more)
edit retag flag offensive close merge delete

Comments

Here's a bag file to of the project too Google drive bag file link

karimemara17 gravatar imagekarimemara17 ( 2018-11-22 13:15:51 -0600 )edit
1

I don't see you odom-->base_link transform. Is that in there somewhere? Also, TF configuration: Tree --> odom --> base_link --> laser --> map is incorrect if that is really is how it is set up. Run rosrun tf view_frames to get view. Should be map-->odom-->base_link-->laser. What is "Tree"?

billy gravatar imagebilly ( 2018-11-22 15:55:25 -0600 )edit

I fixed the tree to what you suggested yes now it is "map-->odom-->base_link-->laser" I think amcl from the Navigation Stack provide the transform from odom to base_link, right?

I'm working on it now and after fixing the tree, a new error for the the local_costmap it says it doesn't have a map!

karimemara17 gravatar imagekarimemara17 ( 2018-11-22 16:31:04 -0600 )edit

The frame pdf generated by rosrun tf view frame

karimemara17 gravatar imagekarimemara17 ( 2018-11-22 19:06:56 -0600 )edit
1

Your frame.pdf shows odom-->base_link is coming from the diff node I didn't see above. AMCL is publishing the map --> odom TF so you've got a lot working. Can you see the map in RVIZ? Update your question with new error.

billy gravatar imagebilly ( 2018-11-22 23:36:42 -0600 )edit

Is it okay that the frames are coming from the diff node and the AMCL? I will update it right now. UPDATED. should I close this question and start a new one? and Billy do you mind sharing contact information if you are welling to help me get this to work? the problems are path and driving

karimemara17 gravatar imagekarimemara17 ( 2018-11-23 00:22:28 -0600 )edit

Me providing contact information would require I get named credit on the Project Cover page. Better to keep it public to help others with similar questions.

Current error of "off map" seems intuitive. How did you set initial pose and goal?

billy gravatar imagebilly ( 2018-11-23 15:51:16 -0600 )edit