diff --git a/crazyflie-audio b/crazyflie-audio index 9dd60d33..f7f3aa77 160000 --- a/crazyflie-audio +++ b/crazyflie-audio @@ -1 +1 @@ -Subproject commit 9dd60d33b743783334bd4230829f455b47d5ab76 +Subproject commit f7f3aa7760a42ed62dea02ee270952595b46cdaa diff --git a/experiments/2020_09_17_white-noise-static/README.md b/experiments/2020_09_17_white-noise-static/README.md new file mode 100644 index 00000000..6321d496 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/README.md @@ -0,0 +1,80 @@ + +# EXPERIMENT NAME + +__Time__: Thursday 17.09.2020, ca. 15.00-18.00 + +__Recorded by__: Frederike Dümbgen (ROS), Adrien Hoffet (Soundcard) + +__Place__: Audio room INR018, EPFL + +## Description + +### Hardware + + +- Small speaker, center of bottom output mounted at 1.47 meters. +- Drone with audio deck, height of microphones at 1.47 meters. +- One measurement microphone at 1.73 meters, above the center of the drone, for control purposes. +- Source at 0 degrees corresponds to 180 degrees in the drone's frame. +- Drone turned counter-clockwise by 20 and 45 degrees for different experiments. +- Distance speaker to center of drone: 1.9 meters. + + +### Software + + +- Software versions used: version0.2 for crazyflie-audio, crazyflie-firmware, audioROS +- Sampling rate: 32000 kHz +- Motor thrust value: 43000, set using parameter motorPowerSet.m1-m4 +- Used [crazyflie-audio/reaper/crazyflie_audio_measurements.RPP](https://github.com/LCAV/crazyflie-audio/blob/f7f3aa7760a42ed62dea02ee270952595b46cdaa/reaper/crazyflie_audio_measurements.RPP) file for speaker and measurement mic (commit: f7f3aa7760). + +### Protocol + + +- Sound level calibration: measured at the measurement microphone location, during the experiments at 45 degrees. + - Maximum source: 80 dB + - Propeller noise: 73.5 dB +- Measurement microphone recorded during 45 degrees experiments. +- Order of scripts: + - `ros2 run crazyflie_crtp gateway`: start getting audio data + - `ros2 param set ...`: set `filter_snr_enable` etc., set motor speeds + - `*_bkp`: had to run this experiment again because forgot to record on soundcard side. + - `*_crash`: had to run this experiment again because drone stopped sending data half-way. + - run at the same time: `ros2 bag record -o ...` and play (+record) the sound through the soundcard + - stop bag file recording as soon as the sound reaches its end. + +### Data + + +- `export/`: Measurement microphone recordings. +- `___`: Audio deck recordings, e.g. `motors_nosnr_noprops_nosource`: propellers on, `filter_snr_enable` set to 0, `filter_props_enable` set to 0, no source playing. +- `photos`: Photos of the experiment setup. + +### Observations + + +- Needed to change batteries 3 times. +- Needed to restart the drone a few times because it stopped sending any valid audio data. diff --git a/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_motors_nosnr_noprops_nosource_45.wav b/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_motors_nosnr_noprops_nosource_45.wav new file mode 100755 index 00000000..7c5403e3 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_motors_nosnr_noprops_nosource_45.wav differ diff --git a/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_motors_nosnr_noprops_source_45.wav b/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_motors_nosnr_noprops_source_45.wav new file mode 100755 index 00000000..26012ecb Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_motors_nosnr_noprops_source_45.wav differ diff --git a/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_nomotors_nosnr_noprops_source_45.wav b/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_nomotors_nosnr_noprops_source_45.wav new file mode 100755 index 00000000..0e171de0 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/export/crazyflie_audio_measurements_nomotors_nosnr_noprops_source_45.wav differ diff --git a/experiments/2020_09_17_white-noise-static/motors_nonosnr_props_source_20/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_nonosnr_props_source_20/metadata.yaml new file mode 100644 index 00000000..fec639da --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_nonosnr_props_source_20/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_nonosnr_props_source_20/motors_nonosnr_props_source_20_0.db3 + duration: + nanoseconds: 36477265672 + starting_time: + nanoseconds_since_epoch: 1600355061766242700 + message_count: 258 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 258 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_nonosnr_props_source_20/motors_nonosnr_props_source_20_0.db3 b/experiments/2020_09_17_white-noise-static/motors_nonosnr_props_source_20/motors_nonosnr_props_source_20_0.db3 new file mode 100644 index 00000000..26df5387 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_nonosnr_props_source_20/motors_nonosnr_props_source_20_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_nosource/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_nosource/metadata.yaml new file mode 100644 index 00000000..b036a566 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_nosource/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_nosnr_noprops_nosource/motors_nosnr_noprops_nosource_0.db3 + duration: + nanoseconds: 37002525685 + starting_time: + nanoseconds_since_epoch: 1600353917851188065 + message_count: 180 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 180 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_nosource/motors_nosnr_noprops_nosource_0.db3 b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_nosource/motors_nosnr_noprops_nosource_0.db3 new file mode 100644 index 00000000..59b26cad Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_nosource/motors_nosnr_noprops_nosource_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source/metadata.yaml new file mode 100644 index 00000000..62b087ca --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_snr_noprops_source/motors_snr_noprops_source_0.db3 + duration: + nanoseconds: 35159385140 + starting_time: + nanoseconds_since_epoch: 1600353226810441373 + message_count: 223 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 223 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source/motors_snr_noprops_source_0.db3 b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source/motors_snr_noprops_source_0.db3 new file mode 100644 index 00000000..0940ac8a Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source/motors_snr_noprops_source_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_20/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_20/metadata.yaml new file mode 100644 index 00000000..78ed3bc5 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_20/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_nosnr_noprops_source_20/motors_nosnr_noprops_source_20_0.db3 + duration: + nanoseconds: 35723698190 + starting_time: + nanoseconds_since_epoch: 1600354781657743567 + message_count: 216 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 216 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_20/motors_nosnr_noprops_source_20_0.db3 b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_20/motors_nosnr_noprops_source_20_0.db3 new file mode 100644 index 00000000..4d61a247 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_20/motors_nosnr_noprops_source_20_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_45/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_45/metadata.yaml new file mode 100644 index 00000000..525f3398 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_45/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_nosnr_noprops_source_45/motors_nosnr_noprops_source_45_0.db3 + duration: + nanoseconds: 35381351396 + starting_time: + nanoseconds_since_epoch: 1600356449113685952 + message_count: 172 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 172 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_45/motors_nosnr_noprops_source_45_0.db3 b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_45/motors_nosnr_noprops_source_45_0.db3 new file mode 100644 index 00000000..3f3b2cad Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_nosnr_noprops_source_45/motors_nosnr_noprops_source_45_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_props_source_45/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_nosnr_props_source_45/metadata.yaml new file mode 100644 index 00000000..f6b10660 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_nosnr_props_source_45/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_nosnr_props_source_45/motors_nosnr_props_source_45_0.db3 + duration: + nanoseconds: 35852075879 + starting_time: + nanoseconds_since_epoch: 1600356605916537822 + message_count: 238 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 238 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_nosnr_props_source_45/motors_nosnr_props_source_45_0.db3 b/experiments/2020_09_17_white-noise-static/motors_nosnr_props_source_45/motors_nosnr_props_source_45_0.db3 new file mode 100644 index 00000000..386d64c9 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_nosnr_props_source_45/motors_nosnr_props_source_45_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source/metadata.yaml new file mode 100644 index 00000000..da8f524e --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_snr_noprops_source/motors_snr_noprops_source_0.db3 + duration: + nanoseconds: 36782337817 + starting_time: + nanoseconds_since_epoch: 1600353564400653178 + message_count: 232 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 232 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source/motors_snr_noprops_source_0.db3 b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source/motors_snr_noprops_source_0.db3 new file mode 100644 index 00000000..73c7b7a1 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source/motors_snr_noprops_source_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20/metadata.yaml new file mode 100644 index 00000000..f51702eb --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_snr_noprops_source_20/motors_snr_noprops_source_20_0.db3 + duration: + nanoseconds: 35231138672 + starting_time: + nanoseconds_since_epoch: 1600355443738216240 + message_count: 198 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 198 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20/motors_snr_noprops_source_20_0.db3 b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20/motors_snr_noprops_source_20_0.db3 new file mode 100644 index 00000000..e434dd2f Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20/motors_snr_noprops_source_20_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20_crash/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20_crash/metadata.yaml new file mode 100644 index 00000000..81f58666 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20_crash/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_snr_noprops_source_20/motors_snr_noprops_source_20_0.db3 + duration: + nanoseconds: 28516887555 + starting_time: + nanoseconds_since_epoch: 1600355214731626029 + message_count: 179 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 179 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20_crash/motors_snr_noprops_source_20_0.db3 b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20_crash/motors_snr_noprops_source_20_0.db3 new file mode 100644 index 00000000..0b27296e Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_20_crash/motors_snr_noprops_source_20_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_45/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_45/metadata.yaml new file mode 100644 index 00000000..11115678 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_45/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_snr_noprops_source_45/motors_snr_noprops_source_45_0.db3 + duration: + nanoseconds: 36007972496 + starting_time: + nanoseconds_since_epoch: 1600356694455455056 + message_count: 210 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 210 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_45/motors_snr_noprops_source_45_0.db3 b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_45/motors_snr_noprops_source_45_0.db3 new file mode 100644 index 00000000..9c4581bc Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_snr_noprops_source_45/motors_snr_noprops_source_45_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_props_source/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_snr_props_source/metadata.yaml new file mode 100644 index 00000000..0330b8ec --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_snr_props_source/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_snr_props_source/motors_snr_props_source_0.db3 + duration: + nanoseconds: 36231520769 + starting_time: + nanoseconds_since_epoch: 1600353693851824270 + message_count: 225 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 225 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_props_source/motors_snr_props_source_0.db3 b/experiments/2020_09_17_white-noise-static/motors_snr_props_source/motors_snr_props_source_0.db3 new file mode 100644 index 00000000..35b9d846 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_snr_props_source/motors_snr_props_source_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_props_source_20/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_snr_props_source_20/metadata.yaml new file mode 100644 index 00000000..0b337b17 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_snr_props_source_20/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_snr_props_source_20/motors_snr_props_source_20_0.db3 + duration: + nanoseconds: 35774104810 + starting_time: + nanoseconds_since_epoch: 1600355573350771152 + message_count: 209 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 209 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_props_source_20/motors_snr_props_source_20_0.db3 b/experiments/2020_09_17_white-noise-static/motors_snr_props_source_20/motors_snr_props_source_20_0.db3 new file mode 100644 index 00000000..cd3aeb3c Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_snr_props_source_20/motors_snr_props_source_20_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_props_source_45/metadata.yaml b/experiments/2020_09_17_white-noise-static/motors_snr_props_source_45/metadata.yaml new file mode 100644 index 00000000..49a68942 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/motors_snr_props_source_45/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - motors_snr_props_source_45/motors_snr_props_source_45_0.db3 + duration: + nanoseconds: 35988325421 + starting_time: + nanoseconds_since_epoch: 1600356799864266037 + message_count: 219 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 219 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/motors_snr_props_source_45/motors_snr_props_source_45_0.db3 b/experiments/2020_09_17_white-noise-static/motors_snr_props_source_45/motors_snr_props_source_45_0.db3 new file mode 100644 index 00000000..98b04aa7 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/motors_snr_props_source_45/motors_snr_props_source_45_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source/metadata.yaml b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source/metadata.yaml new file mode 100644 index 00000000..32595872 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - nomotors_nosnr_noprops_source/nomotors_nosnr_noprops_source_0.db3 + duration: + nanoseconds: 36598784313 + starting_time: + nanoseconds_since_epoch: 1600353008929676515 + message_count: 250 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 250 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source/nomotors_nosnr_noprops_source_0.db3 b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source/nomotors_nosnr_noprops_source_0.db3 new file mode 100644 index 00000000..91efeec0 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source/nomotors_nosnr_noprops_source_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_20/metadata.yaml b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_20/metadata.yaml new file mode 100644 index 00000000..e345e860 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_20/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - nomotors_nosnr_noprops_source_20/nomotors_nosnr_noprops_source_20_0.db3 + duration: + nanoseconds: 35458771661 + starting_time: + nanoseconds_since_epoch: 1600354371108241605 + message_count: 191 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 191 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_20/nomotors_nosnr_noprops_source_20_0.db3 b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_20/nomotors_nosnr_noprops_source_20_0.db3 new file mode 100644 index 00000000..e8534f3f Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_20/nomotors_nosnr_noprops_source_20_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45/metadata.yaml b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45/metadata.yaml new file mode 100644 index 00000000..2a777984 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - nomotors_nosnr_noprops_source_45/nomotors_nosnr_noprops_source_45_0.db3 + duration: + nanoseconds: 33755884745 + starting_time: + nanoseconds_since_epoch: 1600356259171666431 + message_count: 193 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 193 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45/nomotors_nosnr_noprops_source_45_0.db3 b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45/nomotors_nosnr_noprops_source_45_0.db3 new file mode 100644 index 00000000..403303fd Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45/nomotors_nosnr_noprops_source_45_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45_bkp/metadata.yaml b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45_bkp/metadata.yaml new file mode 100644 index 00000000..7b3b1525 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45_bkp/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - nomotors_nosnr_noprops_source_45/nomotors_nosnr_noprops_source_45_0.db3 + duration: + nanoseconds: 35306097259 + starting_time: + nanoseconds_since_epoch: 1600356064487444839 + message_count: 239 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 239 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45_bkp/nomotors_nosnr_noprops_source_45_0.db3 b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45_bkp/nomotors_nosnr_noprops_source_45_0.db3 new file mode 100644 index 00000000..60eccec1 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/nomotors_nosnr_noprops_source_45_bkp/nomotors_nosnr_noprops_source_45_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source/metadata.yaml b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source/metadata.yaml new file mode 100644 index 00000000..1a9af76a --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - nomotors_snr_noprops_source/nomotors_snr_noprops_source_0.db3 + duration: + nanoseconds: 36795948293 + starting_time: + nanoseconds_since_epoch: 1600353083404690124 + message_count: 228 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 228 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source/nomotors_snr_noprops_source_0.db3 b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source/nomotors_snr_noprops_source_0.db3 new file mode 100644 index 00000000..2ef429e1 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source/nomotors_snr_noprops_source_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_20/metadata.yaml b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_20/metadata.yaml new file mode 100644 index 00000000..a08aaeb3 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_20/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - nomotors_snr_noprops_source_20/nomotors_snr_noprops_source_20_0.db3 + duration: + nanoseconds: 33353073916 + starting_time: + nanoseconds_since_epoch: 1600354592714115758 + message_count: 201 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 201 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_20/nomotors_snr_noprops_source_20_0.db3 b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_20/nomotors_snr_noprops_source_20_0.db3 new file mode 100644 index 00000000..ff249985 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_20/nomotors_snr_noprops_source_20_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_45/metadata.yaml b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_45/metadata.yaml new file mode 100644 index 00000000..8d36ca38 --- /dev/null +++ b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_45/metadata.yaml @@ -0,0 +1,16 @@ +rosbag2_bagfile_information: + version: 2 + storage_identifier: sqlite3 + relative_file_paths: + - nomotors_snr_noprops_source_45/nomotors_snr_noprops_source_45_0.db3 + duration: + nanoseconds: 35313576138 + starting_time: + nanoseconds_since_epoch: 1600356360880813347 + message_count: 227 + topics_with_message_count: + - topic_metadata: + name: /audio/signals_f + type: audio_interfaces/msg/SignalsFreq + serialization_format: cdr + message_count: 227 \ No newline at end of file diff --git a/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_45/nomotors_snr_noprops_source_45_0.db3 b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_45/nomotors_snr_noprops_source_45_0.db3 new file mode 100644 index 00000000..dea8287f Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/nomotors_snr_noprops_source_45/nomotors_snr_noprops_source_45_0.db3 differ diff --git a/experiments/2020_09_17_white-noise-static/photos/DSC_1030.jpg b/experiments/2020_09_17_white-noise-static/photos/DSC_1030.jpg new file mode 100644 index 00000000..6595b1cd Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/photos/DSC_1030.jpg differ diff --git a/experiments/2020_09_17_white-noise-static/photos/DSC_1031.jpg b/experiments/2020_09_17_white-noise-static/photos/DSC_1031.jpg new file mode 100644 index 00000000..e4944cd9 Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/photos/DSC_1031.jpg differ diff --git a/experiments/2020_09_17_white-noise-static/photos/DSC_1032.jpg b/experiments/2020_09_17_white-noise-static/photos/DSC_1032.jpg new file mode 100644 index 00000000..f3b4bf2f Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/photos/DSC_1032.jpg differ diff --git a/experiments/2020_09_17_white-noise-static/photos/DSC_1033.jpg b/experiments/2020_09_17_white-noise-static/photos/DSC_1033.jpg new file mode 100644 index 00000000..688c5f1e Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/photos/DSC_1033.jpg differ diff --git a/experiments/2020_09_17_white-noise-static/photos/DSC_1034.jpg b/experiments/2020_09_17_white-noise-static/photos/DSC_1034.jpg new file mode 100644 index 00000000..702dd2be Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/photos/DSC_1034.jpg differ diff --git a/experiments/2020_09_17_white-noise-static/photos/DSC_1035.jpg b/experiments/2020_09_17_white-noise-static/photos/DSC_1035.jpg new file mode 100644 index 00000000..038c893e Binary files /dev/null and b/experiments/2020_09_17_white-noise-static/photos/DSC_1035.jpg differ diff --git a/experiments/PROTOCOL_TEMPLATE.md b/experiments/PROTOCOL_TEMPLATE.md new file mode 100644 index 00000000..35691620 --- /dev/null +++ b/experiments/PROTOCOL_TEMPLATE.md @@ -0,0 +1,53 @@ + +# EXPERIMENT NAME + +__Time__: Day DD.MM.YYYY + +__Recorded by__: First Last, ... + +__Place__: Place, if necessary temperature etc. + +## Description + +### Hardware + + +### Software + + +### Protocol + + +### Data + + +- ``: +- ``: + +### Observations + diff --git a/src/audio_stack/audio_stack/spectrum_estimator.py b/src/audio_stack/audio_stack/spectrum_estimator.py index 4a1eaa9c..bb8bb954 100644 --- a/src/audio_stack/audio_stack/spectrum_estimator.py +++ b/src/audio_stack/audio_stack/spectrum_estimator.py @@ -27,7 +27,7 @@ # Beamforming method, available: # - "das": delay-and-sum -# - "mvdr": minimum-variacne distortionless response +# - "mvdr": minimum-variance distortionless response BF_METHOD = "das" NORMALIZE = "zero_to_one_all" @@ -38,12 +38,15 @@ def normalize_rows(matrix, method="zero_to_one"): if method == "zero_to_one": normalized = (matrix - np.min(matrix, axis=1, keepdims=True)) / (np.max(matrix, axis=1, keepdims=True) - np.min(matrix, axis=1, keepdims=True)) - #assert np.max(normalized) == 1.0 - #assert np.min(normalized) == 0.0 + np.testing.assert_allclose(np.max(normalized, axis=1), 1) + np.testing.assert_allclose(np.min(normalized, axis=1), 0) elif method == "zero_to_one_all": - normalized = (matrix - np.min(matrix)) / (np.max(matrix) - np.min(matrix)) - #assert np.max(normalized) == 1.0 - #assert np.min(normalized) == 0.0 + denom = np.max(matrix) - np.min(matrix) + if denom == 0.0: + return matrix + normalized = (matrix - np.min(matrix)) / denom + assert np.max(normalized) == 1, np.max(normalized) + assert np.min(normalized) == 0, np.min(normalized) elif method == "sum_to_one": # first make sure values are between 0 and 1 (otherwise division can lead to errors) denom = np.max(matrix, axis=1, keepdims=True) - np.min(matrix, axis=1, keepdims=True) @@ -53,6 +56,9 @@ def normalize_rows(matrix, method="zero_to_one"): np.testing.assert_allclose(np.sum(normalized, axis=1), 1.0, rtol=1e-5) else: raise ValueError(method) + + if np.any(np.isnan(normalized)): + print("Warning: problem in normalization") return normalized diff --git a/src/crazyflie_crtp/crazyflie_crtp/gateway.py b/src/crazyflie_crtp/crazyflie_crtp/gateway.py index 90e90e41..7b6b555a 100644 --- a/src/crazyflie_crtp/crazyflie_crtp/gateway.py +++ b/src/crazyflie_crtp/crazyflie_crtp/gateway.py @@ -31,17 +31,26 @@ N = 1024 # Crazyflie audio parameters that can be set from here. -PARAMETERS_TUPLES = [ +AUDIO_PARAMETERS_TUPLES = [ ("debug", rclpy.Parameter.Type.INTEGER, 0), ("send_audio_enable", rclpy.Parameter.Type.INTEGER, 1), - ("min_freq", rclpy.Parameter.Type.INTEGER, 100), - ("max_freq", rclpy.Parameter.Type.INTEGER, 10000), - ("delta_freq", rclpy.Parameter.Type.INTEGER, 100), - ("n_average", rclpy.Parameter.Type.INTEGER, 1), + ("min_freq", rclpy.Parameter.Type.INTEGER, 200), + ("max_freq", rclpy.Parameter.Type.INTEGER, 7000), + ("delta_freq", rclpy.Parameter.Type.INTEGER, 40), + ("n_average", rclpy.Parameter.Type.INTEGER, 5), ("filter_snr_enable", rclpy.Parameter.Type.INTEGER, 0), ("filter_prop_enable", rclpy.Parameter.Type.INTEGER, 0), ] +MOTOR_PARAMETERS_TUPLES = [ + ("all", rclpy.Parameter.Type.INTEGER, 0), + ("m1", rclpy.Parameter.Type.INTEGER, 0), + ("m2", rclpy.Parameter.Type.INTEGER, 0), + ("m3", rclpy.Parameter.Type.INTEGER, 0), + ("m4", rclpy.Parameter.Type.INTEGER, 0), + ("enable", rclpy.Parameter.Type.INTEGER, 0), +] + class Gateway(Node): def __init__(self, reader_crtp, mic_positions=None): @@ -64,11 +73,18 @@ def __init__(self, reader_crtp, mic_positions=None): self.reader_crtp = reader_crtp parameters = [] - for param in PARAMETERS_TUPLES: + + for param in AUDIO_PARAMETERS_TUPLES: self.declare_parameter(param[0]) param_rclpy = rclpy.parameter.Parameter(*param) parameters.append(param_rclpy) - self.set_parameters_callback(self.set_audio_params) + + for param in MOTOR_PARAMETERS_TUPLES: + self.declare_parameter(param[0]) + param_rclpy = rclpy.parameter.Parameter(*param) + parameters.append(param_rclpy) + + self.set_parameters_callback(self.set_params) self.set_parameters(parameters) # choose high publish rate so that we introduce as little @@ -108,10 +124,14 @@ def publish_audio_dict(self): all_frequencies = np.fft.rfftfreq(n=N, d=1/FS) #frequencies = all_frequencies[:n_frequencies] try: + assert np.any(fbins>0) + if len(set(fbins)) < len(fbins): + #self.get_logger().warn(f"Duplicate values in fbins! unique values:{len(set(fbins))}") + return frequencies = all_frequencies[fbins] self.get_logger().info(f"Read fbins: {fbins}") except: - self.get_logger().warn(f"Ignoring fbins: {fbins}") + #self.get_logger().warn(f"Ignoring fbins: {fbins[:5]}") return signals_f = np.zeros((N_MICS, n_frequencies), dtype=np.complex128) @@ -119,6 +139,11 @@ def publish_audio_dict(self): signals_f[i].real = signals_f_vect[i :: N_MICS * 2] signals_f[i].imag = signals_f_vect[i + N_MICS :: N_MICS * 2] + abs_signals_f = np.abs(signals_f) + if np.any(abs_signals_f[:3, :] > 1e5) or np.any(abs_signals_f[:3, :] < 1e-10): + #self.get_logger().warn(f"Ignoring audio: {abs_signals_f.flatten()[:5]}") + return + # send data msg = SignalsFreq() msg.frequencies = [int(f) for f in frequencies] @@ -134,7 +159,7 @@ def publish_audio_dict(self): msg.mic_positions = [] self.publisher_signals.publish(msg) - self.get_logger().info(f"Published audio data.") + self.get_logger().info(f"{msg.timestamp}: Published audio data with fbins {fbins[[0, 1, 2, -1]]}") def publish_motion_dict(self): motion_dict = self.reader_crtp.motion_dict["data"] @@ -170,30 +195,53 @@ def publish_motion_dict(self): self.prev_position_x = msg_pose.position.x self.prev_position_y = msg_pose.position.y - self.get_logger().info("Published motion data.") - - def set_audio_params(self, params): - for param in params: - param_tuples = [p for p in PARAMETERS_TUPLES if p[0] == param.name] - assert len(param_tuples) == 1 - if param_tuples[0][1] == rclpy.Parameter.Type.INTEGER: - old_value = ( - self.get_parameter(param.name).get_parameter_value().integer_value - ) - new_value = param.get_parameter_value().integer_value - elif param_tuples[0][1] == rclpy.Parameter.Type.DOUBLE: - old_value = ( - self.get_parameter(param.name).get_parameter_value().double_value - ) - new_value = param.get_parameter_value().double_value + self.get_logger().info(f"{msg_pose_raw.timestamp}: Published motion data.") + + def set_params(self, params): + for param in params: + param_tuples_audio = [p for p in AUDIO_PARAMETERS_TUPLES if p[0] == param.name] + param_tuples_motor = [p for p in MOTOR_PARAMETERS_TUPLES if p[0] == param.name] + + if len(param_tuples_audio) == 1: + self.set_param(param, param_tuples_audio[0], "audio") + elif len(param_tuples_motor) == 1: + # TODO(FD) find more elegant way to do this + #for motor in [f"m{i}" for i in range(1, 5)]: + # param = self.get_parameter(motor) + value = param.get_parameter_value().integer_value + if param.name == "all": + [self.reader_crtp.cf.param.set_value(f"motorPowerSet.m{i}", value) for i in range(1, 5)] + self.get_logger().info( f"changing all motors to {value}") + else: + self.reader_crtp.cf.param.set_value(f"motorPowerSet.{param.name}", value) + self.get_logger().info(f"changing {param.name} to {value}") + if value > 0: + print("changing motorPowerSet.enable to 1") + self.reader_crtp.cf.param.set_value("motorPowerSet.enable", 1) else: - raise ValueError(param_tuple) + raise ValueError(param) + return SetParametersResult(successful=True) - self.reader_crtp.cf.param.set_value(f"audio.{param.name}", new_value) - self.get_logger().info( - f"changing {param.name} from {old_value} to {new_value}" + def set_param(self, param, param_tuple, param_class): + if param_tuple[1] == rclpy.Parameter.Type.INTEGER: + old_value = ( + self.get_parameter(param.name).get_parameter_value().integer_value ) - return SetParametersResult(successful=True) + new_value = param.get_parameter_value().integer_value + elif param_tuple[1] == rclpy.Parameter.Type.DOUBLE: + old_value = ( + self.get_parameter(param.name).get_parameter_value().double_value + ) + new_value = param.get_parameter_value().double_value + else: + raise ValueError(param_tuple) + + self.reader_crtp.cf.param.set_value(f"{param_class}.{param.name}", new_value) + self.get_logger().info( + f"changing {param.name} from {old_value} to {new_value}" + ) + return + def main(args=None): @@ -222,8 +270,10 @@ def main(args=None): while True: time.sleep(1) except KeyboardInterrupt: - print("unset audio.send_audio_enable") cf.param.set_value("audio.send_audio_enable", 0) + cf.param.set_value("motorPowerSet.enable", 0) + print("reset audio.send_audio_enable and motorPowerSet.enable, wait for 1s...") + time.sleep(1) publisher.destroy_node() rclpy.shutdown() diff --git a/src/topic_plotter/topic_plotter/audio.py b/src/topic_plotter/topic_plotter/audio.py index 7346c06f..b53592fa 100644 --- a/src/topic_plotter/topic_plotter/audio.py +++ b/src/topic_plotter/topic_plotter/audio.py @@ -72,7 +72,7 @@ def listener_callback_spectrum(self, msg_spec, name="static", eps=YLIM_MIN): # compute and plot combinations. spectrum_sum = combine_rows(spectrum, "sum", keepdims=True) spectrum_sum = normalize_rows(spectrum_sum, NORMALIZE) - spectrum_product = combine_rows(spectrum, "product", keepdims=True) + spectrum_product = combine_rows(spectrum + 1e-1, "product", keepdims=True) spectrum_product = normalize_rows(spectrum_product, NORMALIZE) spectrum_plot = np.r_[spectrum_product, spectrum_sum]