Put these commands into an executable shell script (let's call it yourscript.sh
) somewhere inside the package directory (let's call the package yourpackage
) and then reference that script inside your launch file (e.g. example.launch
):
<node name="nodename" pkg="yourpackage" type="yourscript.sh">
Originally posted by DamienJadeDuff with karma: 399 on 2013-05-28
This answer was NOT ACCEPTED on the original site
Post score: 1
Original comments
Comment by felix k on 2013-05-28:
Actually roslaunch direct_path_to_.launch_file
is possible. See roslaunch -h
;-)
Comment by felix k on 2013-05-28:
@Mohsen Keep in mind that this 'script node' is started with all others in parallel. So while usually the chmods will be done before any node even starts thinking about those /devs, the worst case might be that every other node has started (and perhaps crashed) before the first chmod is called
Comment by dornhege on 2013-05-29:\
- For sudo, you'd need to enter password. From the command, it seems you should set that up with udev. For the devices you use, it might also be sufficient to do
adduser <USER> dialout
.
Comment by benabruzzo on 2014-04-14:
When I use the above I get an error: ERROR: cannot launch node of type [hast/yourScript.sh]: Cannot locate node of type [yourScript.sh] in package [hast]. Is an entry to the CMakeLists file necessary?
Comment by dornhege on 2014-04-15:
Is the script executable?
Comment by DamienJadeDuff on 2014-04-17:
Fixed the answer, thanks felix k. My answer is not a good one anyway. ;)