ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
I'll just post my code i am using for this since there isn't much to explain about it:
tf2::Quaternion myQuaternion; myQuaternion.setRPY(0,0,a); myQuaternion.normalize();
and you are done.
you then get the quaternion parts with e.g myQuaternion.x. ...
The normalize part is only in there since i had issues in the past with not normalized quaternions being rejected by some libraries so i just normalize everything. Hope this helps
2 | No.2 Revision |
I'll just post my code i am using for this since there isn't much to explain about it:
tf2::Quaternion myQuaternion;
myQuaternion.setRPY(0,0,a);
and you are done.
you then get the quaternion parts with e.g myQuaternion.x. ...
The normalize part is only in there since i had issues in the past with not normalized quaternions being rejected by some libraries so i just normalize everything. Hope this helps
EDIT: you need the following libraries: tf2/LinearMath/Quaternion.h
3 | No.3 Revision |
I'll just post my code i am using for this since there isn't much to explain about it:
tf2::Quaternion myQuaternion;
myQuaternion.setRPY(0,0,a);
myQuaternion.normalize();
and you are done.
you then get the quaternion parts with e.g myQuaternion.x. ...
The normalize part is only in there since i had issues in the past with not normalized quaternions being rejected by some libraries so i just normalize everything. Hope this helps
EDIT: you need the following libraries: tf2/LinearMath/Quaternion.h
and this is only for yaw, of course you can exchange the first two 0 with whatever you want
4 | No.4 Revision |
I'll just post my code i am using for this since there isn't much to explain about it:
tf2::Quaternion myQuaternion;
myQuaternion.setRPY(0,0,a);
myQuaternion.normalize();
and you are done.
you then get the quaternion parts with e.g myQuaternion.x. myQuaternion.getX() ...
The normalize part is only in there since i had issues in the past with not normalized quaternions being rejected by some libraries so i just normalize everything. Hope this helps
EDIT: you need the following libraries: tf2/LinearMath/Quaternion.h
and this is only for yaw, of course you can exchange the first two 0 with whatever you want
5 | No.5 Revision |
I'll just post my code i am using for this since there isn't much to explain about it:
tf2::Quaternion myQuaternion;
myQuaternion.setRPY(0,0,a);
myQuaternion.normalize();
and you are done.
you then get the quaternion parts with e.g myQuaternion.getX() ...
The normalize part is only in there since i had issues in the past with not normalized quaternions being rejected by some libraries so i just normalize everything.
everything. But this can be the reason, why your result looked different than the one from the online calculator.
Hope this helps
EDIT: you need the following libraries: tf2/LinearMath/Quaternion.h
and this is only for yaw, of course you can exchange the first two 0 with whatever you want
6 | No.6 Revision |
I'll just post my code i am using for this since there isn't much to explain about it:
tf2::Quaternion myQuaternion;
myQuaternion.setRPY(0,0,a);
myQuaternion.normalize();
myQuaternion=myQuaternion.normalize();
and you are done.
you then get the quaternion parts with e.g myQuaternion.getX() ...
The normalize part is only in there since i had issues in the past with not normalized quaternions being rejected by some libraries so i just normalize everything. But this can be the reason, why your result looked different than the one from the online calculator. Hope this helps
EDIT: you need the following libraries: tf2/LinearMath/Quaternion.h
and this is only for yaw, of course you can exchange the first two 0 with whatever you want
7 | No.7 Revision |
I'll just post my code i am using for this since there isn't much to explain about it:
tf2::Quaternion myQuaternion;
myQuaternion.setRPY(0,0,a);
myQuaternion.setRPY(r,p,y);
myQuaternion=myQuaternion.normalize();
and you are done.
you then get the quaternion parts with e.g myQuaternion.getX() ...
The normalize part is only in there since i had issues in the past with not normalized quaternions being rejected by some libraries so i just normalize everything. But this can be the reason, why your result looked different than the one from the online calculator. Hope this helps
EDIT: you need the following libraries: tf2/LinearMath/Quaternion.h
and this is only for yaw, of course you can exchange the first two 0 with whatever you want