Realtime code sharing on multiple hosts w/o caring host-specifics (e.g. CPU architecture)
In ROS (or in general C++, or even other language), is there a better way to achieve what I describe below? Thanks.
When I share the project/stack/package folders using file sharing tools (e.g. Dropbox, MobileMe, WinSCP etc.), I can build on Host-2 right after I modified the codes on Host-1. Very comfortable esp. when I have a reason to use multiple machines.
Although I can even run the binary on Host-2, this is true only when the computer architecture is the same. For example, suppose Host-1 is 64 bit and Host-2 is 32, the binary originally created on Host-1 doesn't run on Host-2 even though it's copied by file sharing right after it's generated on Host-1. So on Host-2 I need to build again. However, by the time building is done, then the binary on Host-1 is re-written as 32-bit by the file sharing tool. And this chicken race goes on and on...
So when on different architecture, I need certain workaround if I persist to use file sharing.
My current solution is to create a folder that's not shared, put the binary files into the folder, and make a shell script that calls that binary (.launch
file might be able to replace this but I haven't tried). In this way, though I can't call the binary file by rosrun
any more, instead I can save much time that were supposed to be spent on re-build that I described an example earlier.
There could still be host-specific information especially in the path of the binary file (since I no longer call by rosrun
which uses stack/package info instead of path), but I work around it by using the environment variables that I additionally made. Example:
/home/ros_great/ROS_Workspace/HostSpecific/bin # storage of binary files
$ROS_CUSTOM_PACKAGE_BIN = /home/ros_great/ROS_Workspace/HostSpecific/bin
A shell script example:
$ROS_CUSTOM_PACKAGE_BIN/binaryFile
In this way, I need to do some additional tasks initially when I start working on a package, but still I can cut down much time. Since using multiple computers might be common, I wonder if ROS has already similar/better functionality. For instance, rosmake
generating binary in the location specified CMakeLists.txt
then roslaunch
calling the binary from that location automatically.