IntelRealSense / realsense-ros

ROS Wrapper for Intel(R) RealSense(TM) Cameras
http://wiki.ros.org/RealSense
Apache License 2.0
2.61k stars 1.77k forks source link

T265 Localization in existing map #940

Closed tim-fan closed 3 years ago

tim-fan commented 5 years ago

Hi there, I'm trying to use the T265 as a localization sensor for a robot project, but can't figure out how.

I'd like to map an area with the camera, save that map, then in future have the T265 report it's location in that map's coordinate frame. A simple use case being the ability to send the robot to certain pre-defined locations.

Is this achievable with the current sdk+ros-driver?

The closest I could find was this issue, which places a static-node at 0,0,0 during mapping, then tracks the position of that node when localising to determine location in the original map. However that method seems like a somewhat indirect approach to getting coordinates in the map frame, and also doesn't seem to be supported by realsense-ros, which does not report static node locations, as far as I can tell.

Any suggestions for paths forward?

Regards, -Tim

BRNKR commented 5 years ago

you get an odometry from the t265. for mapping you have to use a laserscanner or a stereo-camera system.

tim-fan commented 4 years ago

Thanks for the tip, yes I have seen that method for integrating the T265 into a localisation system.

What I was hoping for was to have the T265 perform localisation independently, without the need to integrate/fuse with other sensors.

When I bought the device I understood that this functionality would be supported (as implied by, for instance, this comment). I also assumed that the functionality would be available for use through the ROS API. However as far as I can tell, this support is still not available, hence I opened this issue.

Michael-Equi commented 4 years ago

If I am not mistaken, this requires updating the ros node with some of the functionality already provided with the librealsense2 library. This is a feature that is absolutely required for the project I am working on so if nobody else is working on implementing it I will give it a shot. Has anyone made progress on adding this feature to the T265 ROS node that I should be aware of before I start?

tim-fan commented 4 years ago

Hello, personally I haven't looked into this since I logged the issue, so I'm not aware if anyone else has made progress. That would be awesome if you could implement it :thumbsup:

arjunsengupta98 commented 4 years ago

Hello! Has anyone been able to make any progress? @Michael-Equi @tim-fan ?

When I bought the device I understood that this functionality would be supported (as implied by, for instance, this comment). I also assumed that the functionality would be available for use through the ROS API. However as far as I can tell, this support is still not available, hence I opened this issue.

@tim-fan I too assumed the same.

Right now, I'm simply using the odometry readings from the t265 and depth information from D435 to create a 2D occupancy map on ROS. If I'm not wrong, that's what they have done in the occupancy branch of realsense-ros?https://github.com/IntelRealSense/realsense-ros/tree/occupancy-mapping Isn't his simply using the T265 like an IMU? We aren't using any online SLAM capabilities of the T265 here, are we?

@dorodnic Your comments would be appreciated as well.

Michael-Equi commented 4 years ago

@arjunsengupta98 I am currently working on a simplified T265 only node for ROS2 that includes map saving/loading and re-localization as well as wheel odometry input. Its not all that refined yet but it does work (contributions are welcome!). You can find my custom node here https://github.com/BytesRobotics/ros2_t260/tree/development

arjunsengupta98 commented 4 years ago

Hey @Michael-Equi Thanks for the link! Any idea on how the internal map can be continuously streamed while being formed? (Something like how rviz depicts the occupancy map continuously while it is being formed)? Does your node do that? I haven't worked on ROS2 (I'm a novice in ROS itself), hence thought about confirming this before going ahead with an attempt to implement your node.

Michael-Equi commented 4 years ago

@arjunsengupta98 I'm not sure why you would want the map streamed since its not really interpretable unless you can figure out how intel encodes it but I guess if you really want it frequently updated you could just call the save map service often and then read the file as needed. Really what map saving and loading is for is so that you can get the transform between a current realsense map/pose to a past one basically allowing you to align it with another map type like an occupancy map handled by ROS.

arjunsengupta98 commented 4 years ago

@arjunsengupta98 I'm not sure why you would want the map streamed since its not really interpretable unless you can figure out how intel encodes it but I guess if you really want it frequently updated you could just call the save map service often and then read the file as needed. Really what map saving and loading is for is so that you can get the transform between a current realsense map/pose to a past one basically allowing you to align it with another map type like an occupancy map handled by ROS.

Sure, that makes perfect sense. Turns out that I had misunderstood the concept. Thanks a ton!

tim-fan commented 3 years ago

@RealSenseSupport is this closed because localisation in an existing map will not be supported? Or has this been implemented?