analogdevicesinc / ToF

MIT License
34 stars 24 forks source link

Fixed fps error when using open source #697

Closed liealex closed 3 months ago

dNechita commented 3 months ago

Can you please explain the fix? It's not straight forward. The commit message doesn't help either.

liealex commented 3 months ago

When using opensource, m_hostConnectionType has the value "USB". The if condition (https://github.com/analogdevicesinc/ToF/blob/rel-4.3.0/sdk/src/connections/target/adsd3500_sensor.cpp#L243) will not be satisfied and file descriptor will not be initialized.

When opensource is not used, m_hostConnectionType will have a random value "14622345" (here it is not initialized, hence the random value) and the if condition will be satisfied.

To solve those problems, I initialized m_hostConnectionType to "TARGET"

rbudai98 commented 3 months ago

The same bug was a problem for the ROS2 node as well, it was resolved here: https://github.com/analogdevicesinc/ToF/pull/498 It was merged after v4.3.0 release