Commit e37b033
authored
Correct the type of return value for Time.toMsg() (#1371)
This pull request corrects the return type of the `Time.toMsg()` method to return JavaScript numbers instead of bigints for the `sec` and `nanosec` fields, aligning with ROS2's builtin_interfaces.msg.Time message specification which uses int32 for sec and uint32 for nanosec.
**Changes:**
- Modified `Time.toMsg()` to convert bigint values to numbers using `Number()`
- Updated test expectations to verify numbers are returned instead of bigints
- Added test case verifying `Time.fromMsg()` compatibility with number types
Fix: #13701 parent 94a1728 commit e37b033
2 files changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
352 | 352 | | |
353 | 353 | | |
354 | 354 | | |
355 | | - | |
356 | | - | |
| 355 | + | |
| 356 | + | |
357 | 357 | | |
358 | 358 | | |
359 | 359 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
51 | 56 | | |
52 | 57 | | |
53 | 58 | | |
| |||
200 | 205 | | |
201 | 206 | | |
202 | 207 | | |
203 | | - | |
204 | | - | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
205 | 212 | | |
206 | 213 | | |
0 commit comments