ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

MCVB's profile - activity

2021-08-18 04:06:19 -0500 marked best answer rosrun error FileNotFoundError: [Errno 2] No such file or directory

I'm trying to run

rosrun package python scripts

and get some errors below:

(cv-py3) hoang@hoang-Nitro-AN515-51:~/catkin_ws$ rosrun testpy test.py 
Parsing cfg/tiny-yolo-voc-3c.cfg
Traceback (most recent call last):
  File "/home/hoang/catkin_ws/src/testpy/src/test.py", line 41, in <module>
    tfnet = TFNet(options)
  File "/home/hoang/catkin_ws/src/testpy/src/darkflow/net/build.py", line 58, in __init__
    darknet = Darknet(FLAGS)
  File "/home/hoang/catkin_ws/src/testpy/src/darkflow/dark/darknet.py", line 17, in __init__
    src_parsed = self.parse_cfg(self.src_cfg, FLAGS)
  File "/home/hoang/catkin_ws/src/testpy/src/darkflow/dark/darknet.py", line 68, in parse_cfg
    for i, info in enumerate(cfg_layers):
  File "/home/hoang/catkin_ws/src/testpy/src/darkflow/utils/process.py", line 66, in cfg_yielder
    layers, meta = parser(model); yield meta;
  File "/home/hoang/catkin_ws/src/testpy/src/darkflow/utils/process.py", line 17, in parser
    with open(model, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'cfg/tiny-yolo-voc-3c.cfg'

Note: those errors stop when I run rosrun in the script's folder. But, I wanna add a node in package launch file to use roslaunch for python scripts.

What I need to do? Thanks in advance!

I followed these steps:

$ cd ~

$ mkdir catkin_ws/src -p

$ cd catkin_ws

$ catkin_make

$ cd src

$ catkin_create_pkg testpy rospy

this step I copy all scripts to package/src folder

$ cd ~/catkin_ws

$ catkin_make

$ . ~/catkin_ws/devel/setup.bash

$ roscore

$ chmod +x test.py (added #!/usr/bin/env python)

$ rosrun testpy test.py

2020-04-29 21:50:44 -0500 received badge  Famous Question (source)
2020-04-29 21:50:44 -0500 received badge  Notable Question (source)
2019-01-10 21:09:31 -0500 received badge  Popular Question (source)
2019-01-10 10:02:50 -0500 commented question rosrun error FileNotFoundError: [Errno 2] No such file or directory

Ok, It was edited

2019-01-10 10:02:04 -0500 edited question rosrun error FileNotFoundError: [Errno 2] No such file or directory

rosrun error FileNotFoundError: [Errno 2] No such file or directory I'm trying to run rosrun package python scripts a

2019-01-10 10:02:04 -0500 received badge  Editor (source)
2019-01-10 10:00:22 -0500 edited question rosrun error FileNotFoundError: [Errno 2] No such file or directory

rosrun error FileNotFoundError: [Errno 2] No such file or directory I'm trying to run rosrun package python scripts a

2019-01-10 09:32:40 -0500 asked a question rosrun error FileNotFoundError: [Errno 2] No such file or directory

rosrun error FileNotFoundError: [Errno 2] No such file or directory I'm trying to run rosrun package python scripts a