Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Static array of bool serialisation error #979

Closed
Sata51 opened this issue Jul 17, 2024 · 2 comments · Fixed by #984
Closed

Static array of bool serialisation error #979

Sata51 opened this issue Jul 17, 2024 · 2 comments · Fixed by #984
Assignees
Labels

Comments

@Sata51
Copy link
Contributor

Sata51 commented Jul 17, 2024

Description

I've a message that contains a static array of bool. The advertised topic only received a static array of the right size with falsy value.

  • Library Version: 0.26.1
  • ROS Version: galactic
  • Platform / OS: Jetson Orin (Ubuntu 20.04.6 LTS)

Steps To Reproduce

Create a message that contains something like this:

bool[5] limited
bool[] unlimited
const myArray = [true, false, true, false, false]
const msg = rclnodejs.createMessageObject('custom/msg/arrayMsg')
msg.limited = Array.from(myArray)
msg.unlimited = Array.from(myArray)

publisher.publish(msg);

Expected Behavior

❯ ros2 topic echo /arrayMsgTopic
limited:
- true
- false
- true
- false
- true
unlimited:
- true
- false
- true
- false
- true

Actual Behavior

❯ ros2 topic echo /arrayMsgTopic
limited:
- false
- false
- false
- false
- false
unlimited:
- true
- false
- true
- false
- true
@Sata51 Sata51 added the bug label Jul 17, 2024
@minggangw
Copy link
Member

@Sata51 thanks for your feedback, I will take a look.

@minggangw minggangw self-assigned this Jul 18, 2024
minggangw added a commit to minggangw/rclnodejs-1 that referenced this issue Aug 6, 2024
Currently, when publishing a topic that contains a fixed array, the sub
cannot receive the topic as expected values.

This patch fixes this issue for publishing a fixed array in a topic.
Meanwhile, a unit test is added to ensure it works for different types
of array.

Fix: RobotWebTools#979
minggangw added a commit that referenced this issue Aug 6, 2024
Currently, when publishing a topic that contains a fixed array, the sub
cannot receive the topic as expected values.

This patch fixes this issue for publishing a fixed array in a topic.
Meanwhile, a unit test is added to ensure it works for different types
of array.

Fix: #979
@minggangw
Copy link
Member

@Sata51 The issue has been fixed on latest 0.27.2, please try with it, thanks!

minggangw added a commit that referenced this issue Dec 12, 2024
Currently, when publishing a topic that contains a fixed array, the sub
cannot receive the topic as expected values.

This patch fixes this issue for publishing a fixed array in a topic.
Meanwhile, a unit test is added to ensure it works for different types
of array.

Fix: #979
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants