ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can run any program inside a ROS package using rosrun
(or equally, a launch file), no matter if it's a ROS node or not. So I would suggest you put the command(s) you use to run your program from the command line into a shell script and use rosrun
to run that script.
Example:
my_pkg/scripts/server.sh
:
#!/bin/sh
# TODO: set up CLASSPATH, ...
java $1
run from command line:
rosrun my_pkg server.sh $(rospack find my_pkg)/classes/Server.class
run from launch file:
my_pkg/launch/my_stuff.launch
:
<launch>
<node pkg="my_pkg" type="server.sh" name="server" args="$(find my_pkg)/classes/Server.class" />
</launch>
2 | No.2 Revision |
You can run any program inside a ROS package using rosrun
(or equally, a launch file), no matter if it's a ROS node or not. So I would suggest you put the command(s) you use to run your program from the command line into a shell script and use rosrun
to run that script.
Example:
my_pkg/scripts/server.sh
:
#!/bin/sh
# TODO: set up CLASSPATH, ...
java $1
run from command line:
$
rosrun my_pkg server.sh $(rospack find run from launch file:
file (my_pkg/launch/my_stuff.launch
:):
<launch>
<node pkg="my_pkg" type="server.sh" name="server" args="$(find my_pkg)/classes/Server.class" />
my_pkg)/classes/Server.class"/>
</launch>
3 | No.3 Revision |
You can run any program inside a ROS package using rosrun
(or equally, a launch file), no matter if it's a ROS node or not. So I would suggest you put the command(s) you use to run your program from the command line into a shell script and use rosrun
to run that script.
Example:
my_pkg/scripts/server.sh
:
#!/bin/sh
# TODO: set up CLASSPATH, ...
java $1
run from command line:
$ rosrun my_pkg server.sh $(rospack find my_pkg)/classes/Server.class
run from launch file (my_pkg/launch/my_stuff.launch
):
<launch>
<node pkg="my_pkg" type="server.sh" name="server" args="$(find my_pkg)/classes/Server.class"/>
</launch>
(remember to set the executable bit on server.sh
)
4 | No.4 Revision |
You can run any program inside a ROS package using rosrun
(or equally, using a launch file), no matter if it's a ROS node or not. So I would suggest you put the command(s) you use to run your program from the command line into a shell script and use rosrun
to run that script.
Example:
my_pkg/scripts/server.sh
:
#!/bin/sh
# TODO: set up CLASSPATH, ...
java $1
run from command line:
$ rosrun my_pkg server.sh $(rospack find my_pkg)/classes/Server.class
run from launch file (my_pkg/launch/my_stuff.launch
):
<launch>
<node pkg="my_pkg" type="server.sh" name="server" args="$(find my_pkg)/classes/Server.class"/>
</launch>
(remember to set the executable bit on server.sh
)
5 | No.5 Revision |
You can run any program inside a ROS package using rosrun
(or equally, using a launch file), no matter if it's a ROS node or not. So I would suggest you put the command(s) you use to run your program from the command line into a shell script and use rosrun
to run that script.
Example:
my_pkg/scripts/server.sh
:
#!/bin/sh
# TODO: set up CLASSPATH, ...
java $1
$1 # this won't work exactly, you need to add some more
# arguments to java (never can remember which)
run from command line:
$ rosrun my_pkg server.sh $(rospack find my_pkg)/classes/Server.class
run from launch file (my_pkg/launch/my_stuff.launch
):
<launch>
<node pkg="my_pkg" type="server.sh" name="server" args="$(find my_pkg)/classes/Server.class"/>
</launch>
(remember to set the executable bit on server.sh
)