Complete the code to initialize the ROS node for localization.
ros::init(argc, argv, [1]);The ROS node must be initialized with a unique name, here "localization_node" is appropriate for localization tasks.
Complete the code to subscribe to the map topic for localization.
ros::Subscriber map_sub = nh.subscribe([1], 1, mapCallback);
The map topic is usually published on "/map" for localization to use the known map.
Fix the error in the AMCL initialization parameter name.
private_nh.param("[1]", initial_pose, default_pose);
The correct parameter name for AMCL initial pose is "initial_pose_x" as per ROS AMCL conventions.
Fill both blanks to correctly publish the robot's estimated pose.
geometry_msgs::PoseWithCovarianceStamped [1]; pose_pub.publish([2]);
The variable used to hold and publish the estimated pose should be consistent, here "estimated_pose" is used for both declaration and publishing.
Fill all three blanks to create a dictionary of landmarks with their coordinates and filter by distance.
std::map<std::string, double> landmarks = {
{"[1]", 2.5},
{"[2]", 4.0},
{"[3]", 1.2}
};The landmarks map uses string keys for landmark names and double values for their distances. "tower", "bridge", and "fountain" are valid landmark names.
