Page 1 of 1

Pressure sensor on crazyflie 2.0

Posted: Mon Mar 18, 2019 6:56 am
by ranjeetkumar
Crazyflie published pressure sensor data at 10 Hz, as far as the hardware used as barometer (LPS25H) can publish data to a maximum frequency of 25 Hz, how to increase the frequency of publishing? Is it possible, if yes then how and what can be the maximum limit of publishing? :roll:

Re: Pressure sensor on crazyflie 2.0

Posted: Mon Mar 18, 2019 1:33 pm
by arnaud
Hi,

You can use the log subsystem to acquire the pressure sensor value at any rate up to 100Hz. If you are using the client you can setup a new log block in "settings/logging configuration" and if you are using the python lib there is a couple of example in the example folder showing how to use the log subsystem.

Re: Pressure sensor on crazyflie 2.0

Posted: Wed Mar 20, 2019 4:41 am
by ranjeetkumar
Thank you very much for providing the information, can you tell me how to achieve the same if I am using ROS with crazyflie?

Re: Pressure sensor on crazyflie 2.0

Posted: Wed Mar 20, 2019 5:04 am
by ranjeetkumar
arnaud wrote: Mon Mar 18, 2019 1:33 pm Hi,

You can use the log subsystem to acquire the pressure sensor value at any rate up to 100Hz. If you are using the client you can setup a new log block in "settings/logging configuration" and if you are using the python lib there is a couple of example in the example folder showing how to use the log subsystem.
Thank you very much for providing the information, can you tell me how to achieve the same if I am using ROS with crazyflie?

Re: Pressure sensor on crazyflie 2.0

Posted: Wed Mar 20, 2019 8:30 am
by arnaud
The ROS Crazyflie driver has a way to setup log blocks in the launch file, see existing lauch files for example of how this is achieve: https://github.com/whoenig/crazyflie_ro ... ch#L16-L20. The log will be published as a ros topic.

Re: Pressure sensor on crazyflie 2.0

Posted: Wed Mar 20, 2019 11:40 am
by ranjeetkumar
arnaud wrote: Wed Mar 20, 2019 8:30 am The ROS Crazyflie driver has a way to setup log blocks in the launch file, see existing lauch files for example of how this is achieve: https://github.com/whoenig/crazyflie_ro ... ch#L16-L20. The log will be published as a ros topic.
Since, i wanted to get the pressure data at a higher rate, when I tried to follow the commands and examples you gave me, an error "could not find pressure.pressure in log toc!", i am pasting my code part also.

<rosparam>
genericLogTopics: ["myPressure"]
genericLogTopicFrequencies: [50]
genericLogTopic_myPressure_Variables: ["pressure"]
</rosparam>
here, i am trying to repulish the pressure that is already published by crazyflie at 10 hz at 50 Hz, but after running thelaunch file following error comes,

terminate called after throwing an instance of 'std::runtime_error'
what(): Could not find pressure.pressure in log toc!

i tried to find the way to see the "log toc" but could not find, can you tell something about it? moreover, if the pressure is not there in toc then can i add a new group?

Re: Pressure sensor on crazyflie 2.0

Posted: Wed Mar 20, 2019 1:26 pm
by arnaud
You can use the Crazyflie client to look at the log toc, in the client you can click on "view/tabs/Log TOC". The pressure is available in the variable "baro.pressure".

Re: Pressure sensor on crazyflie 2.0

Posted: Mon Mar 25, 2019 7:51 am
by ranjeetkumar
arnaud wrote: Wed Mar 20, 2019 1:26 pm You can use the Crazyflie client to look at the log toc, in the client you can click on "view/tabs/Log TOC". The pressure is available in the variable "baro.pressure".
Thank you for you useful reply, i used the baro.pressure and it worked in logging the variable. One thing I would like to mention that and it could be a question for you too that I can log the pressure values at 100 Hz also but a single value repeat it self for an average of 4 times, when i log it at 50 Hz, it repeats a value for 2 times, I can get different samples (not repeated) at a max of 25Hz which is consistent with the fact that the barometer used in crazyflie 2.0 (LPS25H) can give the pressure values at frequency between 1-25 Hz (after looking at its data sheet). I was thinking if you are getting not repeated values at 100 Hz or not. If yes, how can you get non-repeating samples at 100 Hz if hardware has the limitaion upto 25Hz?

Re: Pressure sensor on crazyflie 2.0

Posted: Mon Mar 25, 2019 10:30 am
by arnaud
I am not sure I understand the question, since the hardware is limited to 25Hz the reading you are getting makes sense, this is what the Crazyflie is getting from the sensor and it is what the Crazyflie is using when using the altitude-hold mode.