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](https://drive.google.com/file/d/1AKhtZoMIMrkTengJJV6RVGA-c4bFaosM/view?usp=sharing)
>> Rviz behavior when trying to estimate
> pose: [Google drive estimate pose
> behavior](https://drive.google.com/file/d/1Qr6w6JOIF65OAzy3w22B0fuvbzO3LuPg/view?usp=sharing)
> **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](https://drive.google.com/file/d/1Q5SWaZAXKYHpMi4VTCKD22pr-TfieJ_Q/view?usp=sharing)
**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:**
6000 8.0 0.294 0.294 75 148 0 -255 255 30 4 5 75 148 0 -255 255 30 4 5
**move_base launch file:**
**robot_setup_tf:**
#include
#include
int main(int argc, char** argv)
{
ros::init(argc, argv, "robot_tf_publisher");
ros::NodeHandle n;
ros::Rate r(100);
tf::TransformBroadcaster broadcaster;
while(n.ok()){
//broadcaster.sendTransform(
//tf::StampedTransform(
//tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.0, 0.0, 0.0)),
//ros::Time::now(), "map", "odom"));
broadcaster.sendTransform(
tf::StampedTransform(
tf::Transform(tf::Quaternion(0, 0, 0, 1), tf::Vector3(0.0, 0.0, 0.2)),
ros::Time::now(),"base_link", "laser"));
r.sleep();
}
}
**Costmaps:**
base_local_planner_params.yaml:
TrajectoryPlannerROS:
max_vel_x: 0.45
min_vel_x: 0.1
max_vel_theta: 1.0
min_vel_theta: -1.0
min_in_place_vel_theta: 0.4
escape_vel: -0.1
acc_lim_theta: 3.2
acc_lim_x: 2.5
acc_lim_y: 2.5
holonomic_robot: false
yaw_goal_tolerance: 0.05
xy_goal_tolerance: 0.10
latch_xy_goal_tolerance: false
sim_time: 2
sim_granularity: 0.10
angular_sim_granularity: 0.10
vx_samples: 3
vtheta_samples: 20
meter_scoring: true
pdist_scale: 0.6
gdist_scale: 1.0
occdist_scale: 0.1
heading_lookahead: 0.325
heading_scoring: false
dwa: true
global_frame_id: odom
oscillation_reset_dist: 0.30
prune_plan: true
costmap_common_params.yaml:
footprint: [[-0.15,-0.15],[-0.15,0.15], [0.15, 0.15], [0.15,-0.15]]
obstacle_range: 2.0
raytrace_range: 2.5
inflation_radius: 0.3
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: laser, data_type: LaserScan, topic: scan, marking: true, clearing: true}
global_costmap_params.yaml:
global_costmap:
global_frame: map
robot_base_frame: base_link
update_frequency: 5.0
static_map: true
transform_tolerance: 0.5
local_costmap_params.yaml:
local_costmap:
global_frame: odom
robot_base_frame: base_link
update_frequency: 5.0
publish_frequency: 2.0
static_map: false
rolling_window: true
width: 2.0
height: 2.0
resolution: 0.05
transform_tolerance: 0.5
**amcl configuration launch file:**
↧