No module named pyquaternion

Hi, I’m trying to finish the last excercise from the Programming Drones with ROS course, but I’m getting an import error when trying to run:

rosrun drone_application _real_drone:=false _aruco_coords:=false _visualise_trajectory:=false

Previously I had to download the repository from eYIPS:

emphasized text

Since the repository given in the course (git clone GitHub - tum-vision/tum_ardrone: Repository for the tum_ardrone ROS package, implementing autonomous flight with PTAM-based visual navigation for the Parrot AR.Drone.) did not contain the drone_application package which contains the and scripts shown to be used in the course. (<-- Actually I do not know what is the point of downloading this ardrone_tum repository since it is not being used as far as I know. Could it be a mistake in referencing the repository?)

Anyways, I deleted the devel and build folders using rm -rf devel build command, and then I compiled the packages from the catkin_ws.

I launched the load_octomap.launch file, as well as the ardrone_navigation.launch files created through the course, without errors.

When running rosrun drone_application _real_drone:=false _aruco_mapping:=false I initially got an error about the aruco_mapping.msg module not being able to be found, however since later I read that we’re not using the ArucoMarker, I just commented this import and managed to run succesfully the command. I don’t know if this was right to do, but it’s still not clear to me how to install such module. (I’m thinking it’s just a matter of downloading a repository and compiling it, but I haven’t tried - any guidance will be appreciated)

The problem I’m facing is that now it seems that this import:


is now causing problems.

I tried installing the pyquaternion library using python3 -m pip install pyquaternion to no avail:

I would like to be able to complete the exercise (see the drone moving in the gazebo simulation after giving the goal through the MoveIt RViz window), but I don’t know what else to do. Hopefully someone here can help me.

Thanks in advance! :grin:

Hi @javier990507
This error shows that you might install the pyquaternion in the wrong command. Therefore, I suggest that you should try to download it via this command:

pip3 install pyquaternion

If it still has the same error, please let me know.
Best regard,

Hi, thanks for replying.

I tried using pip3 install pyquaternion but it stills show me an error:

Hi, I think I managed to solve the problem. For anyone that might be going through the same:

Instead of using pip3 install pyquaternion use pip install pyquaternion!

After doing so, I can now run:

rosrun drone_application _real_drone:=false _aruco_coords:=false _visualise_trajectory:=false

and visualize the drone in the gazebo simulation following the trajectory seen in the MoveIt RViz window.

Good to hear that you solved the problem