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

Post here to get support
Post Reply
Lombazombie
Beginner
Posts: 28
Joined: Sun Mar 25, 2018 12:37 am

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

Post by Lombazombie » Wed Jun 19, 2019 9:13 pm

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.
Last edited by Lombazombie on Fri Sep 20, 2019 9:19 pm, edited 1 time in total.



Lombazombie
Beginner
Posts: 28
Joined: Sun Mar 25, 2018 12:37 am

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

Post by Lombazombie » Tue Jun 25, 2019 4:31 pm

As an update. I've updated the firmware, flashed it with the latest bootloader, and still not able to make any changes.

arnaud
Bitcraze
Posts: 2127
Joined: Tue Feb 06, 2007 12:36 pm

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

Post by arnaud » Wed Jun 26, 2019 6:59 am

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.

Lombazombie
Beginner
Posts: 28
Joined: Sun Mar 25, 2018 12:37 am

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

Post by Lombazombie » Fri Sep 20, 2019 9:19 pm

This totally worked! Thank you.

Post Reply