Skip to content

Setting Parameters seems to break with newer cfclient/cflib versions #2

@SUPfeiffer

Description

@SUPfeiffer

With the newest versions of cfclient (2022.5) and cflib (0.1.19) setting parameters on the crazyflie does not work anymore. Downgrading to cfclient 2021.6.1 and cflib 0.1.16 fixes the issue. The following code can be added to verify that parameters are properly set when the kalman filter is reset (log_flight.py:166):

    def param_cb(self, name, value):
        print("Parameter " + name + " changed to " + value)

    def reset_estimator(self):
        self._cf.param.add_update_callback(group="kalman", name="resetEstimation", cb=self.param_cb)
        # Kalman
        if self.args["estimator"] == "kalman":
            self._cf.param.set_value("kalman.resetEstimation", "1")
            time.sleep(1)
            self._cf.param.set_value("kalman.resetEstimation", "0")
        # Complementary (needs changes to firmware)
        if self.args["estimator"] == "complementary":
            try:
                self._cf.param.set_value("complementaryFilter.reset", "1")
                time.sleep(1)
                self._cf.param.set_value("complementaryFilter.reset", "0")
            except:
                pass

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions