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

Hotfix/tf msg serizlier #133

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Assets/UnitySensors/Runtime/Scripts/Sensors/TF/TF.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ public TFData[] GetTFData(string frame_id_parent, Matrix4x4 worldToLocalMatrix,
TFData tfData_self;
tfData_self.frame_id_parent = frame_id_parent;
tfData_self.frame_id_child = _frame_id;
tfData_self.position = worldToLocalMatrix * _transform.position;
tfData_self.position = (Vector3)(worldToLocalMatrix * new Vector4(_transform.position.x, _transform.position.y, _transform.position.z, 1.0f));
tfData_self.rotation = worldToLocalQuaternion * _transform.rotation;
tfData.Add(tfData_self);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,43 +46,4 @@ public override TFMessageMsg Serialize()
return _msg;
}
}
/*
[System.Serializable]
public class TFSerializer : Serializer
{

[SerializeField]
private TFMessageMsg _msg;

private AutoHeader _header;

public TFMessageMsg msg { get => _msg; }

public void Init()
{
_msg = new TFMessageMsg();
_header = new AutoHeader();

_header.Init("");
}

public TFMessageMsg Serialize(float time, TFData[] tf)
{
_header.Serialize(time);
List<TransformStampedMsg> transforms = new List<TransformStampedMsg>();
foreach(TFData tfData in tf)
{
TransformStampedMsg transform = new TransformStampedMsg();
transform.header = _header.header;
transform.header.frame_id = tfData.frame_id_parent;
transform.child_frame_id = tfData.frame_id_child;
transform.transform.translation = tfData.position.To<FLU>();
transform.transform.rotation = tfData.rotation.To<FLU>();
transforms.Add(transform);
}
_msg.transforms = transforms.ToArray();
return _msg;
}
}
*/
}
Loading