New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ROS2 Development with Visual Studio #310
Comments
Hi @ItsMeTheBee, When building with cmake on Windows, pdbs are not typically generated for release builds. If you compile debug, you will have mismatches in the binaries. The ROS2 libraries you are importing into your C++ project were likely built without PDBs. If you need to debug ROS2 binaries, you'll need to rebuild them with For the second bug, I suspect that you maybe crossing toolchains. If you install ROS2 from the Microsoft chocolatey distribution (http://aka,ms/ros) these are built with the v142 toolchain. You'll need to make sure that is selected. (When building within the ROS environment, we take care of this for you) If you can share a sample project, we can diagnose further. Be well, |
Hey @ooeygui ! Thanks for your answer, I´ve been a bit busy but now I got some more infos. The issues in Here another screenshot of the contents of node_name when I use I'm not sure how to share a sample project since all the ROS files (lib, dll, etc) are linked. I´ll try to push it into a new repo and send you the link. Thanks a lot for your help! |
Thank you for the update and screen shots. I'm going to need to be able to reproduce this locally in order to help solve the mystery, Typically when I see this, it is either a toolchain mismatch (which you ruled out), a calling convention problem (Which shouldn't be the case due to ROS2 code being explicitly tagged), or an optimization problem. The latter are really hard to diagnose because the generated code doesn't actually match what is written. If you can step through the crossing, you can use the Memory and disassembly windows to see where things go off the rails. If you can't share your project, I can also do a one on one debugging session with you on your system if you are comfortable. Let me know, and I'll figure out how to contact you about setting that up. |
I think you can replicate the error with the code here . The ReadMe should contain everything you need to know. |
Hahaha I feel kind of dumb for not trying this sooner, but I just changed the Solution Config to "Release" and it worked :D |
Ah, I should have had that on the list too - sorry about that. I'm glad it's resolved! |
Hey there!
I want to incorporate ROS into another Windows project where colcon is not an option.
So I tried to write and run a simple C++ publisher in Visual Studio with a setup like this one:
As far as I can see linking is not a problem, but there are two issues right now.
First problem is that I dont habe any pdb files, which means that I can´t debug into ROS.
Would you happen to have these files at hand?
The second issue is that it seems like I get an
rclcpp::exceptions::RCLInvalidROSArgsError::RCLInvalidROSArgsError()
exception when calling the init function. I tried to callrclcpp::init(0, nullptr);
and I tried to build argv myself to pass the path to the .exe file of the Visual Studio project or a working ROS node from my workspace but everything results in this exception.I don´t expect you to know much about solving this second issue but maybe you happen to have a clue since you work with Windows and ROS.
Apart from that any information about how to run ROS in a Visual Studio Project would be great.
The text was updated successfully, but these errors were encountered: