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

Commonisation of serializers and publishers. #148

Open
wants to merge 64 commits into
base: develop
Choose a base branch
from

Conversation

Autumn60
Copy link
Contributor

@Autumn60 Autumn60 commented Feb 18, 2024

Notice: This PR is less backward compatible.

Before merging, [master_2.x.x] branch must be created from the current [master] branch.

en

Commonisation of serializers and publishers

All "Sensor" classes, except a few such as TF, now have interface to the data provided by each sensor.
"Serializer" classes and "Publisher" classes are now dependent on the interface of the corresponding data, not the "Sensor" classes.

This change allows "Sensor"s that provide common data to send data with a common "Serializer" and "Publisher" scripts.
Also, scripts that are not "Sensor" can now be used as data sources from Serializer and Publisher if they have a corresponding interface.

PointCloud2 data serialisation method change

Change from a method using JobSystem to a method using memory copy.

RGBDCamera

RGBD camera with PointXYZRGB point cloud output implemented.

jp

SerializerPublisherの共通化

TFなどの一部を除くすべての "Sensor "クラスは、各センサーが提供するデータへのインターフェイスを持つようになりました。
「Serializer "クラスと "Publisher "クラスは、"Sensor "クラスではなく、対応するデータのインターフェースに依存するようになりました。

この変更により、共通のデータを提供する "Sensor "は、共通の "Serializer "と "Publisher "スクリプトでデータを送信できるようになりました。
また、"Sensor "ではないスクリプトでも、対応するインターフェイスがあれば、"Serializer "や "Publisher "のデータソースとして使用できるようになりました。

PointCloud2データのmsg化方法の変更

JobSystemを用いる方法から、メモリコピーを用いる方法に変更しました。
ROS->Unityの座標変換は、PointCloud2のPointFieldの順番を入れ替えることと、JobSystemを用いてx軸(ROSではy軸)を入れ替えることで実現しました。
可読性が酷いことになっていますが、
各点の4 byte 目に128を足す = 各点の1つ目の4 byte型(float)の1 bit 目を反転させる = 各点のxの値を反転させる
処理をしています。

RGBDカメラ復活

実装を見直したことで、RGBDカメラが再び実装されました。

@Autumn60 Autumn60 added the enhancement New feature or request label Feb 18, 2024
@Autumn60 Autumn60 changed the title Feature/common publisher Common serializers and publishers Feb 20, 2024
@Autumn60 Autumn60 changed the title Common serializers and publishers Commonisation of serializers and publishers. Feb 20, 2024
@Autumn60 Autumn60 marked this pull request as ready for review February 20, 2024 05:57
@Autumn60 Autumn60 marked this pull request as draft February 20, 2024 08:28
@Autumn60 Autumn60 marked this pull request as ready for review February 20, 2024 12:23
@RyodoTanaka
Copy link
Member

@Autumn60
Thank you for your PR.
To check this PR merge, please tell us the list of confirmation for normal works.

@Autumn60
Copy link
Contributor Author

@RyodoTanaka
I will create an integrated demo scene to provide confirmation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants