Posted by
xsasdA on
URL: http://official-rtab-map-forum.206.s1.nabble.com/How-to-improve-mapping-accuracy-based-on-ArUco-identification-code-tp8393p9227.html
matlabbe wrote
Hi Javad,
In your code, the landmark should have negative ids.
Note that a marker prior parameter has been added recently to do so.
rtabmap --params | grep Marker/Priors
Param: Marker/Priors = "" [World prior locations of the markers. The map will be transformed in marker's
world frame when a tag is detected. Format is the marker's ID followed by its position
(angles in rad), markers are separated by vertical line ("id1 x y z roll pitch yaw|id2 x y z
roll pitch yaw"). Example: "1 0 0 1 0 0 0|2 1 0 1 0 0 1.57" (marker 2 is 1 meter forward
than marker 1 with 90 deg yaw rotation).]
Param: Marker/PriorsVarianceAngular = "0.001" [Angular variance to set on marker priors.]
Param: Marker/PriorsVarianceLinear = "0.001" [Linear variance to set on marker priors.]
In your case, setting this:
Marker/Priors="104 10 0 0 0 0 0"
will make the map translate so that landmark 104 is on absolute pose 10 meters in x.
Hello Matlabbe,
I have a question to this param in combination with the following issue on GH:
https://github.com/introlab/rtabmap/issues/712I have a similar setup like the user schmiran with the exception that I don't have a world frame set up. In my case it's just the map frame that is present and similar frames/sensors for the rest of the tf tree.
Mapping and Apriltag detection is working fine, example tags get recognized. The map frame is currently located at the odom_frame (i think this is the default), but I could just create a new "world" frame with tf in order to have the same starting point as the user schmiran.
The apriltags are spread out around the room and each of them has a known location in global coordinates which I saved in an XML file.
The robot will start at a random location with local coordinates and as soon as it detects one of the markers, the transformation of the local coordinates to the detected images should be available via topic tag_detections with apriltag_ros. This way, I get camera_link -> tag. Now, I need to get the transform from local to global coordinates in order to tell rtabmap to output the pointclouds generated in this coordinate system.
TLDR: I want to achieve the same goal of transforming between map/local coordinates and world/model/global coordinates with the help of apriltags that have known world/model/global coordinates in order to transform the point clouds that RTABMAP creates in the global/world coordinate system.
I would use the map frame and transform it to the location of the world coordinate origin which should be similar to what schmiran was trying to do. Does this param here do the job of actually achieving my goal of instantly finding this transform and applying it? I'm using the external apriltag_ros package, is it even possible to use that parameter which is normally only available for the build-in apriltag/aruco detection?
I already searched for this parameter and it appears to not be implemented in 0.19.x. Can i manually add the functionality of this parameter in the source code without changing anything else, or is it needed to update Rtabmap? Which version does support these parameters?
Is there a better way to get this transformation done?
Maybe I could add an Apriltag directly at the world coordinate origin which needs to be detected everytime? This ofcourse will limit the robot in its path because it has to visit that location first everytime, but it would be much simpler because map -> base_link -> camera_frame -> tag = world_frame.
Have a great day and sorry for reviving this rather old thread!