Problems with Alititude Hold Program
Posted: Sun Mar 08, 2015 5:52 am
Hi all,
I'm doing a project using crazyflie 1.0 nano quadcopter(10DOF). However, I have met some problems recently that I couldn't figure out myself, so I'm wondering if you could give me some technical help about this.
What I am doing is to realize a function in Python that the crazyflie could enter the altitude hold mode by pressing and holding a button on the gamepad, and then it can land automatically. I'm using crazyflie-firmware-2015.1, this firmware can let the crazyflie realize altitude hold through cfclient currently.
My problems are as follows:
1. There is a function in crazyflie-firmware-2015.1/modules/src/stabilizer.c
// Get altitude hold commands from pilot
commanderGetAltHold(&altHold, &setAltHold, &altHoldChange);
This program gets the information on the gamepad, but how can I change it to altHoldChange to realize auto landing? Can I reduce it gradually? What is the range of this variable?
2. I know there is a function which could enable Altitude Hold Mode in Python:
crazyflie.param.set_value("flightmode.althold", "True")
However, This seemed doesn't work when I tested it. So I wonder if it should be put in a loop to execute, if so, what value should the frequency be?
3. If we really modify the stabilizer.c to realize the auto landing, then could it work by only using crazyflie.param.set_value("flightmode.althold", "True") in Python? Do we need other program instructions?
Thanks!
I'm doing a project using crazyflie 1.0 nano quadcopter(10DOF). However, I have met some problems recently that I couldn't figure out myself, so I'm wondering if you could give me some technical help about this.
What I am doing is to realize a function in Python that the crazyflie could enter the altitude hold mode by pressing and holding a button on the gamepad, and then it can land automatically. I'm using crazyflie-firmware-2015.1, this firmware can let the crazyflie realize altitude hold through cfclient currently.
My problems are as follows:
1. There is a function in crazyflie-firmware-2015.1/modules/src/stabilizer.c
// Get altitude hold commands from pilot
commanderGetAltHold(&altHold, &setAltHold, &altHoldChange);
This program gets the information on the gamepad, but how can I change it to altHoldChange to realize auto landing? Can I reduce it gradually? What is the range of this variable?
2. I know there is a function which could enable Altitude Hold Mode in Python:
crazyflie.param.set_value("flightmode.althold", "True")
However, This seemed doesn't work when I tested it. So I wonder if it should be put in a loop to execute, if so, what value should the frequency be?
3. If we really modify the stabilizer.c to realize the auto landing, then could it work by only using crazyflie.param.set_value("flightmode.althold", "True") in Python? Do we need other program instructions?
Thanks!