-
Notifications
You must be signed in to change notification settings - Fork 17
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RSDK-4861 - C++/cgo support for Odometer #301
Conversation
// PATRICIA TODO: #242 | ||
// non first sensor | ||
{ | ||
viam_carto_lidar_reading sr; | ||
// must be they first sensor in the sensor list | ||
sr.lidar = bfromcstr("sensor_2"); | ||
std::string pcd = help::binary_pcd(points); | ||
sr.lidar_reading = blk2bstr(pcd.c_str(), pcd.length()); | ||
BOOST_TEST(sr.lidar_reading != nullptr); | ||
sr.lidar_reading_time_unix_milli = 1687900014152474; | ||
BOOST_TEST(viam_carto_add_lidar_reading(vc, &sr) == | ||
VIAM_CARTO_UNKNOWN_SENSOR_NAME); | ||
BOOST_TEST(viam_carto_add_lidar_reading_destroy(&sr) == | ||
VIAM_CARTO_SUCCESS); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a duplicate from the case above.
BOOST_TEST(pr.x == 0); | ||
BOOST_TEST(pr.y == 0); | ||
BOOST_TEST(pr.x != 0); | ||
BOOST_TEST(pr.y != 0); | ||
BOOST_TEST(pr.z == 0); | ||
BOOST_TEST(pr.imag == 0); | ||
BOOST_TEST(pr.jmag == 0); | ||
BOOST_TEST(pr.kmag == 0); | ||
BOOST_TEST(pr.real == 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was something wrong before since those values were supposed to have been non-zero. This might be connected to the fact that the IMU data had the same timestamps as the lidar data. Either way, this is fixed now with this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, great PR. a few minor comments but all logic looks good!
cartofacade/carto_facade.go
Outdated
@@ -15,7 +15,8 @@ import ( | |||
|
|||
var emptyRequestParams = map[RequestParamType]interface{}{} | |||
|
|||
// ErrUnableToAcquireLock is the error returned from AddLidarReading and/or AddIMUReading when lock can't be acquired. | |||
// ErrUnableToAcquireLock is the error returned from AddLidarReading and/or AddIMUReading |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
// ErrUnableToAcquireLock is the error returned from AddLidarReading and/or AddIMUReading | |
// ErrUnableToAcquireLock is the error returned from AddLidarReading, AddIMUReading, |
cartofacade/capi.go
Outdated
defer C.free(unsafe.Pointer(sensorCStr)) | ||
sr.odometer = C.blk2bstr(unsafe.Pointer(sensorCStr), C.int(len(movementSensor))) | ||
|
||
translation := spatialmath.GeoPointToPose(reading.Position, geo.NewPoint(0, 0)).Point() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this function is in latest anymore. But the logic in GeoPointToPoint is what you want.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Ticket: https://viam.atlassian.net/browse/RSDK-4861
Done:
Tested on Intel Mac: