AutonomyLab / bebop_autonomy

ROS driver for Parrot Bebop Drones 1.0 & 2.0
http://wiki.ros.org/bebop_autonomy
BSD 3-Clause "New" or "Revised" License
152 stars 121 forks source link

ERROR: cannot launch node of type [bebop_autonomy/bebop_driver]: bebop_autonomy #85

Closed kenisvery closed 7 years ago

kenisvery commented 7 years ago

Trying to run keyboard controller with bebop autonomy but error occurred.

kenisvery@kenisvery-Sensei:~/bebop_ws$ roslaunch bebop_tutorials keyboard_controller.launch ... logging to /home/kenisvery/.ros/log/ee4ea42c-d1c4-11e6-94b8-0800275ad713/roslaunch-kenisvery-Sensei-15852.log Checking log directory for disk usage. This may take awhile. Press Ctrl-C to interrupt Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://kenisvery-Sensei:33962/

SUMMARY

CLEAR PARAMETERS

PARAMETERS

NODES / bebop_driver (bebop_autonomy/bebop_driver) keyboard_controller (bebop_tutorials/keyboard_controller.py)

auto-starting new master process[master]: started with pid [15864] ROS_MASTER_URI=http://localhost:11311

setting /run_id to ee4ea42c-d1c4-11e6-94b8-0800275ad713 process[rosout-1]: started with pid [15877] started core service [/rosout] ERROR: cannot launch node of type [bebop_autonomy/bebop_driver]: bebop_autonomy ROS path [0]=/opt/ros/indigo/share/ros ROS path [1]=/home/kenisvery/bebop_ws/src ROS path [2]=/home/kenisvery/catkin_ws/src ROS path [3]=/opt/ros/indigo/share ROS path [4]=/opt/ros/indigo/stacks process[keyboard_controller-3]: started with pid [15889] Traceback (most recent call last): File "/home/kenisvery/bebop_ws/src/bebop_tutorials/src/keyboard_controller.py", line 9, in import roslib; roslib.load_manifest('bebop_tutorials') File "/opt/ros/indigo/lib/python2.7/dist-packages/roslib/launcher.py", line 62, in load_manifest sys.path = _generate_python_path(package_name, _rospack) + sys.path File "/opt/ros/indigo/lib/python2.7/dist-packages/roslib/launcher.py", line 98, in _generate_python_path packages = get_depends(pkg, rospack) File "/opt/ros/indigo/lib/python2.7/dist-packages/roslib/launcher.py", line 51, in get_depends vals = rospack.get_depends(package, implicit=True) File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 237, in get_depends s.update(self.get_depends(p, implicit)) File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 231, in get_depends names = [p.name for p in self.get_manifest(name).depends] File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 164, in get_manifest return self._load_manifest(name) File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 208, in _load_manifest retval = self._manifests[name] = parse_manifest_file(self.get_path(name), self._manifest_name, rospack=self) File "/usr/lib/python2.7/dist-packages/rospkg/rospack.py", line 200, in get_path raise ResourceNotFound(name, ros_paths=self._ros_paths) rospkg.common.ResourceNotFound: bebop_autonomy ROS path [0]=/opt/ros/indigo/share/ros ROS path [1]=/home/kenisvery/bebop_ws/src ROS path [2]=/home/kenisvery/catkin_ws/src ROS path [3]=/opt/ros/indigo/share ROS path [4]=/opt/ros/indigo/stacks ================================================================================REQUIRED process [keyboard_controller-3] has died! process has died [pid 15889, exit code 1, cmd /home/kenisvery/bebop_ws/src/bebop_tutorials/src/keyboard_controller.py __name:=keyboard_controller __log:=/home/kenisvery/.ros/log/ee4ea42c-d1c4-11e6-94b8-0800275ad713/keyboard_controller-3.log]. log file: /home/kenisvery/.ros/log/ee4ea42c-d1c4-11e6-94b8-0800275ad713/keyboard_controller-3*.log Initiating shutdown!

[keyboard_controller-3] killing on exit [rosout-1] killing on exit [master] killing on exit shutting down processing monitor... ... shutting down processing monitor complete done

Package.xml -->

bebop_tutorials 1.0.0 Controllers developed for the "Up and flying with the bebop Drone and ROS" tutorial series kenisvery catkin bebop_autonomy joy BSD http://github.com/mikehamer/ardrone_tutorials

CMakeLists.txt -->

cmake_minimum_required(VERSION 2.8) project(bebop_tutorials)

find_package(catkin REQUIRED) catkin_package()

catkin_python_setup()

install(PROGRAMS src/drone_controller.py
src/drone_status.py
src/drone_video_display.py
src/joystick_controller.py
src/keyboard_controller.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )

install(DIRECTORY launch/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch )

mani-monaj commented 7 years ago
  1. Could you please format the code section of your submitted issue better?
  2. Have you sourceed the setup.bash file within Bebop's workspace?
