-
Notifications
You must be signed in to change notification settings - Fork 75
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
How to use roslaunch with rosrust? #113
Comments
My Catkin integration method is to use a CMake file like the following: cmake_minimum_required(VERSION 3.0)
project(my-project)
find_package(catkin REQUIRED)
catkin_package()
add_custom_target(my-project
ALL
COMMAND cargo build --release -p my-project
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_BINARY_DIR}/cargo/release/my-project-binary ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/my-project-binary
COMMENT "Building my Rust library"
) I also have the following in [build]
target-dir = "build/cargo" This setup allows any of the Rust executables to be treated like any other ROS package, both for building and for use with |
I think anything beyond that will probably require modifying Catkin to know about Rust and that will probably be hindered by Cargo not providing a way to specify output directories. |
Thank you! It seems great! Currently I'm using below workspaces style.
Your idea is below right?
Are you comfortable about it? |
I have all my Rust code for this project inside of Catkin "packages" even if it doesn't use ROS just to make it easier for my collaborators to use the libraries without having to deal with anything Rust. That is, I don't have to explain to them that there is a |
I see. I'll use your idea! Thanks a lot! |
Hi @neachdainn I created metapackage which include everything, and placed it ~/catkin_ws/src/the_meta_package/ It is like
And Is this what you mean? |
My workspace roughly looks like this:
Where the root Cargo.toml contains the workspace information. |
Great! thank you! I'm using
is not working. ${CMAKE_BINARY_DIR} seems to be I'm using Do you know about it? |
I don't know why that wouldn't work. My only guess is you might need to make sure that you declare the |
It has |
It seems that the difference between I guess that you are using |
Is |
I have found that I have similar issues with |
I have dug through the CMake variables and it seems there is no way to detect if you are running |
( Thank you guys for nice information. It's super nice if we could generate package.xml & CMakefile.txt :-) with cargo sub-command or something. ) |
Hi all!! https://github.com/elsuizo/ros-project-generator I am using a template library maybe it is not necessary. |
Hello! |
After adding the cmake ppa and updating my cmake I was able to build/install corrosion. Then I could do: cmake_minimum_required(VERSION 3.0.2)
project(publisher_node)
find_package(catkin REQUIRED)
find_package(Corrosion REQUIRED)
catkin_package()
corrosion_import_crate(MANIFEST_PATH Cargo.toml)
corrosion_install(TARGETS ${PROJECT_NAME}
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
) This builds but did not install my |
I have not tested this out, but something like this might work: add_custom_command(TARGET ${PROJECT_NAME}
POST_BUILD
COMMAND ${CMAKE_COMMAND} -E copy "${${PROJECT_NAME}_binary_dir}/${PROJECT_NAME}" "${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/${PROJECT_NAME}"
) Basically, after the build is done copy the binary file from the build directory into the appropriate devel directory. |
I want to use rosrust binary with roslaunch.
How do you integrate rust program with roslaunch?
It is possible to copy the binary to somewhere like
catkin_ws/develop/lib/PACKAGE/
, but is there good integration with cargo?The text was updated successfully, but these errors were encountered: