this repo has no description
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Continue rapport

+67 -67
+1 -1
autopush.fish
··· 1 1 #!/usr/bin/env fish 2 - git reset --hard rapport/main.pdf 2 + git checkout -- rapport/main.pdf 3 3 git pull --rebase --autostash 4 4 while true 5 5 pdfinfo rapport/main.pdf | rg ^Pages: | awk '{print $2}' > pages_count
+1 -1
pages_count
··· 1 - 32 1 + 38
+65 -65
rapport/gz-unitree.typ
··· 10 10 11 11 Une première tentative a été de suivre la documentation de CycloneDDS pour écouter sur le canal @cyclonedds-helloworld `rt/lowcmd`, en récupérant les définitions IDL des messages, disponibles sur le dépot `unitree_ros2`#footnote[`unitree_mujoco` n'avait pas encore été découvert] @unitree_ros2 12 12 13 - On commence par importer la bibliothèque DDS et les définitions IDL de `rt/lowcmd` 14 - 15 - ```cpp 16 - #include "messages/LowCmd_.hpp" 17 - #include "dds/dds.h" 18 - ... 19 - 20 - int main (int argc, char ** argv) 21 - { 22 - ``` 23 - 24 - On initialise les différents objets permettant de lire sur un canal 25 - 26 - ```cpp 27 - dds_entity_t participant, topic, reader; 28 - LowCmd_ *msg; 29 - void *samples[MAX_SAMPLES]; 30 - ... 31 - 32 - participant = dds_create_participant(DDS_DOMAIN_DEFAULT, NULL, NULL); 33 - 34 - topic = dds_create_topic(participant, &LowCmd__desc, "HelloWorldData_Msg", NULL, NULL); 35 - 36 - qos = dds_create_qos(); 37 - dds_qset_reliability(qos, DDS_RELIABILITY_RELIABLE, DDS_SECS (10)); 38 - 39 - reader = dds_create_reader(participant, topic, qos, NULL); 40 - 41 - dds_delete_qos(qos); 42 - 43 - samples[0] = LowCmd___alloc(); 44 - ``` 45 - 46 - Et on attend qu'un message arrive sur le canal, pour l'afficher 47 - 48 - ```cpp 49 - /* Poll until data has been read. */ 50 - while (true) 51 - { 52 - rc = dds_read(reader, samples, infos, MAX_SAMPLES, MAX_SAMPLES); 53 - 54 - /* Check if we read some data and it is valid. */ 55 - if ((rc > 0) && (infos[0].valid_data)) 56 - { 57 - /* Print Message. */ 58 - msg = (LowCmd_*) samples[0]; 59 - printf("=== [Subscriber] Received : "); 60 - fflush(stdout); 61 - break; 62 - } 63 - else 64 - { 65 - dds_sleepfor(DDS_MSECS(20)); 66 - } 67 - } 68 - ``` 69 - 70 - Enfin, on libère les ressources avant la terminaison du programme 71 - 72 - ```cpp 73 - LowCmd__free(samples[0], DDS_FREE_ALL); 74 - dds_delete(participant); 75 - return EXIT_SUCCESS; 76 - } 77 - ``` 13 + // On commence par importer la bibliothèque DDS et les définitions IDL de `rt/lowcmd` 14 + // 15 + // ```cpp 16 + // #include "messages/LowCmd_.hpp" 17 + // #include "dds/dds.h" 18 + // ... 19 + // 20 + // int main (int argc, char ** argv) 21 + // { 22 + // ``` 23 + // 24 + // On initialise les différents objets permettant de lire sur un canal 25 + // 26 + // ```cpp 27 + // dds_entity_t participant, topic, reader; 28 + // LowCmd_ *msg; 29 + // void *samples[MAX_SAMPLES]; 30 + // ... 31 + // 32 + // participant = dds_create_participant(DDS_DOMAIN_DEFAULT, NULL, NULL); 33 + // 34 + // topic = dds_create_topic(participant, &LowCmd__desc, "HelloWorldData_Msg", NULL, NULL); 35 + // 36 + // qos = dds_create_qos(); 37 + // dds_qset_reliability(qos, DDS_RELIABILITY_RELIABLE, DDS_SECS (10)); 38 + // 39 + // reader = dds_create_reader(participant, topic, qos, NULL); 40 + // 41 + // dds_delete_qos(qos); 42 + // 43 + // samples[0] = LowCmd___alloc(); 44 + // ``` 45 + // 46 + // Et on attend qu'un message arrive sur le canal, pour l'afficher 47 + // 48 + // ```cpp 49 + // /* Poll until data has been read. */ 50 + // while (true) 51 + // { 52 + // rc = dds_read(reader, samples, infos, MAX_SAMPLES, MAX_SAMPLES); 53 + // 54 + // /* Check if we read some data and it is valid. */ 55 + // if ((rc > 0) && (infos[0].valid_data)) 56 + // { 57 + // /* Print Message. */ 58 + // msg = (LowCmd_*) samples[0]; 59 + // printf("=== [Subscriber] Received : "); 60 + // fflush(stdout); 61 + // break; 62 + // } 63 + // else 64 + // { 65 + // dds_sleepfor(DDS_MSECS(20)); 66 + // } 67 + // } 68 + // ``` 69 + // 70 + // Enfin, on libère les ressources avant la terminaison du programme 71 + // 72 + // ```cpp 73 + // LowCmd__free(samples[0], DDS_FREE_ALL); 74 + // dds_delete(participant); 75 + // return EXIT_SUCCESS; 76 + // } 77 + // ``` 78 78 79 79 Malheureusement, cette solution s'est avérée infructueuse, à cause de (ce qui sera compris bien plus tard) un problème de numéro de domaine DDS. 80 80