Sep 22, 2020
07:43 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 22, 2020
07:43 AM
Hi,
I have recently purchased two Demo Position2Go boards. I want to retrieve processed data (range, velocity, angle) from both of the radar devices simultaneously--i.e., at each time instant I want to obtain the target data reported by radar 1 followed by radar 2. I am using C interface of the Radar Host Communication library.
I modified the example file given (extract_raw_data.c) to get the processed target info instead of the raw ADC data and it works for one device.
However, when two of the radar devices are connected to two USB ports, even after registering two callbacks and providing the appropriate protocol handle and endpoint for each radar, only the data from first radar device is recorded. i.e., the same data (from radar 1) is repeated for the call to ep_targetdetect_get_targets() function with protocol handle and endpoint for radar device 2.
Could you kindly help me with this, pls.?
Thanks,
Dory.
I have recently purchased two Demo Position2Go boards. I want to retrieve processed data (range, velocity, angle) from both of the radar devices simultaneously--i.e., at each time instant I want to obtain the target data reported by radar 1 followed by radar 2. I am using C interface of the Radar Host Communication library.
I modified the example file given (extract_raw_data.c) to get the processed target info instead of the raw ADC data and it works for one device.
However, when two of the radar devices are connected to two USB ports, even after registering two callbacks and providing the appropriate protocol handle and endpoint for each radar, only the data from first radar device is recorded. i.e., the same data (from radar 1) is repeated for the call to ep_targetdetect_get_targets() function with protocol handle and endpoint for radar device 2.
Could you kindly help me with this, pls.?
Thanks,
Dory.
Solved! Go to Solution.
1 Solution
Sep 23, 2020
12:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 23, 2020
12:37 AM
Hello Dory,
Yes, it is possible to read two radar data streams at one time, but there are some pitfalls.
In general the ComLib is capable to handle multiple connections at the same time, that’s why the connection handle must always be specified in each function call.
You can easily start two P2G devices, and then call get_next_frame() alternatingly for both devices. Here devices are working simultaneously, but ComLib usage is not really simultaneously.
For both devices always the same callback function with the same context pointer is called, and must check the connection handle to find out what device sent the callback and route the data accordingly.
To be really simultaneous, both devices must be handled in different threads. That will become somewhat complicated, because ComLib is not thread safe.
It’s not possible to open different connections and register callbacks from different threads. If that setup part is kept in a common main thread, then fetching data from different threads should work.
If user wants to do the setup in different threads, than there is a need for some wrapper code around ComLib that handles locking.
Best Regards,
Montassar.
Yes, it is possible to read two radar data streams at one time, but there are some pitfalls.
In general the ComLib is capable to handle multiple connections at the same time, that’s why the connection handle must always be specified in each function call.
You can easily start two P2G devices, and then call get_next_frame() alternatingly for both devices. Here devices are working simultaneously, but ComLib usage is not really simultaneously.
For both devices always the same callback function with the same context pointer is called, and must check the connection handle to find out what device sent the callback and route the data accordingly.
To be really simultaneous, both devices must be handled in different threads. That will become somewhat complicated, because ComLib is not thread safe.
It’s not possible to open different connections and register callbacks from different threads. If that setup part is kept in a common main thread, then fetching data from different threads should work.
If user wants to do the setup in different threads, than there is a need for some wrapper code around ComLib that handles locking.
Best Regards,
Montassar.
2 Replies
Sep 23, 2020
12:37 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 23, 2020
12:37 AM
Hello Dory,
Yes, it is possible to read two radar data streams at one time, but there are some pitfalls.
In general the ComLib is capable to handle multiple connections at the same time, that’s why the connection handle must always be specified in each function call.
You can easily start two P2G devices, and then call get_next_frame() alternatingly for both devices. Here devices are working simultaneously, but ComLib usage is not really simultaneously.
For both devices always the same callback function with the same context pointer is called, and must check the connection handle to find out what device sent the callback and route the data accordingly.
To be really simultaneous, both devices must be handled in different threads. That will become somewhat complicated, because ComLib is not thread safe.
It’s not possible to open different connections and register callbacks from different threads. If that setup part is kept in a common main thread, then fetching data from different threads should work.
If user wants to do the setup in different threads, than there is a need for some wrapper code around ComLib that handles locking.
Best Regards,
Montassar.
Yes, it is possible to read two radar data streams at one time, but there are some pitfalls.
In general the ComLib is capable to handle multiple connections at the same time, that’s why the connection handle must always be specified in each function call.
You can easily start two P2G devices, and then call get_next_frame() alternatingly for both devices. Here devices are working simultaneously, but ComLib usage is not really simultaneously.
For both devices always the same callback function with the same context pointer is called, and must check the connection handle to find out what device sent the callback and route the data accordingly.
To be really simultaneous, both devices must be handled in different threads. That will become somewhat complicated, because ComLib is not thread safe.
It’s not possible to open different connections and register callbacks from different threads. If that setup part is kept in a common main thread, then fetching data from different threads should work.
If user wants to do the setup in different threads, than there is a need for some wrapper code around ComLib that handles locking.
Best Regards,
Montassar.
Dec 17, 2020
05:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dec 17, 2020
05:08 AM
Two data streams? What are the hardware requirements?