kenisvery commented 7 years ago

yes, i sourced the setup.bash every time i run the launch file in the bebop_ws.

`cmake_minimum_required(VERSION 2.8) project(bebop_tutorials)

find_package(catkin REQUIRED) catkin_package()

catkin_python_setup()

install(PROGRAMS src/drone_controller.py
src/drone_status.py
src/drone_video_display.py
src/joystick_controller.py
src/keyboard_controller.py DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION} )

install(DIRECTORY launch/ DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION}/launch )`

`

bebop_tutorials1.0.0 Controllers developed for the "Up and flying with the bebop Drone and ROS" tutorial series kenisverycatkinbebop_autonomyjoyBSDhttp://github.com/mikehamer/ardrone_tutorials ` keyboard controller.py --> `#!/usr/bin/env python # The Keyboard Controller Node for the tutorial "Up and flying with the AR.Drone and ROS | Getting Started" # https://github.com/mikehamer/ardrone_tutorials # This controller extends the base DroneVideoDisplay class, adding a keypress handler to enable keyboard control of the drone # Import the ROS libraries, and load the manifest file which through will give us access to the project dependencies import roslib; roslib.load_manifest('bebop_tutorials') import rospy # Load the DroneController class, which handles interactions with the drone, and the DroneVideoDisplay class, which handles video display from drone_controller import BasicDroneController from drone_video_display import DroneVideoDisplay # Finally the GUI libraries from PySide import QtCore, QtGui # Here we define the keyboard map for our controller (note that python has no enums, so we use a class) class KeyMapping(object): PitchForward = QtCore.Qt.Key.Key_E PitchBackward = QtCore.Qt.Key.Key_D RollLeft = QtCore.Qt.Key.Key_S RollRight = QtCore.Qt.Key.Key_F YawLeft = QtCore.Qt.Key.Key_W YawRight = QtCore.Qt.Key.Key_R IncreaseAltitude = QtCore.Qt.Key.Key_Q DecreaseAltitude = QtCore.Qt.Key.Key_A Takeoff = QtCore.Qt.Key.Key_Y Land = QtCore.Qt.Key.Key_H Emergency = QtCore.Qt.Key.Key_Space # Our controller definition, note that we extend the DroneVideoDisplay class class KeyboardController(DroneVideoDisplay): def __init__(self): super(KeyboardController,self).__init__() self.pitch = 0 self.roll = 0 self.yaw_velocity = 0 self.z_velocity = 0 # We add a keyboard handler to the DroneVideoDisplay to react to keypresses def keyPressEvent(self, event): key = event.key() # If we have constructed the drone controller and the key is not generated from an auto-repeating key if controller is not None and not event.isAutoRepeat(): # Handle the important cases first! if key == KeyMapping.Emergency: controller.SendEmergency() elif key == KeyMapping.Takeoff: controller.SendTakeoff() elif key == KeyMapping.Land: controller.SendLand() else: # Now we handle moving, notice that this section is the opposite (+=) of the keyrelease section if key == KeyMapping.YawLeft: self.yaw_velocity += 1 elif key == KeyMapping.YawRight: self.yaw_velocity += -1 elif key == KeyMapping.PitchForward: self.pitch += 1 elif key == KeyMapping.PitchBackward: self.pitch += -1 elif key == KeyMapping.RollLeft: self.roll += 1 elif key == KeyMapping.RollRight: self.roll += -1 elif key == KeyMapping.IncreaseAltitude: self.z_velocity += 1 elif key == KeyMapping.DecreaseAltitude: self.z_velocity += -1 # finally we set the command to be sent. The controller handles sending this at regular intervals controller.SetCommand(self.roll, self.pitch, self.yaw_velocity, self.z_velocity) def keyReleaseEvent(self,event): key = event.key() # If we have constructed the drone controller and the key is not generated from an auto-repeating key if controller is not None and not event.isAutoRepeat(): # Note that we don't handle the release of emergency/takeoff/landing keys here, there is no need. # Now we handle moving, notice that this section is the opposite (-=) of the keypress section if key == KeyMapping.YawLeft: self.yaw_velocity -= 1 elif key == KeyMapping.YawRight: self.yaw_velocity -= -1 elif key == KeyMapping.PitchForward: self.pitch -= 1 elif key == KeyMapping.PitchBackward: self.pitch -= -1 elif key == KeyMapping.RollLeft: self.roll -= 1 elif key == KeyMapping.RollRight: self.roll -= -1 elif key == KeyMapping.IncreaseAltitude: self.z_velocity -= 1 elif key == KeyMapping.DecreaseAltitude: self.z_velocity -= -1 # finally we set the command to be sent. The controller handles sending this at regular intervals controller.SetCommand(self.roll, self.pitch, self.yaw_velocity, self.z_velocity) # Setup the application if __name__=='__main__': import sys # Firstly we setup a ros node, so that we can communicate with the other packages rospy.init_node('bebop_keyboard_controller') # Now we construct our Qt Application and associated controllers and windows app = QtGui.QApplication(sys.argv) controller = BasicDroneController() display = KeyboardController() display.show() # executes the QT application status = app.exec_() # and only progresses to here once the application has been shutdown rospy.signal_shutdown('Great Flying!') sys.exit(status) ` drone_controller.py --> `#!/usr/bin/env python # A basic drone controller class for the tutorial "Up and flying with the AR.Drone and ROS | Getting Started" # https://github.com/mikehamer/ardrone_tutorials_getting_started # This class implements basic control functionality which we will be using in future tutorials. # It can command takeoff/landing/emergency as well as drone movement # It also tracks the drone state based on navdata feedback # Import the ROS libraries, and load the manifest file which through will give us access to the project dependencies import roslib; roslib.load_manifest('bebop_tutorials') import rospy # Import the messages we're interested in sending and receiving from geometry_msgs.msg import Twist # for sending commands to the drone from std_msgs.msg import Empty # for land/takeoff/emergency from bebop_autonomy.msg import Navdata # for receiving navdata feedback # An enumeration of Drone Statuses from drone_status import DroneStatus # Some Constants COMMAND_PERIOD = 100 #ms class BasicDroneController(object): def __init__(self): # Holds the current drone status self.status = -1 # Subscribe to the /bebop/navdata topic, of message type navdata, and call self.ReceiveNavdata when a message is received self.subNavdata = rospy.Subscriber('/bebop/navdata',Navdata,self.ReceiveNavdata) # Allow the controller to publish to the /bebop/takeoff, land and reset topics self.pubLand = rospy.Publisher('/bebop/land',Empty) self.pubTakeoff = rospy.Publisher('/bebop/takeoff',Empty) self.pubReset = rospy.Publisher('/bebop/reset',Empty) # Allow the controller to publish to the /cmd_vel topic and thus control the drone self.pubCommand = rospy.Publisher('/cmd_vel',Twist) # Setup regular publishing of control packets self.command = Twist() self.commandTimer = rospy.Timer(rospy.Duration(COMMAND_PERIOD/1000.0),self.SendCommand) # Land the drone if we are shutting down rospy.on_shutdown(self.SendLand) def ReceiveNavdata(self,navdata): # Although there is a lot of data in this packet, we're only interested in the state at the moment self.status = navdata.state def SendTakeoff(self): # Send a takeoff message to the bebop driver # Note we only send a takeoff message if the drone is landed - an unexpected takeoff is not good! if(self.status == DroneStatus.Landed): self.pubTakeoff.publish(Empty()) def SendLand(self): # Send a landing message to the bebop driver # Note we send this in all states, landing can do no harm self.pubLand.publish(Empty()) def SendEmergency(self): # Send an emergency (or reset) message to the bebop driver self.pubReset.publish(Empty()) def SetCommand(self,roll=0,pitch=0,yaw_velocity=0,z_velocity=0): # Called by the main program to set the current command self.command.linear.x = pitch self.command.linear.y = roll self.command.linear.z = z_velocity self.command.angular.z = yaw_velocity def SendCommand(self,event): # The previously set command is then sent out periodically if the drone is flying if self.status == DroneStatus.Flying or self.status == DroneStatus.GotoHover or self.status == DroneStatus.Hovering: self.pubCommand.publish(self.command) ` I suspect it is caused by the publisher of the drone controller. It
mani-monaj commented 7 years ago

