Closed JonathanWade closed 10 years ago
:+1:
Thanks!
Could you explain in more detail which CMakeList.txt you change and how you modify it? I don't see how you can remove the catkin dependency from common_msgs/actionlib_msgs without breaking many things
I now understand the issue you were mentioning. Previously environment hooks had the format of a semi-colon delimited list under _CATKIN_ENVIRONMENT_HOOKS
_CATKIN_ENVIRONMENT_HOOKS=C:/opt/ros/hydro/x86\etc\catkin\profile.d\10.ros.bat;C:/opt/ros/hydro/x86\etc\catkin\profile.d\10.rosbuild.bat;C:/opt/ros/hydro/x86\etc\catkin\profile.d\10.roslaunch.bat
However, now it seems each environment variable is numbered and _CATKIN_ENVIRONMENT_HOOKS_COUNT
marks the total number of variables:
_CATKIN_ENVIRONMENT_HOOKS_0=C:/opt/ros/hydro/x64\etc\catkin\profile.d\10.ros.bat
_CATKIN_ENVIRONMENT_HOOKS_0_WORKSPACE=C:/opt/ros/hydro/x64
_CATKIN_ENVIRONMENT_HOOKS_1=C:/opt/ros/hydro/x64\etc\catkin\profile.d\10.rosbuild.bat
_CATKIN_ENVIRONMENT_HOOKS_1_WORKSPACE=C:/opt/ros/hydro/x64
_CATKIN_ENVIRONMENT_HOOKS_2=C:/opt/ros/hydro/x64\etc\catkin\profile.d\10.roslaunch.bat
_CATKIN_ENVIRONMENT_HOOKS_2_WORKSPACE=C:/opt/ros/hydro/x64
_CATKIN_ENVIRONMENT_HOOKS_COUNT=3
Instead of rolling back to the previous version of catkin I'll try and move forward and see if I can make a change to setup.bat where these values are parsed and called.
Looks like the catkin setup.sh script has been tweaked a fair bit but the setup.bat script hasn't.
The file you want to update to make this work is in catkin (refer to your local version when editing, you probably don't want to use the indigo version):
https://github.com/ros/catkin/blob/indigo-devel/cmake/templates/setup.bat.in
You can see the corresponding changes that went in to setup.sh:
https://github.com/ros/catkin/commits/indigo-devel/cmake/templates/setup.sh.in
In particular, the environment hooks change went in at:
https://github.com/ros/catkin/commit/a0d699a08f10424adad38eee25673c9a66120ec4
@jonathanwade Ping me if you have questions. You might also like to open up an issue on catkin to get their advice, they are usually helpful for this windows stuff. You might also like to use something for hydro that is not exactly the latest version of catkin, but sufficient to pass your earlier problems.
Ah, I see I am catching up :neckbeard:
For the purposes of discussion the code you are proposing for the fix is in:
Relevant comments from @JonathanWade:
The first change to setup.bat loops through each environment variable and calls the referenced batch script. Unfortunately because I create the environment variable string on the fly, then reference it inside the loop scope, all with the end goal of getting the string the variable it is pointing to... it requires a bit of delayed expansion and indirection. There are some commented out lines to help those not familiar with batch scripting understand whats happening. Unfortunately when we end the setlocal that enabled the delayed expansion we destroy all environment variables within that scope including those that were created by the batch scripts that were called! So we have to recapture these variables at endlocal. This is pretty hackish and may not be the best long term solution unless it can be assumed that this small set of variables will be all we care about and can be hardcoded in the manner I have done it.
Batch delayed expansion handling is unintuitive. I remember cracking my head on it ages ago and can't remember it well enough to 'vet' these for you without having a windows system around.
The second file was changed due to the use of delayed expansion in the first. As mentioned in the comments the delayed expansion will mess with the echo'ing of python code, so it is explicitly set to off for that block of script.
Finally, I caught a 'bug' in the third file. The use of the square brackets will function correctly if ROS_MASTER_URI does not exist, but if it does the behaviour is not correct and the batch file will exit reporting "]==[] was unexpected" and the environment will fail to be set up correctly. The quote syntax should work both when the variable does and does not exist
+1. You might like to push this one upstream immediately.
I'm happy with how my local environment is working and would love to contribute any fixes/improvements I can, but mentioned I'm new at all this so I'd rather someone experienced vet the changes or perhaps the changes should wait until the port to indigo begins.
I'm wondering why all of this was essential in the first place. Just looking at https://github.com/ros-windows/win_ros/blob/hydro-devel/msvc_hydro.rosinstall, it looks like not everything got locked down to versions. If everything had (actionlib and tutorials included), then this problem (being merely a build problem) probably wouldn't have appeared.
@jonathanwade was there a reason you needed up to date versions of actionlib and tutorials?
No reason. I was merely following the tutorials during my initial exposure to ROS. In the future things should definitely get locked down to specific versions to ensure long-term compatibility.
Aside 1: Since then the only package that seems to benefit (for my work) from moving forward is ros_comm for the update to rospy that uses the queued sockets to avoid hanging when publishing. I want to use rosbridge_suite and the accompanying javascript library in my work and these seem to play best with a newer rospy (as well as the benefit of fixing the hang bug). Bringing the whole package forward isn't as simple as many other things have changed and looking at the revision history it was a one file change so it might be worth simply injecting that updated python file into the hydro windows version.
I will make pull requests for the fixes mentioned above when I can find the time.
so it might be worth simply injecting that updated python file into the hydro windows version.
That's quite feasible since we maintain and use a forked version of ros_comm. There's not much in that fork, just a minor patch or two that we haven't worked out how to make 'official' yet and it can probably incorporate that rospy update quite easily.
Hydro common_msgs/actionlib_msgs has a version dependency on 0.5.78 of catkin. Ensuring the right version is cloned by the users so tutorials do not break during winros_make