Skip to content

Instantly share code, notes, and snippets.

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