Skip to content

Instantly share code, notes, and snippets.

@MatthewSteel
Created April 17, 2020 16:26
Show Gist options
  • Save MatthewSteel/f61dd3b1739bfc4dca8310fa2ac03c0e to your computer and use it in GitHub Desktop.
Save MatthewSteel/f61dd3b1739bfc4dca8310fa2ac03c0e to your computer and use it in GitHub Desktop.
After #68
(function buildReader() {
var Record = function (reader) {
var length_transforms = reader.uint32();
this.transforms = new Array(length_transforms)
for (var i = 0; i < length_transforms; i++) {
this.transforms[i] = new Record.geometry_msgs_TransformStamped(reader);
}
};
Record.geometry_msgs_TransformStamped = function(reader) {
this.header = new Record.std_msgs_Header(reader);
this.child_frame_id = reader.string();
this.transform = new Record.geometry_msgs_Transform(reader);
};
Record.std_msgs_Header = function(reader) {
this.seq = reader.uint32();
this.stamp = reader.time();
this.frame_id = reader.string();
};
Record.geometry_msgs_Transform = function(reader) {
this.translation = new Record.geometry_msgs_Vector3(reader);
this.rotation = new Record.geometry_msgs_Quaternion(reader);
};
Record.geometry_msgs_Vector3 = function(reader) {
this.x = reader.float64();
this.y = reader.float64();
this.z = reader.float64();
};
Record.geometry_msgs_Quaternion = function(reader) {
this.x = reader.float64();
this.y = reader.float64();
this.z = reader.float64();
this.w = reader.float64();
};
return function read(reader) {
return new Record(reader);
}; })()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment