Robotics StackExchange | Archived questions

ImportError: cannot import name ‘Respawn’ from ‘respawnGoal’ (ROS Noetic, Ubuntu 20)

Hi I am trying to run Machine Learning demos for ros noetic on Ubuntu 20 and I am getting this error. It is an import error but I am unable to figure out how to solve it. Please Help :

Traceback (most recent call last):
File “/home/dhairya/catkin_ws/devel/lib/turtlebot3_dqn/turtlebot3_dqn_stage_1”, line 15, in
exec(compile(fh.read(), python_script, ‘exec’), context)
File “/home/dhairya/catkin_ws/src/turtlebot3_machine_learning/turtlebot3_dqn/nodes/turtlebot3_dqn_stage_1”, line 30, in
from src.turtlebot3_dqn.environment_stage_1 import Env
File “/home/dhairya/catkin_ws/src/turtlebot3_machine_learning/turtlebot3_dqn/src/turtlebot3_dqn/environment_stage_1.py”, line 29, in
from respawnGoal import Respawn
ImportError: cannot import name ‘Respawn’ from ‘respawnGoal’ (/home/dhairya/catkin_ws/devel/lib/turtlebot3_dqn/respawnGoal.py)
[turtlebot3_dqn_stage_1-1] process has died [pid 10846, exit code 1, cmd /home/dhairya/catkin_ws/devel/lib/turtlebot3_dqn/turtlebot3_dqn_stage_1 __name:=turtlebot3_dqn_stage_1 __log:=/home/dhairya/.ros/log/d7fbc2d8-c0ff-11ec-a27a-fde6b6e903e0/turtlebot3_dqn_stage_1-1.log].
log file: /home/dhairya/.ros/log/d7fbc2d8-c0ff-11ec-a27a-fde6b6e903e0/turtlebot3_dqn_stage_1-1*.log

Asked by Dhairya_Upadhyay on 2022-04-20 19:02:12 UTC

Comments

Please provide a url for the ros package turtlebot3_machine_learning, or a link to a setup guide. At first glance, the error message hints that you have not installed required python libraries. Did you run rosdep after cloning this git repository?

Asked by Mike Scheutzow on 2022-04-23 11:28:28 UTC

please how to add rosdep i got the same problem

Asked by jandisoon on 2022-11-03 08:25:20 UTC

@jandisoon Please provide the information requested in the first sentence of my above comment. The first thing we need to to verify is that this ros package has been ported to noetic & python3. There are significant differences between python2 and python3, so a lot of python2 code does not run in python3.

Asked by Mike Scheutzow on 2022-11-03 09:30:27 UTC

Answers