jczarnowski / DeepFactors

Real-Time Probabilistic Dense Monocular SLAM Using Compact Code Representation

Home Page:https://www.imperial.ac.uk/dyson-robotics-lab/projects/deepfactors

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Pangolin error in function RegisterKeyPressCallback()

FengQiaojun opened this issue · comments

Thanks for sharing this!

I was having some issues with the Pangolin.
visualizer.cpp#L402
The error info says error: could not convert ‘std::bind(_Func&&, _BoundArgs&& ...) to ‘std::function<void()>’
Screenshot from 2020-07-10 17-40-26

Do you have any idea on this?

Hi FengQiaojun,

It looks like it is not using the modified Pangolin version that is cloned in the thirdparty/Pangolin subdirectory and build using the thirdparty/makedeps.sh script. It is probably using some Pangolin installed in your system.

Please make sure our vendored Pangolin has been built. Depending on what happened, you could check the thirdparty/build/Pangolin directory and try issuing make -j in there to see if everything has been built.

It will also be necessary to either re-run cmake for DeepFactors from scratch or explicitly point it to the vendorised Pangolin version. This normally should be done automatically if the vendorised dependencies are built.

Thanks! I solve this by making sure the vendorised Pangolin in thirdparty is correctly find for building this project.

I think I am facing the same issue when I run make, as I am getting the same error above..

Screenshot from 2020-07-14 21-31-22

I checked that Pangolin is built in thirdparty/build/Pangolin
I am not sure how you did what you suggested about pointing to the vendorised Pangolin, I would appreciate a bit more details on how to do that..

Thanks a lot in advance.

Hi AbdulhamidObeid,

I checked it again and here is what I did.

  1. I first tried to add one line in CMakeLists.txt

set("Pangolin_DIR" "xxx/DeepFactors/thirdparty/install/lib/cmake/Pangolin")
find_package(Pangolin QUIET REQUIRED)

to force the Pangolin to be found. But it didn't work all the time.

  1. I uninstall the original version of Pangolin I had (by default in /usr/local/include/pangolin). And cmake + make again. It worked this time.

So probably the reason is, the Pangolin in thirdparty is built successfully, but it is not corrected found and linked while building the DeepFactors. There might be some tricks to force the package finding path but I am not sure.

Nevertheless, I actually found those two lines of codes are not super-important (visualizer.cpp#L401-L402). You can directly comment them out if you want to build the project and this is the only error.

Hello FengQiaojun.

I actually tried commenting out the two lines you suggested, regardless that I didn't really understand their purpose, and I could successfully build and make DeepFactors, but when I run the system on the TUM Dataset I face another error and I thought that commenting those two lines affected something else..

Anyway when I commented out those two lines and run the system the interface opens for a few seconds with no movement, and then it terminates giving the following error

Screenshot from 2020-07-14 23-52-06

I don't know if you faced such an issue, but I couldn't even understand what the issue is

My understanding is that those two lines bind keys on the keyboard with some specific actions for the Pangolin visualization, which actually there are already four buttons on the Pangolin GUI. So I think they are not super important.

The shown error is related to the tensorflow and it shouldn't be connected with Pangolin I think. I haven't tried TUM myself. Maybe you can search this around. One possible answer is that this error happens when using CPU. It will not show up with GPU. And it seems like you are not using a GPU.

Maybe ask Jan Czarnowski @jczarnowski about the CPU support.

@FengQiaojun Glad you managed to get it to work and thanks for the input!

By default it should find the correct Pangolin if it is built before generating build files with cmake. If they are not present at that time, it will find the global Pangolin and any subsequent re-runs of cmake will use it unless you reset or clear the Pangolin_DIR cache variable. One thing that might have prevented this from working could be cmake caching package locations in files under .cmake/packages/Pangolin, it might have just grabbed it from there ignoring your Pangolin_DIR value. I will have a look at it.

@AbdulhamidObeid As @FengQiaojun correctly noticed, this new error is connected to your tensorflow not being compiled with CUDA support. Implementing CPU support is a bit pointless because it will be way too slow to run the system as we do very heavy computation. Hopefully you can just recompile your TensorFlow with CUDA support or just install a different version that has it enabled.

Regarding the Pangolin patch -- yes, its for binding keys and commenting out that functionality should work as well. I found the key bindings very helpful in long-term use of the system :) I tried upstreaming the simple patch but the PR was ignored.