Hi,
I'm controlling a robot in asynchronous mode sending control commands in non-blocking fashion (opmode_onshot or opmode_streaming). At every timestep "t", I issue a control "a_t", how do I make sure that the sensor reading I obtain is the result of issuing "a_t" and not something that's buffered before time "t".
Thank you
Obtain sensor data after actuation in asynchronous mode
Re: Obtain sensor data after actuation in asynchronous mode
Hello,
if you need to make sure of that, then you need to run in synchronous mode. You'll maybe also have to set-up a signal that triggers when the sensing section has ended, so that your remote API client knows that the current simulation pass is done and the next can be triggered.
Cheers
if you need to make sure of that, then you need to run in synchronous mode. You'll maybe also have to set-up a signal that triggers when the sensing section has ended, so that your remote API client knows that the current simulation pass is done and the next can be triggered.
Cheers
Re: Obtain sensor data after actuation in asynchronous mode
Thanks for your response. I'm simulating what it's like running on the real robot and the actual robot runs sensing and actuating threads concurrently. Do you think it's sensible to timestamp every signal. For example, if control is running at 10hz and the first control a1 is sent out at time t = 0, then look for the sensor data near t = 0.1 (preferrably less than 0.1) as the result of running a1.
Re: Obtain sensor data after actuation in asynchronous mode
If you are running in open loop, simply feeding values to the simulation, then it gets simper: then you can as you say send values together with a time stamp (or send the whole data set at once). Then you can in each simulation step pick the value to corresponds to current time.
Cheers
Cheers