sua ten file
This commit is contained in:
@@ -11,7 +11,7 @@ if(NOT CMAKE_BUILD_TYPE)
|
||||
set(CMAKE_BUILD_TYPE Release)
|
||||
endif()
|
||||
|
||||
set(PACKAGES_DIR geometry_msgs std_msgs nav_core nav_core2 robot_nav_2d_utils pthread)
|
||||
set(PACKAGES_DIR geometry_msgs robot_std_msgs nav_core nav_core2 robot_nav_2d_utils pthread)
|
||||
|
||||
find_package(Boost REQUIRED COMPONENTS filesystem system)
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ Where the grid exists in the world is defined by six parameters.
|
||||
* `frame_id` which is the TF frame the grid is defined relative to.
|
||||
* `origin_x` and `origin_y` which define the offset in meters from the root of the TF frame to the minimum corner of the (0, 0) cell.
|
||||
|
||||
Together, these components make a [`nav_grid::NavGridInfo`](include/nav_grid/nav_grid_info.h) struct. It evolved from the [`nav_msgs::MapMetaData` message](http://docs.ros.org/melodic/api/nav_msgs/html/msg/MapMetaData.html) but without `map_load_time`, simplified origin geometry and the `frame_id` added. Note: for general efficiency of computation (particularly moving the grid while retaining some of the values) there is no rotation component to the origin. Each grid is locked to the orientation of its TF frame.
|
||||
Together, these components make a [`nav_grid::NavGridInfo`](include/nav_grid/nav_grid_info.h) struct. It evolved from the [`robot_nav_msgs::MapMetaData` message](http://docs.ros.org/melodic/api/robot_nav_msgs/html/msg/MapMetaData.html) but without `map_load_time`, simplified origin geometry and the `frame_id` added. Note: for general efficiency of computation (particularly moving the grid while retaining some of the values) there is no rotation component to the origin. Each grid is locked to the orientation of its TF frame.
|
||||
|
||||
The default values are `width=0, height=0, resolution=1.0, frame_id="map", origin_x=0.0, origin_y=0.0`.
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace nav_grid
|
||||
/**
|
||||
* @struct NavGridInfo
|
||||
* This class defines a way to discretize a finite section of the world into a grid.
|
||||
* It contains similar information to the ROS msg nav_msgs/MapMetaData (aka the info field of nav_msgs/OccupancyGrid)
|
||||
* It contains similar information to the ROS msg robot_nav_msgs/MapMetaData (aka the info field of robot_nav_msgs/OccupancyGrid)
|
||||
* except the map_load_time is removed, the geometry is simplified from a Pose to xy coordinates, and the frame_id
|
||||
* is added.
|
||||
*/
|
||||
|
||||
@@ -79,7 +79,7 @@ Ngược lại, sẽ build ở **Standalone CMake mode**.
|
||||
|
||||
### ROS Packages (khi build với Catkin):
|
||||
- roscpp, rospy
|
||||
- std_msgs, geometry_msgs, nav_msgs
|
||||
- robot_std_msgs, geometry_msgs, robot_nav_msgs
|
||||
- tf2, tf2_ros
|
||||
- actionlib, dynamic_reconfigure
|
||||
|
||||
|
||||
@@ -65,7 +65,7 @@ add_library(move_base SHARED ${SOURCES} ${HEADERS})
|
||||
# Standalone CMake mode: link all dependencies manually
|
||||
set(PACKAGES_DIR
|
||||
geometry_msgs
|
||||
std_msgs
|
||||
robot_std_msgs
|
||||
move_base_core
|
||||
nav_core
|
||||
costmap_2d
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
|
||||
#include <costmap_2d/costmap_2d_robot.h>
|
||||
#include <costmap_2d/costmap_2d.h>
|
||||
#include <nav_msgs/GetPlan.h>
|
||||
#include <robot_nav_msgs/GetPlan.h>
|
||||
#include <robot_protocol_msgs/Order.h>
|
||||
|
||||
#include <robot/node_handle.h>
|
||||
|
||||
@@ -18,8 +18,8 @@
|
||||
|
||||
#include <costmap_2d/static_layer.h>
|
||||
#include <costmap_2d/voxel_layer.h>
|
||||
#include <nav_msgs/OccupancyGrid.h>
|
||||
#include <sensor_msgs/LaserScan.h>
|
||||
#include <robot_nav_msgs/OccupancyGrid.h>
|
||||
#include <robot_sensor_msgs/LaserScan.h>
|
||||
|
||||
move_base::MoveBase::MoveBase()
|
||||
: initialized_(false),
|
||||
@@ -187,7 +187,7 @@ void move_base::MoveBase::initialize(robot::TFListenerPtr tf)
|
||||
boost::shared_ptr<costmap_2d::StaticLayer> static_layer = boost::dynamic_pointer_cast<costmap_2d::StaticLayer>(*layer);
|
||||
if (!static_layer)
|
||||
continue;
|
||||
nav_msgs::OccupancyGrid *occupancy_grid = new nav_msgs::OccupancyGrid();
|
||||
robot_nav_msgs::OccupancyGrid *occupancy_grid = new robot_nav_msgs::OccupancyGrid();
|
||||
occupancy_grid->header.frame_id = "map";
|
||||
occupancy_grid->header.stamp = robot::Time::now();
|
||||
occupancy_grid->info.resolution = 0.05;
|
||||
@@ -206,7 +206,7 @@ void move_base::MoveBase::initialize(robot::TFListenerPtr tf)
|
||||
occupancy_grid->data[i] = costmap_2d::NO_INFORMATION;
|
||||
}
|
||||
if (occupancy_grid)
|
||||
static_layer->dataCallBack<nav_msgs::OccupancyGrid>(*occupancy_grid, "map");
|
||||
static_layer->dataCallBack<robot_nav_msgs::OccupancyGrid>(*occupancy_grid, "map");
|
||||
}
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
@@ -251,7 +251,7 @@ void move_base::MoveBase::initialize(robot::TFListenerPtr tf)
|
||||
boost::shared_ptr<costmap_2d::VoxelLayer> obstacle_layer = boost::dynamic_pointer_cast<costmap_2d::VoxelLayer>(*layer);
|
||||
if (!obstacle_layer)
|
||||
continue;
|
||||
sensor_msgs::LaserScan *laser_scan = new sensor_msgs::LaserScan();
|
||||
robot_sensor_msgs::LaserScan *laser_scan = new robot_sensor_msgs::LaserScan();
|
||||
laser_scan->header.frame_id = "laser";
|
||||
laser_scan->header.stamp = robot::Time::now();
|
||||
laser_scan->angle_min = -M_PI;
|
||||
@@ -267,7 +267,7 @@ void move_base::MoveBase::initialize(robot::TFListenerPtr tf)
|
||||
laser_scan->ranges[i] = 10.0;
|
||||
}
|
||||
if (laser_scan)
|
||||
obstacle_layer->dataCallBack<sensor_msgs::LaserScan>(*laser_scan, "laser");
|
||||
obstacle_layer->dataCallBack<robot_sensor_msgs::LaserScan>(*laser_scan, "laser");
|
||||
}
|
||||
}
|
||||
catch (const std::exception &ex)
|
||||
@@ -794,7 +794,7 @@ void move_base::MoveBase::setXyGoalTolerance(double xy_goal_tolerance)
|
||||
// {
|
||||
// }
|
||||
|
||||
// bool planService(nav_msgs::GetPlan::Request &req, nav_msgs::GetPlan::Response &resp)
|
||||
// bool planService(robot_nav_msgs::GetPlan::Request &req, robot_nav_msgs::GetPlan::Response &resp)
|
||||
// {
|
||||
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user