You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 9, 2022. It is now read-only.
I noticed that currently there is no "standard" way of calling a rosjava node in the regular ROS way (i.e. rosrun [package] [node] [params]).
After trying this out a little bit, I figured that we are just one step away from there (I updated the tutorials a bit). Basically, after following the standard steps to create a package, you can use rosrun like this:
# rosrun [package] [rosjava project] [node class full name]
rosrun rosjava_catkin_package_a my_pub_sub_tutorial com.github.rosjava.rosjava_catkin_package_a.my_pub_sub_tutorial.Talker
Because Gradle creates an executable script which calls RosRun class in rosjava, with the class to execute as its parameter.
The problem is that the task installApp actually creates two executable scripts inside the package. rosrun will then ask the user which one to execute instead of executing it directly.
[rosrun] You have chosen a non-unique executable, please pick one of the following:
1) /home/juan/rosjava_test_ws/src/package/project/build/scripts/project
2) /home/juan/rosjava_test_ws/src/package/project/build/install/project/bin/project
3) /home/juan/rosjava_test_ws/src/package/project/build/scripts/project
4) /home/juan/rosjava_test_ws/src/package/project/build/install/project/bin/project
If we could just eliminate the scripts under scripts directory, rosrun would work right away.
Two quick solutions come to my mind. The first one is to tweak the rosjava project template to delete them, adding something like this:
The second one would be to use a custom plugin instead of application (i.e. ros-java-application), which would add the application plugin and a new task ("cleanup" or something like that). Then, tweak the CMakeLists to call this new cleanup task after installApp.
Perhaps there is a better option to tweak installApp directly from a plugin instead of using the project level build.gradle, but I really don't know how to do that in a clean way.
To sum up, this would allow using rosrun just like a regular ROS package right after using catkin_make and sourcing the workspace.
If this sounds good, I offer myself to create a PR with the fixes. Thoughts?
/cc @adamantivm@ernestmc
The text was updated successfully, but these errors were encountered:
This solution is great, but (at least for me) it only works the first time gradlew deployApp is executed. If this task is UP-TO-DATE because no changes were made, the scripts will be there when you call rosrun.
Here it is a workaround to ensure that scripts are always deleted:
I noticed that currently there is no "standard" way of calling a rosjava node in the regular ROS way (i.e.
rosrun [package] [node] [params]
).After trying this out a little bit, I figured that we are just one step away from there (I updated the tutorials a bit). Basically, after following the standard steps to create a package, you can use
rosrun
like this:Because Gradle creates an executable script which calls
RosRun
class in rosjava, with the class to execute as its parameter.The problem is that the task
installApp
actually creates two executable scripts inside the package.rosrun
will then ask the user which one to execute instead of executing it directly.If we could just eliminate the scripts under
scripts
directory,rosrun
would work right away.Two quick solutions come to my mind. The first one is to tweak the rosjava project template to delete them, adding something like this:
The second one would be to use a custom plugin instead of
application
(i.e.ros-java-application
), which would add the application plugin and a new task ("cleanup" or something like that). Then, tweak theCMakeLists
to call this new cleanup task afterinstallApp
.Perhaps there is a better option to tweak
installApp
directly from a plugin instead of using the project levelbuild.gradle
, but I really don't know how to do that in a clean way.To sum up, this would allow using
rosrun
just like a regular ROS package right after usingcatkin_make
and sourcing the workspace.If this sounds good, I offer myself to create a PR with the fixes. Thoughts?
/cc @adamantivm @ernestmc
The text was updated successfully, but these errors were encountered: