mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 00:37:46 +08:00
Updated apriltags2_ros to new apriltag_ros package
This commit is contained in:
+8
-8
@@ -25,7 +25,7 @@ find_package(catkin REQUIRED COMPONENTS
|
||||
# Optional components
|
||||
find_package(costmap_2d)
|
||||
find_package(octomap_msgs)
|
||||
find_package(apriltags2_ros)
|
||||
find_package(apriltag_ros)
|
||||
find_package(rviz)
|
||||
find_package(find_object_2d)
|
||||
|
||||
@@ -247,18 +247,18 @@ SET(Libraries
|
||||
ADD_DEFINITIONS("-DWITH_OCTOMAP_MSGS")
|
||||
ENDIF(octomap_msgs_FOUND)
|
||||
|
||||
# If apriltags2_ros is found, add definition
|
||||
IF(apriltags2_ros_FOUND)
|
||||
MESSAGE(STATUS "WITH apriltags2_ros")
|
||||
# If apriltag_ros is found, add definition
|
||||
IF(apriltag_ros_FOUND)
|
||||
MESSAGE(STATUS "WITH apriltag_ros")
|
||||
include_directories(
|
||||
${apriltags2_ros_INCLUDE_DIRS}
|
||||
${apriltag_ros_INCLUDE_DIRS}
|
||||
)
|
||||
SET(Libraries
|
||||
${apriltags2_ros_LIBRARIES}
|
||||
${apriltag_ros_LIBRARIES}
|
||||
${Libraries}
|
||||
)
|
||||
ADD_DEFINITIONS("-DWITH_APRILTAGS2_ROS")
|
||||
ENDIF(apriltags2_ros_FOUND)
|
||||
ADD_DEFINITIONS("-DWITH_APRILTAG_ROS")
|
||||
ENDIF(apriltag_ros_FOUND)
|
||||
|
||||
# If rviz is found, add plugins
|
||||
IF(rviz_FOUND)
|
||||
|
||||
@@ -64,8 +64,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
#include <octomap_msgs/GetOctomap.h>
|
||||
#endif
|
||||
|
||||
#ifdef WITH_APRILTAGS2_ROS
|
||||
#include <apriltags2_ros/AprilTagDetectionArray.h>
|
||||
#ifdef WITH_APRILTAG_ROS
|
||||
#include <apriltag_ros/AprilTagDetectionArray.h>
|
||||
#endif
|
||||
|
||||
#include <actionlib/client/simple_action_client.h>
|
||||
@@ -139,8 +139,8 @@ private:
|
||||
void userDataAsyncCallback(const rtabmap_ros::UserDataConstPtr & dataMsg);
|
||||
void globalPoseAsyncCallback(const geometry_msgs::PoseWithCovarianceStampedConstPtr & globalPoseMsg);
|
||||
void gpsFixAsyncCallback(const sensor_msgs::NavSatFixConstPtr & gpsFixMsg);
|
||||
#ifdef WITH_APRILTAGS2_ROS
|
||||
void tagDetectionsAsyncCallback(const apriltags2_ros::AprilTagDetectionArray & tagDetections);
|
||||
#ifdef WITH_APRILTAG_ROS
|
||||
void tagDetectionsAsyncCallback(const apriltag_ros::AprilTagDetectionArray & tagDetections);
|
||||
#endif
|
||||
void imuAsyncCallback(const sensor_msgs::ImuConstPtr & tagDetections);
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
<launch>
|
||||
<!-- Print on the file tag_bundle1.png (with GIMP: set size in Image Settings to 160x240mm) -->
|
||||
<!-- Definition of the tag bundle is tags.yaml, make sure the camera is calibrated or adjust the size of the tag if needed -->
|
||||
<!-- The TF published by apriltags_ros should match the point cloud created by the camera -->
|
||||
<!-- The TF published by apriltag_ros should match the point cloud created by the camera -->
|
||||
<!-- Change Optimizer/Strategy below between 1 (g2o) and 2 (GTSAM), and tag_angular_variance between 0.005 (optimize rotation) and 9999 (optimize only tag's XYZ) -->
|
||||
|
||||
<!-- $ roslaunch realsense2_camera rs_camera.launch align_depth:=true -->
|
||||
<!-- $ roslaunch rtabmap_ros test_apriltags2.launch rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info -->
|
||||
<!-- $ roslaunch rtabmap_ros test_apriltag_ros.launch rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info -->
|
||||
<!-- $ roslaunch rtabmap_ros rtabmap.launch depth_topic:=/camera/aligned_depth_to_color/image_raw rgb_topic:=/camera/color/image_raw camera_info_topic:=/camera/color/camera_info rviz:=true rtabmapviz:=false args:="-d -Optimizer/Strategy 1" tag_angular_variance:=9999 -->
|
||||
|
||||
<arg name="camera_frame_id" default="camera_color_optical_frame"/>
|
||||
@@ -13,10 +13,10 @@
|
||||
<arg name="camera_info_topic" default="/camera/rgb/camera_info" />
|
||||
|
||||
<!-- Set parameters -->
|
||||
<rosparam command="load" file="$(find rtabmap_ros)/launch/tests/tag_settings.yaml" ns="apriltags2_ros_continuous_node" />
|
||||
<rosparam command="load" file="$(find rtabmap_ros)/launch/tests/tags.yaml" ns="apriltags2_ros_continuous_node" />
|
||||
<rosparam command="load" file="$(find rtabmap_ros)/launch/tests/tag_settings.yaml" ns="apriltag_ros_continuous_node" />
|
||||
<rosparam command="load" file="$(find rtabmap_ros)/launch/tests/tags.yaml" ns="apriltag_ros_continuous_node" />
|
||||
|
||||
<node pkg="apriltags2_ros" type="apriltags2_ros_continuous_node" name="apriltags2_ros_continuous_node" clear_params="true" output="screen">
|
||||
<node pkg="apriltag_ros" type="apriltag_ros_continuous_node" name="apriltag_ros_continuous_node" clear_params="true" output="screen">
|
||||
<remap from="image_rect" to="$(arg rgb_topic)" />
|
||||
<remap from="camera_info" to="$(arg camera_info_topic)" />
|
||||
|
||||
+3
-3
@@ -650,7 +650,7 @@ void CoreWrapper::onInit()
|
||||
userDataAsyncSub_ = nh.subscribe("user_data_async", 1, &CoreWrapper::userDataAsyncCallback, this);
|
||||
globalPoseAsyncSub_ = nh.subscribe("global_pose", 1, &CoreWrapper::globalPoseAsyncCallback, this);
|
||||
gpsFixAsyncSub_ = nh.subscribe("gps/fix", 1, &CoreWrapper::gpsFixAsyncCallback, this);
|
||||
#ifdef WITH_APRILTAGS2_ROS
|
||||
#ifdef WITH_APRILTAG_ROS
|
||||
tagDetectionsSub_ = nh.subscribe("tag_detections", 1, &CoreWrapper::tagDetectionsAsyncCallback, this);
|
||||
#endif
|
||||
imuSub_ = nh.subscribe("imu", 100, &CoreWrapper::imuAsyncCallback, this);
|
||||
@@ -1999,8 +1999,8 @@ void CoreWrapper::gpsFixAsyncCallback(const sensor_msgs::NavSatFixConstPtr & gps
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_APRILTAGS2_ROS
|
||||
void CoreWrapper::tagDetectionsAsyncCallback(const apriltags2_ros::AprilTagDetectionArray & tagDetections)
|
||||
#ifdef WITH_APRILTAG_ROS
|
||||
void CoreWrapper::tagDetectionsAsyncCallback(const apriltag_ros::AprilTagDetectionArray & tagDetections)
|
||||
{
|
||||
if(!paused_)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user