Rosanswers logo

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:


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.

Originally posted by 130s on ROS Answers with karma: 10937 on 2011-10-24

Post score: 0


2 Answers 2


Rosanswers logo

If you're using machines with different architectures, you're going to have to recompile anyway; it seems to me that version control is, in general, the right answer here. That is:

  1. Hack until you want to try something.
  2. Check it in.
  3. Check it out on the other machine and build it (this could be scripted to all happen in one step)

...and iterate. This has the added benefit of making you check in a lot, which is good programming practice, and keeps you from clobbering different builds of your various binaries.

It's not quite as fast, but (at least in the different-architecture case) you're never going to win, anyway.

Originally posted by Mac with karma: 4119 on 2011-10-26

This answer was ACCEPTED on the original site

Post score: 2


Rosanswers logo

I'm sure how you go about doing this would differ depending on what program you're using, but I would imagine there is some way to "ignore" certain files/folders and then you should set the build directories and bin directories to be ignored, that way you can build it on each machine and it won't propigate to the other machines.

That said, I use Mac's solution myself, but if you want to continue using what you're using I think my answer is the way to go, assuming it is supported by whatever software you are using.

Originally posted by John Hoare with karma: 765 on 2011-10-27

This answer was NOT ACCEPTED on the original site

Post score: 1

Original comments

Comment by Mac on 2011-10-28:
Dropbox, I'm told, has a "selective sync" capability that does this. I like my actual answer better, of course, but the original poster mentioned Dropbox, so I figured I'd point this out.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.