esteve / ros2_pepper

Scripts for cross-compiling ROS and ROS2 for Softbank's Pepper
Apache License 2.0
32 stars 22 forks source link

[Feature Request] Workflow for cross compiling custom ROS packages #22

Open KannebTo opened 5 years ago

KannebTo commented 5 years ago

After successfully compiling and running ROS on Pepper (thanks to this great repository), i like to cross compile my own packages. This seems simple at first. I just need to copy the package folder to pepper_ros1_ws/src/ and run build_ros1.sh again. But this takes a while, because of scanning for changes in more than 90 packages. I need a fast way to compile and recompile custom packages.

So i renamed the src directory and created a new one, which contains my packages only. And i created a modified version of build_ros1.sh, which gets rid of unnecessary commands such as creation of directories, copying files which are already there and the vcs import. The last step is to fix the ICU linking errors by changing the pepper_ros1_ws/ctc-cmake-toolchain.cmake. The packages compile if the link flags -licudata, -licui18n and -licuuc are applied.

# pepper_ros1_ws/ctc-cmake-toolchain.cmake

# ...
# on line 267
set(_link_flags "-licudata -licui18n -licuuc")
# ...

or by adding the project names to the following if-statement. Now everything works and i pushed the new files in the installation directory to the robot using rsync.

Is there a better way? Maybe a new workspace and some scripts? Also it would be nice to separate the base ROS packages for Pepper from the custom ones in the installation directory. So you can simply reset the ROS installation on the Robot by deleting the directory of custom packages.

Thanks

fmrico commented 5 years ago

Hi @KannebTo ,

I have to finish #18 to do another PR with the functionality that you are asking for.

You can build several workspaces separately: ROS base workspace, another specific package in another workspace and your application in another workspace. Each workspace could have a *_ctc.cmake, startup scripts...

As a guide, you can follow this gist that we are using in RoboCup SSPL@Home as an example to create your build in a separate workspace:

https://gist.github.com/fmrico/f90352bb48856dd78ca0c79ccb810ece

Hope it helps!!

KannebTo commented 5 years ago

Hi @fmrico, thank you. That's useful!