RobotWebTools / rclnodejs

Node.js version of ROS 2.0 client
https://docs.ros.org/en/humble/Concepts/Basic/About-Client-Libraries.html?highlight=rclnodejs#community-maintained
Apache License 2.0
319 stars 70 forks source link

Support to publish serialized messages #703

Closed minggangw closed 3 years ago

minggangw commented 3 years ago

This patch implements the feature that a publisher can publish a raw message, and an example is added.

Fix #646

coveralls commented 3 years ago

Coverage Status

Coverage decreased (-0.04%) to 91.071% when pulling 98af5da782e307786598b17e060a8b37504094d5 on minggangw:fix-issue-646 into 768eab43167892bb45761458756b0a7156cfd8a4 on RobotWebTools:develop.

wayneparrott commented 3 years ago

Thx for the enhancement. I did a quick read thru of the code and it looks good to me. Qualifier: my C is a little rusty so will defer to other reviewers.

The Publisher#publish() method declaration in types/publisher.d.ts needs to be updated to support the new alternative Buffer parameter type, i.e., publisher(message: Message | Buffer) : void. Do you want to include this in this PR?

minggangw commented 3 years ago

Do you want to include this in this PR?

@wayneparrott Would you please help to submit a separate PR for the ts declaration? I will merge it once this PR lands.

I have tested the implementation with the rclpy client and will add a unit test when the subscription part is done, thanks!