Closed thomaspeyrucain closed 10 months ago
Hey @thomaspeyrucain, thank you for reporting this and the fix. I will test this out and get back to you.
Hello again @thomaspeyrucain, i did some testing regarding this issue.
I used the launch file you provided with some minor modifications to fit my system:
<?xml version="1.0" encoding="UTF-8"?>
<launch>
<arg name="rgb_topic" default="/usb_cam/image_raw"/>
<node name="face_reco_node" pkg="opendr_perception" type="face_recognition_node.py" args="-i $(arg rgb_topic)" output="screen"/>
</launch>
and i got the same error as the one you reported.
Your fix looks perfectly fine to me as it doesn't interfere with non-launch running of the nodes.
The issue originates from the fact that the launch process seems to use the rospy arguments rospy.myargv()
which includes the node's path, e.g. when i printed it i got ['/home/kostas/dev/opendr/projects/opendr_ws/src/opendr_perception/scripts/face_recognition_node.py', '-i', '/usb_cam/image_raw']
, so your fix of skipping the first element of this list rectifies the issue.
One minor issue i noticed, which you should probably be already aware of, is that the working directory when using the launchfile is not the workspace directory but something similar to /home/<user>/.ros
, so in this particular node you need to position your ./database
folder appropriately or provide an appropriate path for face recognition to work properly.
I will go ahead and fix this across all ROS1 nodes so they can be used with launch files. Thank you for your efforts!
Perfect thanks @tsampazk , for the directory I most often put the whole path of the file or folder
Hello,
If I want to integrate the nodes in a launchfile like this:
I get this error:
To fix it I replaced this line: https://github.com/opendr-eu/opendr/blob/b3d6ce670cdf63469fc5766630eb295d67b3d788/projects/opendr_ws/src/opendr_perception/scripts/face_recognition_node.py#L163 By this line:
args = parser.parse_args(rospy.myargv()[1:])
In all the ROS scripts