mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-04 08:47:45 +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
|
# Optional components
|
||||||
find_package(costmap_2d)
|
find_package(costmap_2d)
|
||||||
find_package(octomap_msgs)
|
find_package(octomap_msgs)
|
||||||
find_package(apriltags2_ros)
|
find_package(apriltag_ros)
|
||||||
find_package(rviz)
|
find_package(rviz)
|
||||||
find_package(find_object_2d)
|
find_package(find_object_2d)
|
||||||
|
|
||||||
@@ -247,18 +247,18 @@ SET(Libraries
|
|||||||
ADD_DEFINITIONS("-DWITH_OCTOMAP_MSGS")
|
ADD_DEFINITIONS("-DWITH_OCTOMAP_MSGS")
|
||||||
ENDIF(octomap_msgs_FOUND)
|
ENDIF(octomap_msgs_FOUND)
|
||||||
|
|
||||||
# If apriltags2_ros is found, add definition
|
# If apriltag_ros is found, add definition
|
||||||
IF(apriltags2_ros_FOUND)
|
IF(apriltag_ros_FOUND)
|
||||||
MESSAGE(STATUS "WITH apriltags2_ros")
|
MESSAGE(STATUS "WITH apriltag_ros")
|
||||||
include_directories(
|
include_directories(
|
||||||
${apriltags2_ros_INCLUDE_DIRS}
|
${apriltag_ros_INCLUDE_DIRS}
|
||||||
)
|
)
|
||||||
SET(Libraries
|
SET(Libraries
|
||||||
${apriltags2_ros_LIBRARIES}
|
${apriltag_ros_LIBRARIES}
|
||||||
${Libraries}
|
${Libraries}
|
||||||
)
|
)
|
||||||
ADD_DEFINITIONS("-DWITH_APRILTAGS2_ROS")
|
ADD_DEFINITIONS("-DWITH_APRILTAG_ROS")
|
||||||
ENDIF(apriltags2_ros_FOUND)
|
ENDIF(apriltag_ros_FOUND)
|
||||||
|
|
||||||
# If rviz is found, add plugins
|
# If rviz is found, add plugins
|
||||||
IF(rviz_FOUND)
|
IF(rviz_FOUND)
|
||||||
|
|||||||
@@ -64,8 +64,8 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include <octomap_msgs/GetOctomap.h>
|
#include <octomap_msgs/GetOctomap.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef WITH_APRILTAGS2_ROS
|
#ifdef WITH_APRILTAG_ROS
|
||||||
#include <apriltags2_ros/AprilTagDetectionArray.h>
|
#include <apriltag_ros/AprilTagDetectionArray.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <actionlib/client/simple_action_client.h>
|
#include <actionlib/client/simple_action_client.h>
|
||||||
@@ -139,8 +139,8 @@ private:
|
|||||||
void userDataAsyncCallback(const rtabmap_ros::UserDataConstPtr & dataMsg);
|
void userDataAsyncCallback(const rtabmap_ros::UserDataConstPtr & dataMsg);
|
||||||
void globalPoseAsyncCallback(const geometry_msgs::PoseWithCovarianceStampedConstPtr & globalPoseMsg);
|
void globalPoseAsyncCallback(const geometry_msgs::PoseWithCovarianceStampedConstPtr & globalPoseMsg);
|
||||||
void gpsFixAsyncCallback(const sensor_msgs::NavSatFixConstPtr & gpsFixMsg);
|
void gpsFixAsyncCallback(const sensor_msgs::NavSatFixConstPtr & gpsFixMsg);
|
||||||
#ifdef WITH_APRILTAGS2_ROS
|
#ifdef WITH_APRILTAG_ROS
|
||||||
void tagDetectionsAsyncCallback(const apriltags2_ros::AprilTagDetectionArray & tagDetections);
|
void tagDetectionsAsyncCallback(const apriltag_ros::AprilTagDetectionArray & tagDetections);
|
||||||
#endif
|
#endif
|
||||||
void imuAsyncCallback(const sensor_msgs::ImuConstPtr & tagDetections);
|
void imuAsyncCallback(const sensor_msgs::ImuConstPtr & tagDetections);
|
||||||
|
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
<launch>
|
<launch>
|
||||||
<!-- Print on the file tag_bundle1.png (with GIMP: set size in Image Settings to 160x240mm) -->
|
<!-- 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 -->
|
<!-- 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) -->
|
<!-- 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 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 -->
|
<!-- $ 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"/>
|
<arg name="camera_frame_id" default="camera_color_optical_frame"/>
|
||||||
@@ -13,10 +13,10 @@
|
|||||||
<arg name="camera_info_topic" default="/camera/rgb/camera_info" />
|
<arg name="camera_info_topic" default="/camera/rgb/camera_info" />
|
||||||
|
|
||||||
<!-- Set parameters -->
|
<!-- 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/tag_settings.yaml" ns="apriltag_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/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="image_rect" to="$(arg rgb_topic)" />
|
||||||
<remap from="camera_info" to="$(arg camera_info_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);
|
userDataAsyncSub_ = nh.subscribe("user_data_async", 1, &CoreWrapper::userDataAsyncCallback, this);
|
||||||
globalPoseAsyncSub_ = nh.subscribe("global_pose", 1, &CoreWrapper::globalPoseAsyncCallback, this);
|
globalPoseAsyncSub_ = nh.subscribe("global_pose", 1, &CoreWrapper::globalPoseAsyncCallback, this);
|
||||||
gpsFixAsyncSub_ = nh.subscribe("gps/fix", 1, &CoreWrapper::gpsFixAsyncCallback, 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);
|
tagDetectionsSub_ = nh.subscribe("tag_detections", 1, &CoreWrapper::tagDetectionsAsyncCallback, this);
|
||||||
#endif
|
#endif
|
||||||
imuSub_ = nh.subscribe("imu", 100, &CoreWrapper::imuAsyncCallback, this);
|
imuSub_ = nh.subscribe("imu", 100, &CoreWrapper::imuAsyncCallback, this);
|
||||||
@@ -1999,8 +1999,8 @@ void CoreWrapper::gpsFixAsyncCallback(const sensor_msgs::NavSatFixConstPtr & gps
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WITH_APRILTAGS2_ROS
|
#ifdef WITH_APRILTAG_ROS
|
||||||
void CoreWrapper::tagDetectionsAsyncCallback(const apriltags2_ros::AprilTagDetectionArray & tagDetections)
|
void CoreWrapper::tagDetectionsAsyncCallback(const apriltag_ros::AprilTagDetectionArray & tagDetections)
|
||||||
{
|
{
|
||||||
if(!paused_)
|
if(!paused_)
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user