It's hard for me to follow what you've pasted.

  1. Please consider formatting your report properly
  2. Please include only the information that you think might be useful. I quite frankly am overwhelmed with the amount of information provide.

You can also use Questions - ROS Answers: Open Source Q&A Forum forum to post this type of questions. Please use the tag: bebop_autonomy.

thomas-bamford commented 7 years ago

Hello, @kenisvery Have you made any progress in this effort? In the terminal output above, the program was crashing because the bebop_autonomy package was not found. This is because 'bebop_autonomy' is a metapackage. When using the messages from the bebop_autonomy package you should make your package dependent on the bebop_msgs package. Please let us know if this helps.

I also noticed that in the dronevideodisplay code, you have imported a non-existing message 'from bebop_autonomy.msg import Navdata.' Please see http://bebop-autonomy.readthedocs.io/en/latest/reading.html#states-aka-navdata describing that the bebop sdk does not publish to a single topic named navdata anymore. Thanks.

mani-monaj commented 7 years ago

@kenisvery closing this ticket due to inactivity. Please feel free to re-open it if you have any updates.

Sepideh-Niktabe commented 6 years ago

install these packages sudo apt-get install ros-kinetic-gazebo-ros-pkgs ros-kinetic-gazebo-ros-control sudo apt-get install ros-kinetic-gazebo-ros-pkgs

if you got an error