use orb_advertise_multi:

- subscribe to actuator controls after topic has been advertised
This commit is contained in:
tumbili
2015-06-08 19:41:54 +02:00
committed by Mark Charlebois
parent 065ec5b2dc
commit a5c214a7bb
2 changed files with 6 additions and 6 deletions
+3 -3
View File
@@ -310,9 +310,6 @@ void Simulator::updateSamples()
struct mag_report mag;
memset(&mag, 0 ,sizeof(mag));
// subscribe to topics
_actuator_outputs_sub = orb_subscribe(ORB_ID(actuator_outputs));
// try to setup udp socket for communcation with simulator
memset((char *)&_myaddr, 0, sizeof(_myaddr));
_myaddr.sin_family = AF_INET;
@@ -381,6 +378,9 @@ void Simulator::updateSamples()
send_controls();
}
// subscribe to topics
_actuator_outputs_sub = orb_subscribe_multi(ORB_ID(actuator_outputs), 0);
// got data from simulator, now activate the sending thread
pthread_create(&sender_thread, &sender_thread_attr, Simulator::sending_trampoline, NULL);
pthread_attr_destroy(&sender_thread_attr);