ProjectArtemis / aprilslam

Mapping and Pose Estimation from AprilTags under ROS
146 stars 66 forks source link

aprilslam - pose output / rviz integration / MSF #1

Closed HeinzBenjamin closed 8 years ago

HeinzBenjamin commented 9 years ago

Hi there,

we are working on a UAV setup in which we use an Odroid XU4 alongside with with a Pixhawk PX4 and a Ueye camera. We have Ubuntu 14.04.3 LTS trusty and ROS Indigo running on the Odroid. We installed AprilSLAM for position estimation of the UAV. Unfortunately we couldn't figure out yet how to access the output to see what it actually returns. Apparently the topic '/camera/detections' returns a viewable image stream but without detected tag visualization. Is there a topic which returns a pose?

Since Odroid won't let us use rviz, we run it on another machine in the network (Virtual Machine: Ubuntu 14.04, Windows host). However, we couldn't make it work, since we couldn't figure out which to supply: -> Global status -> Warn -> 'No tf data. Actual error: Fixed Frame [world] does not exist'

Also: we are using a single camera setup. Should we stick with 'Marker Topic: /stereo/left/apriltags_map' and 'Marker Topic: /stereo/left/apriltags_marker' in the config/apriltag.conf or change it to 'Marker Topic: /camera/apriltags_map' and 'Marker Topic: /camera/apriltags_marker' ?

and one last question: Are there any attempts or examples to use aprilSLAM alongside MSF in ROS?

Any guidance would be greatly appreciated. Thank you very much in advance Benjamin

mhkabir commented 9 years ago

Hi Benjamin,

Apparently the topic '/camera/detections' returns a viewable image stream but without detected tag visualization.

It should show detections. Note that the apriltags need to have a black border of 2, or you'll need to set it to 1 here (https://github.com/ProjectArtemis/aprilslam/blob/master/apriltag_mit/src/TagFamily.cc#L28) to get it to work with normal tags. The pose_cam topic publishes a PoseStamped message with current camera pose. Use rostopic list to find all topics.

Also: we are using a single camera setup. Should we stick with 'Marker Topic: /stereo/left/apriltags_map' and 'Marker Topic: /stereo/left/apriltags_marker' in the config/apriltag.conf or change it to 'Marker Topic: /camera/apriltags_map' and 'Marker Topic: /camera/apriltags_marker' ?

Yep, you can change it, just make sure you get your remappings right. Use rostopic again to check connections.

Are there any attempts or examples to use aprilSLAM alongside MSF in ROS?

No need, AprilSLAM gives you a 6D pose with proper metric scale estimated from the tag size (https://github.com/ProjectArtemis/aprilslam/blob/master/apriltag_ros/launch/slam.launch#L6)

Rviz

Copy over the *.rviz file from /config to your desktop computer and run rviz with it like this : rosrun rviz rviz -d apriltag.rviz You might need to mess with the Fixed Frame setting if things aren't quite set up properly

Let me know if you face any other issues.

HeinzBenjamin commented 9 years ago

Hi Mr. Kabir,

thank you very much for the quick respond.

The marker detection and rviz viewport works good now. However, the topic pose_cam doesn't appear in my rostopic list:

151019_rostopic_list_april_slam

did I miss something here?

One more question: Should I supply aprilslam with a rectified image topic (such as /camera/image_rect), by editing slam.launch, or does aprilslam take care of camera calibration internally? I was thinking of changing <arg name="camera" value="/camera"/> to <arg name="camera" value="/camera/image_rect"/> both in the includes of mapper.launch and detector.launch inside slam.launch Again, thank you very much.

Best Benjamin

mhkabir commented 9 years ago

I'm currently travelling, will have a look when I'm back. I never tested the PoseStamped output myself, had been using the TF, which works fine.

The pose will not be published if there isn't a valid map initialized. Can you see detections and the tag map in RViz? Can you give me a screenshot of rviz please.

HeinzBenjamin commented 9 years ago

Hi,

see the screenshot below:

151020_rviz

We see the markers are being recognized and rviz returns a camera_pose

/tf seems to work fine, it's just that /pose_camera is not shown in rostopic list. I guess we could work around that, if we know marker0's exact position and remap via the transformation / rotation to get the camera pose. Is that correct, or am I missing something crucial there? Or do you see another way to access /pose_camera without messing around with code to much?

mhkabir commented 9 years ago

You can just use the /camera to /world TF as the estimated pose. It is the same as what should have been published on cam_pose