Skip to content
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

Get/Set Transform Service Improvements #15

Merged

Conversation

allenh1
Copy link

@allenh1 allenh1 commented Aug 9, 2020

I changed the names of the transform setters to be set_sensor_to_vehicle_translation and set_sensor_to_vehicle_rotation so that both the direction and the specific component of the transform is made a bit more clear.

I also added a service that returns the full device-stored transform (both translational and rotational) in a way that they could be directly republished in a geometry_msgs::TransformStamped from a client node.

On that note, I attemped to use the getSensorToVehicleRotation_quaternion(), but this is apparenlty not supported by my device (3DM-GX5-45). This seems rather odd, since it appears to be stored as a quaternion internally. I can remove the tf2::convert and the setRPY calls in the get_sensor_to_vehicle_transform function if that command is supported, which would clean up this patch a bit (though this can be done in a follow up).

Tested with the following (run in succession):

$ rosservice call /gx5/set_sensor_to_vehicle_translation "offset:
  x: 1.0
  y: 0.0
  z: 0.0" 
success: True
$ rosservice call /gx5/set_sensor_to_vehicle_rotation "angle:
  x: 1.5707963
  y: 0.0
  z: 0.0"
success: True
$ rosservice call /gx5/get_sensor_to_vehicle_transform 
translation: 
  x: 1.0
  y: 0.0
  z: 0.0
rotation: 
  x: 0.7071067966408575
  y: 0.0
  z: 0.0
  w: 0.7071067657322372
success: True

Please let me know if you need any adjustments/style changes, I'm more than happy to do so.

Signed-off-by: Hunter L. Allen <hunter.allen@ghostrobotics.io>
…tter match their function

Signed-off-by: Hunter L. Allen <hunter.allen@ghostrobotics.io>
Signed-off-by: Hunter L. Allen <hunter.allen@ghostrobotics.io>
…rame

Signed-off-by: Hunter L. Allen <hunter.allen@ghostrobotics.io>
Signed-off-by: Hunter L. Allen <hunter.allen@ghostrobotics.io>
@rdslord rdslord merged commit ffc93ba into LORD-MicroStrain:master Aug 10, 2020
@allenh1 allenh1 deleted the get-set-transform-service-improvements branch August 10, 2020 15:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants