StoglRobotics / ros_team_workspace

RosTeamWorkspace is a framework for boosting collaboration in teams when developing software for robots using Robot Operating System (ROS1 and ROS2).
https://rtw.stoglrobotics.de
Apache License 2.0
90 stars 19 forks source link

Make RosTeamWorkspace independent of installed path #55

Closed mamueluth closed 2 years ago

mamueluth commented 2 years ago

RTW should now work regardless of where it was cloned. Important: The .ros_team_ws_rc has changed, DEFAULT_ROS_DISTRO="rolling" DEFAULT_ROS_VERSION=2 are not needed anymore, an alternative path location system was introduced

Please make a qick check if working correctly!

destogl commented 2 years ago

Issue Nr. 1

When I don't setup the rtw permanently and start executing setup-ros-workspace, I get following error messages:

cp: cannot stat '/home/deniss/.ros_team_ws_rc': No such file or directory
sed: can't read /home/deniss/.ros_team_ws_rc: No such file or directory
sed: can't read /home/deniss/.ros_team_ws_rc: No such file or directory

Should we first check if this files exist?

I see that this is a bit out-of-scope… Nevertheless, we should do a simple error management. For example, if RTW is set to be automatically set up, then we should probably not create a new workspace. Easiest would be to check if there is source ... line in .bashrc if not, then we return error.

Issue Nr. 2

When is execute source ros_team_workspace/setup.bash multiple times, then I get output:

bash: positive_answers: readonly variable
bash: negative_answers: readonly variable
bash: rtw_accepted_answers: readonly variable
bash: rtw_supported_ros_distributions: readonly variable

This could be probably avoided having simple check if variable exist already. This is not a critical issue, but easy to solve, I think.

Note: this output also happens in some other situations, like when creating a new workspace.

Issue / Question Nr. 3

Should we add a prefix to commands like setup-auto-sourcing, for example, to be rtw_setup-auto-sourcing? What do you think?

Issue Nr. 4

When trying to auto-source a workspace when .ros_team_ws_rc file exists, I get the following error:

Copying .ros_team_ws_rc to your home folder.
ls: cannot access '.ros_team_ws_rc*': No such file or directory

.ros_team_ws_rc already exists. Moved it to .ros_team_ws_rc.bkp-0.
mv: cannot stat '.ros_team_ws_rc': No such file or directory
Error: Could not create a copy of already existing .ros_team_ws_rc. Please rename this file and run script again.
/home/deniss/workspace/ros_team_workspace/scripts/../scripts/setup_auto_sourcing.bash: line 35: return: can only `return' from a function or sourced script

Nevertheless, the result looks fine.

Issue Nr. 5

After creating a new workspace, when sourcing it I get the following error:

bash: /home/deniss/workspace/ros_team_workspace/scripts/../ros_ws_rolling/src/ros_team_workspace/scripts/environment/setup.bash: No such file or directory
mamueluth commented 2 years ago
destogl commented 2 years ago

This works fine now!