Hi, Adam,
Please find my update of previous question!
Recently, I installed Ubuntu 16.04 + ROS Kinetic for Upboard on my rosbot 2.0 pro and connected it with roscore running on another ubuntu 16.04 machine (with ros-kinetic-desktop-full and dependencies installed).
Currently, I can control my robot to do map slam and map navigation. But there is a Extrapolation Error
always poping up during the map location.
Hope to get your guidence about why this error happens and how to solve it!
The launch file is still like previous:
<launch>
<arg name="use_rviz" default="true"/>
<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher"/>
<node pkg="tf" type="static_transform_publisher" name="ROSbot_laser" args="0 0 0 3.14 0 0 base_link laser 100" />
<include file="$(find rplidar_ros)/launch/rplidar_a3.launch"></include>
<include file="$(find rosbot_ekf)/launch/all.launch">
<arg name="rosbot_pro" value="true"/>
</include>
<node pkg="move_base" type="move_base" name="move_base" output="log">
<param name="controller_frequency" value="10.0" />
<rosparam file="$(find tutorial_pkg)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find tutorial_pkg)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find tutorial_pkg)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find tutorial_pkg)/config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find tutorial_pkg)/config/trajectory_planner.yaml" command="load" />
</node>
<arg name="map_file" default="$(find tutorial_pkg)/maps/map01/map.yaml"/> <!-- path of map file -->
<node name="map_server" pkg="map_server" type="map_server" args="$(arg map_file)" respawn="true" />
<node pkg="amcl" type="amcl" name="amcl" output="screen">
<remap from="scan" to="scan"/>
<param name="odom_frame_id" value="odom"/>
<param name="odom_model_type" value="diff-corrected"/>
<param name="base_frame_id" value="base_link"/>
<param name="update_min_d" value="0.1"/>
<param name="update_min_a" value="0.2"/>
<param name="min_particles" value="500"/>
<param name="global_frame_id" value="map"/>
<param name="tf_broadcast" value="true" />
<param name="initial_pose_x" value="0.0"/>
<param name="initial_pose_y" value="0.0"/>
<param name="initial_pose_a" value="0.0"/>
</node>
<param name="robot_description" command="$(find xacro)/xacro.py '$(find rosbot_description)/urdf/rosbot.xacro'"/>
<node if="$(arg use_rviz)" name="rviz" pkg="rviz" type="rviz" output="screen" />
</launch>
Here is the full logs from the start of map navigation:
... logging to /home/husarion/.ros/log/287a565c-e808-11ea-9675-000c290fedfc/roslaunch-husarion-4223.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
xacro: Traditional processing is deprecated. Switch to --inorder processing!
To check for compatibility of your document, use option --check-order.
For more infos, see http://wiki.ros.org/xacro#Processing_Order
xacro.py is deprecated; please use xacro instead
started roslaunch server http://192.168.28.77:34835/
SUMMARY
========
CLEAR PARAMETERS
* /rosbot_ekf/
PARAMETERS
* /amcl/base_frame_id: base_link
* /amcl/global_frame_id: map
* /amcl/initial_pose_a: 0.0
* /amcl/initial_pose_x: 0.0
* /amcl/initial_pose_y: 0.0
* /amcl/min_particles: 500
* /amcl/odom_frame_id: odom
* /amcl/odom_model_type: diff-corrected
* /amcl/tf_broadcast: True
* /amcl/update_min_a: 0.2
* /amcl/update_min_d: 0.1
* /move_base/TrajectoryPlannerROS/acc_lim_Y: 1.5
* /move_base/TrajectoryPlannerROS/acc_lim_theta: 5.0
* /move_base/TrajectoryPlannerROS/acc_lim_x: 1.5
* /move_base/TrajectoryPlannerROS/holonomic_robot: False
* /move_base/TrajectoryPlannerROS/max_vel_theta: 2.5
* /move_base/TrajectoryPlannerROS/max_vel_x: 0.1
* /move_base/TrajectoryPlannerROS/meter_scoring: True
* /move_base/TrajectoryPlannerROS/min_in_place_vel_theta: 0.25
* /move_base/TrajectoryPlannerROS/min_vel_theta: -2.5
* /move_base/TrajectoryPlannerROS/min_vel_x: 0.01
* /move_base/TrajectoryPlannerROS/xy_goal_tolerance: 0.1
* /move_base/TrajectoryPlannerROS/yaw_goal_tolerance: 0.05
* /move_base/controller_frequency: 10.0
* /move_base/global_costmap/always_send_full_costmap: True
* /move_base/global_costmap/footprint: [[0.12, 0.14], [0...
* /move_base/global_costmap/global_frame: map
* /move_base/global_costmap/height: 15
* /move_base/global_costmap/inflation_radius: 2.5
* /move_base/global_costmap/laser_scan_sensor/clearing: True
* /move_base/global_costmap/laser_scan_sensor/data_type: LaserScan
* /move_base/global_costmap/laser_scan_sensor/marking: True
* /move_base/global_costmap/laser_scan_sensor/sensor_frame: laser
* /move_base/global_costmap/laser_scan_sensor/topic: scan
* /move_base/global_costmap/map_topic: /map
* /move_base/global_costmap/observation_sources: laser_scan_sensor
* /move_base/global_costmap/obstacle_range: 6.0
* /move_base/global_costmap/origin_x: -7.5
* /move_base/global_costmap/origin_y: -7.5
* /move_base/global_costmap/publish_frequency: 2.5
* /move_base/global_costmap/raytrace_range: 8.5
* /move_base/global_costmap/resolution: 0.01
* /move_base/global_costmap/robot_base_frame: base_link
* /move_base/global_costmap/rolling_window: True
* /move_base/global_costmap/static_map: False
* /move_base/global_costmap/subscribe_to_updates: True
* /move_base/global_costmap/transform_tolerance: 0.5
* /move_base/global_costmap/update_frequency: 2.5
* /move_base/global_costmap/width: 15
* /move_base/local_costmap/always_send_full_costmap: True
* /move_base/local_costmap/footprint: [[0.12, 0.14], [0...
* /move_base/local_costmap/global_frame: map
* /move_base/local_costmap/height: 3
* /move_base/local_costmap/inflation_radius: 1.0
* /move_base/local_costmap/laser_scan_sensor/clearing: True
* /move_base/local_costmap/laser_scan_sensor/data_type: LaserScan
* /move_base/local_costmap/laser_scan_sensor/marking: True
* /move_base/local_costmap/laser_scan_sensor/sensor_frame: laser
* /move_base/local_costmap/laser_scan_sensor/topic: scan
* /move_base/local_costmap/map_topic: /map
* /move_base/local_costmap/observation_sources: laser_scan_sensor
* /move_base/local_costmap/obstacle_range: 6.0
* /move_base/local_costmap/origin_x: -1.5
* /move_base/local_costmap/origin_y: -1.5
* /move_base/local_costmap/publish_frequency: 5
* /move_base/local_costmap/raytrace_range: 8.5
* /move_base/local_costmap/resolution: 0.01
* /move_base/local_costmap/robot_base_frame: base_link
* /move_base/local_costmap/rolling_window: True
* /move_base/local_costmap/static_map: False
* /move_base/local_costmap/subscribe_to_updates: True
* /move_base/local_costmap/transform_tolerance: 0.25
* /move_base/local_costmap/update_frequency: 5
* /move_base/local_costmap/width: 3
* /robot_description: <?xml version="1....
* /rosbot_ekf/acceleration_gains: [0.8, 0.0, 0.0, 0...
* /rosbot_ekf/acceleration_limits: [1.3, 0.0, 0.0, 0...
* /rosbot_ekf/base_link_frame: base_link
* /rosbot_ekf/control_config: [True, False, Fal...
* /rosbot_ekf/control_timeout: 0.2
* /rosbot_ekf/debug: False
* /rosbot_ekf/debug_out_file: /path/to/debug/fi...
* /rosbot_ekf/deceleration_gains: [1.0, 0.0, 0.0, 0...
* /rosbot_ekf/deceleration_limits: [1.3, 0.0, 0.0, 0...
* /rosbot_ekf/frequency: 20
* /rosbot_ekf/imu0: imu
* /rosbot_ekf/imu0_config: [False, False, Fa...
* /rosbot_ekf/imu0_differential: True
* /rosbot_ekf/imu0_linear_acceleration_rejection_threshold: 0.8
* /rosbot_ekf/imu0_nodelay: False
* /rosbot_ekf/imu0_pose_rejection_threshold: 0.8
* /rosbot_ekf/imu0_queue_size: 4
* /rosbot_ekf/imu0_relative: True
* /rosbot_ekf/imu0_remove_gravitational_acceleration: True
* /rosbot_ekf/imu0_twist_rejection_threshold: 0.8
* /rosbot_ekf/initial_estimate_covariance: ['1e-9', 0, 0, 0,...
* /rosbot_ekf/map_frame: map
* /rosbot_ekf/odom0: odom/wheel
* /rosbot_ekf/odom0_config: [True, True, True...
* /rosbot_ekf/odom0_differential: False
* /rosbot_ekf/odom0_nodelay: False
* /rosbot_ekf/odom0_queue_size: 6
* /rosbot_ekf/odom0_relative: True
* /rosbot_ekf/odom_frame: odom
* /rosbot_ekf/print_diagnostics: True
* /rosbot_ekf/process_noise_covariance: [0.05, 0, 0, 0, 0...
* /rosbot_ekf/publish_acceleration: False
* /rosbot_ekf/publish_tf: True
* /rosbot_ekf/sensor_timeout: 0.2
* /rosbot_ekf/stamped_control: False
* /rosbot_ekf/transform_time_offset: 0.0
* /rosbot_ekf/transform_timeout: 0.0
* /rosbot_ekf/two_d_mode: False
* /rosbot_ekf/use_control: True
* /rosbot_ekf/world_frame: odom
* /rosdistro: kinetic
* /rosversion: 1.12.14
* /rplidarNode/angle_compensate: True
* /rplidarNode/frame_id: laser
* /rplidarNode/inverted: False
* /rplidarNode/scan_mode: Sensitivity
* /rplidarNode/serial_baudrate: 256000
* /rplidarNode/serial_port: /dev/ttyUSB0
* /serial_node/baud: 460800
* /serial_node/port: /dev/ttyS4
NODES
/
ROSbot_laser (tf/static_transform_publisher)
amcl (amcl/amcl)
imu_publisher (tf/static_transform_publisher)
map_server (map_server/map_server)
move_base (move_base/move_base)
msgs_conversion (rosbot_ekf/msgs_conversion)
robot_state_publisher (robot_state_publisher/state_publisher)
rosbot_ekf (robot_localization/ekf_localization_node)
rplidarNode (rplidar_ros/rplidarNode)
serial_node (rosserial_python/serial_node.py)
ROS_MASTER_URI=http://192.168.28.11:11311
process[robot_state_publisher-1]: started with pid [4235]
process[ROSbot_laser-2]: started with pid [4236]
process[rplidarNode-3]: started with pid [4238]
process[serial_node-4]: started with pid [4244]
process[msgs_conversion-5]: started with pid [4246]
process[rosbot_ekf-6]: started with pid [4249]
process[imu_publisher-7]: started with pid [4255]
process[move_base-8]: started with pid [4257]
process[map_server-9]: started with pid [4261]
process[amcl-10]: started with pid [4265]
[ INFO] [1598494210.944708866]: RPLIDAR running on ROS package rplidar_ros. SDK Version:1.12.0
[INFO] [1598494211.390438]: ROS Serial Python Node
RPLIDAR S/N: AFED9A87C5E392D2A5E492F83F38316C
[ INFO] [1598494211.449502870]: Firmware Ver: 1.27
[ INFO] [1598494211.449684786]: Hardware Rev: 6
[ INFO] [1598494211.450895987]: RPLidar health status : 0
[INFO] [1598494211.543528]: Connecting to /dev/ttyS4 at 460800 baud
[ INFO] [1598494212.113273543]: current scan mode: Sensitivity, max_distance: 25.0 m, Point number: 15.9K , angle_compensate: 4
[INFO] [1598494213.693532]: Note: publish buffer size is 768 bytes
[INFO] [1598494213.765040]: Setup service server on config [rosbot_ekf/Configuration]
[ INFO] [1598494213.778840642]: Requesting the map...
[INFO] [1598494213.855754]: Setup publisher on battery [sensor_msgs/BatteryState]
[INFO] [1598494213.897259]: Setup publisher on pose [geometry_msgs/PoseStamped]
[ INFO] [1598494213.897598936]: Received a 2016 X 3136 map @ 0.010 m/pix
[INFO] [1598494213.918378]: Setup publisher on velocity [geometry_msgs/Twist]
[INFO] [1598494213.950998]: Setup publisher on range/fr [sensor_msgs/Range]
[INFO] [1598494213.984342]: Setup publisher on range/fl [sensor_msgs/Range]
[INFO] [1598494214.008144]: Setup publisher on range/rr [sensor_msgs/Range]
[INFO] [1598494214.026590]: Setup publisher on range/rl [sensor_msgs/Range]
[INFO] [1598494214.059805]: Setup publisher on joint_states [sensor_msgs/JointState]
[INFO] [1598494214.097131]: Setup publisher on mpu9250 [rosbot_ekf/Imu]
[INFO] [1598494214.116677]: Setup publisher on buttons [std_msgs/UInt8]
[INFO] [1598494214.121338]: Note: subscribe buffer size is 768 bytes
[INFO] [1598494214.171134]: Setup subscriber on cmd_vel [geometry_msgs/Twist]
[INFO] [1598494214.183112]:
______ _____ _____ _ _ __
| ___ \| _ |/ ___|| | | | / _|
| |_/ /| | | |\ `--. | |__ ___ | |_ | |_ __ __
| / | | | | `--. \| '_ \ / _ \ | __| | _|\ \ /\ / /
| |\ \ \ \_/ //\__/ /| |_) || (_) || |_ | | \ V V /
\_| \_| \___/ \____/ |_.__/ \___/ \__| |_| \_/\_/
Firmware version: 0.10.1
[ INFO] [1598494214.919235643]: Initializing likelihood field model; this can take some time on large maps...
[ INFO] [1598494217.802027151]: Done initializing likelihood field model.
[ERROR] [1598494435.694541676]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past. Requested time 1598494425.615524550 but the earliest data is at time 1598494425.659580946, when looking up transform from frame [base_link] to frame [map]
[ERROR] [1598494436.714969160]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past. Requested time 1598494425.615524550 but the earliest data is at time 1598494426.679581165, when looking up transform from frame [base_link] to frame [map]
[ERROR] [1598494437.715043870]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past. Requested time 1598494425.615524550 but the earliest data is at time 1598494427.639765024, when looking up transform from frame [base_link] to frame [map]
[ERROR] [1598494438.715461080]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past. Requested time 1598494425.615524550 but the earliest data is at time 1598494428.659765005, when looking up transform from frame [base_link] to frame [map]
[ERROR] [1598494439.794365650]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past. Requested time 1598494425.615524550 but the earliest data is at time 1598494429.744091034, when looking up transform from frame [base_link] to frame [map]
[ERROR] [1598494440.795205963]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past. Requested time 1598494425.615524550 but the earliest data is at time 1598494430.764091015, when looking up transform from frame [base_link] to frame [map]
[ERROR] [1598494441.814515703]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past. Requested time 1598494425.615524550 but the earliest data is at time 1598494431.724091053, when looking up transform from frame [base_link] to frame [map]
[ERROR] [1598494442.815033431]: Extrapolation Error looking up robot pose: Lookup would require extrapolation into the past. Requested time 1598494425.615524550 but the earliest data is at time 1598494432.740044117, when looking up transform from frame [base_link] to frame [map]
......
the output of rosrun tf view_frames
is like:
In the map location, I used MoveBaseGoal
to set the target location and tf.TransformListener
to get the robot location in the map like:
##set the target location
goal = MoveBaseGoal()
goal.target_pose.header.frame_id = 'map'
goal.target_pose.header.stamp = rospy.Time.now()
goal.target_pose.pose = Pose(Point(pos['x'], pos['y'], 0.000),
Quaternion(quat['r1'], quat['r2'], quat['r3'], quat['r4']))
self.move_base.send_goal(goal)
##get the location
istener.waitForTransform("/map", "/base_link", rospy.Time(0), rospy.Duration(10.0))
trans, rot = listener.lookupTransform("/map", "/base_link", rospy.Time(0))
The map navigation and location can succeed even if when Extrapolation Error
happens, here is a log of the robot naviagtion and location:
INFO - Wait for the action server to come up
[INFO] [1598494719.996265]: Go to (0, 0) pose
INFO - target_pose:
header:
seq: 0
stamp:
secs: 1598494719
nsecs: 998287916
frame_id: "map"
pose:
position:
x: 0
y: 0
z: 0.0
orientation:
x: 0.0
y: 0.0
z: 0.0
w: 1.0
INFO - arrived!!!
[INFO] [1598494744.724462]: Hooray, reached the desired pose
Warning: TF_OLD_DATA ignoring data from the past for frame laser at time 1.59849e+09 according to authority /robot_state_publisher
Possible reasons are listed at http://wiki.ros.org/tf/Errors%20explained
at line 277 in /tmp/binarydeb/ros-kinetic-tf2-0.5.20/src/buffer_core.cpp
INFO - current position -- x:0.0474696515822, y:0.0722862027887
Thanks!