Page 1 of 1

[SOLVED] Making Changes to cflib/positioning/motion_commander.py

Posted: Wed Jun 19, 2019 9:13 pm
by Lombazombie
Hello,

It appears that whenever I edit the motion_commander.py, no changes are made when I call it in a different program. Any ideas?

For example, if I throw a negative sign in the distance_m value below:

Code: Select all

    def left(self, distance_m, velocity=VELOCITY):
        """
        Go left
        :param distance_m: the distance to travel (meters)
        :param velocity: the velocity of the motion (meters/second)
        :return:
        """
        self.move_distance(0.0, distance_m, 0.0, velocity)
It should move right instead of left. However, it doesn't.

Re: Making Changes to cflib/positioning/motion_commander.py

Posted: Tue Jun 25, 2019 4:31 pm
by Lombazombie
As an update. I've updated the firmware, flashed it with the latest bootloader, and still not able to make any changes.

Re: Making Changes to cflib/positioning/motion_commander.py

Posted: Wed Jun 26, 2019 6:59 am
by arnaud
You most likely have installed the lib from pypi and not from your local source. To make sure you are using your local cloned lib you need to uninstall the already installed lib and then install it in editable mode:

Code: Select all

$ python3 -m pip uninstall cflib
$ python3 -m pip uninstall cflib      # Making sure there is no other install of the lib in the system

$ cd crazyflie-lib-python
$ python3 -m pip install -e .
This way, your other program will use your local crazyflie lib.

Re: Making Changes to cflib/positioning/motion_commander.py

Posted: Fri Sep 20, 2019 9:19 pm
by Lombazombie
This totally worked! Thank you.