rclnodejs 0.30.0 → 0.32.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/eslint.config.mjs +65 -0
- package/lib/action/client.js +1 -1
- package/lib/action/server.js +5 -3
- package/lib/clock.js +2 -2
- package/lib/clock_type.js +0 -2
- package/lib/distro.js +1 -1
- package/lib/duration.js +22 -35
- package/lib/interface_loader.js +1 -2
- package/lib/lifecycle.js +0 -5
- package/lib/lifecycle_publisher.js +1 -1
- package/lib/node.js +9 -20
- package/lib/parameter.js +6 -9
- package/lib/parameter_service.js +1 -2
- package/lib/publisher.js +1 -1
- package/lib/qos.js +0 -2
- package/lib/rate.js +1 -2
- package/lib/rmw.js +12 -0
- package/lib/time.js +39 -50
- package/lib/time_source.js +1 -2
- package/lib/timer.js +5 -5
- package/package.json +20 -23
- package/rosidl_gen/action_msgs.js +0 -1
- package/rosidl_gen/filter.js +14 -1
- package/rosidl_gen/generator.json +1 -1
- package/rosidl_gen/index.js +0 -1
- package/rosidl_gen/message_translator.js +2 -9
- package/rosidl_gen/packages.js +1 -3
- package/rosidl_gen/primitive_types.js +0 -4
- package/rosidl_gen/templates/message.dot +4 -0
- package/rostsd_gen/index.js +0 -3
- package/scripts/cpplint.js +3 -4
- package/scripts/generate_messages.js +1 -1
- package/scripts/npmjs-readme.md +1 -1
- package/scripts/ros_distro.js +12 -0
- package/scripts/run_test.js +0 -2
- package/src/executor.hpp +3 -3
- package/src/handle_manager.hpp +3 -3
- package/src/macros.hpp +3 -3
- package/src/rcl_action_bindings.hpp +3 -3
- package/src/rcl_bindings.cpp +47 -111
- package/src/rcl_bindings.hpp +3 -3
- package/src/rcl_handle.hpp +3 -3
- package/src/rcl_lifecycle_bindings.hpp +3 -3
- package/src/rcl_utilities.hpp +3 -3
- package/src/shadow_node.hpp +3 -3
- package/types/action_client.d.ts +0 -1
- package/types/action_server.d.ts +0 -1
- package/types/base.d.ts +27 -28
- package/types/duration.d.ts +3 -4
- package/types/index.d.ts +1 -2
- package/types/lifecycle.d.ts +1 -3
- package/types/node.d.ts +1 -2
- package/types/parameter.d.ts +0 -2
- package/types/publisher.d.ts +0 -1
- package/types/time.d.ts +4 -14
- package/types/timer.d.ts +6 -6
package/src/rcl_bindings.cpp
CHANGED
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
#include <rcl/service_introspection.h>
|
|
41
41
|
#endif
|
|
42
42
|
|
|
43
|
+
#include <cstdio>
|
|
43
44
|
#include <iostream>
|
|
44
45
|
#include <memory>
|
|
45
46
|
#include <string>
|
|
@@ -319,8 +320,12 @@ NAN_METHOD(CreateTimer) {
|
|
|
319
320
|
Nan::To<v8::Object>(info[1]).ToLocalChecked());
|
|
320
321
|
rcl_context_t* context =
|
|
321
322
|
reinterpret_cast<rcl_context_t*>(context_handle->ptr());
|
|
322
|
-
|
|
323
|
-
|
|
323
|
+
if (!info[2]->IsBigInt()) {
|
|
324
|
+
Nan::ThrowTypeError("Timer period must be a BigInt");
|
|
325
|
+
return;
|
|
326
|
+
}
|
|
327
|
+
v8::Local<v8::BigInt> bigInt = info[2].As<v8::BigInt>();
|
|
328
|
+
int64_t period_nsec = bigInt->Int64Value();
|
|
324
329
|
rcl_timer_t* timer =
|
|
325
330
|
reinterpret_cast<rcl_timer_t*>(malloc(sizeof(rcl_timer_t)));
|
|
326
331
|
*timer = rcl_get_zero_initialized_timer();
|
|
@@ -328,15 +333,14 @@ NAN_METHOD(CreateTimer) {
|
|
|
328
333
|
#if ROS_VERSION > 2305 // After Iron.
|
|
329
334
|
THROW_ERROR_IF_NOT_EQUAL(
|
|
330
335
|
RCL_RET_OK,
|
|
331
|
-
rcl_timer_init2(timer, clock, context,
|
|
336
|
+
rcl_timer_init2(timer, clock, context, period_nsec, nullptr,
|
|
332
337
|
rcl_get_default_allocator(), /*autostart=*/true),
|
|
333
338
|
rcl_get_error_string().str);
|
|
334
339
|
#else
|
|
335
|
-
THROW_ERROR_IF_NOT_EQUAL(
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
rcl_get_error_string().str);
|
|
340
|
+
THROW_ERROR_IF_NOT_EQUAL(RCL_RET_OK,
|
|
341
|
+
rcl_timer_init(timer, clock, context, period_nsec,
|
|
342
|
+
nullptr, rcl_get_default_allocator()),
|
|
343
|
+
rcl_get_error_string().str);
|
|
340
344
|
#endif
|
|
341
345
|
|
|
342
346
|
auto js_obj = RclHandle::NewInstance(timer, clock_handle, [](void* ptr) {
|
|
@@ -410,9 +414,9 @@ NAN_METHOD(TimerGetTimeUntilNextCall) {
|
|
|
410
414
|
RCL_RET_OK, rcl_timer_get_time_until_next_call(timer, &remaining_time),
|
|
411
415
|
rcl_get_error_string().str);
|
|
412
416
|
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
417
|
+
v8::Local<v8::BigInt> bigInt =
|
|
418
|
+
v8::BigInt::New(v8::Isolate::GetCurrent(), remaining_time);
|
|
419
|
+
info.GetReturnValue().Set(bigInt);
|
|
416
420
|
}
|
|
417
421
|
|
|
418
422
|
NAN_METHOD(TimerGetTimeSinceLastCall) {
|
|
@@ -425,18 +429,23 @@ NAN_METHOD(TimerGetTimeSinceLastCall) {
|
|
|
425
429
|
RCL_RET_OK, rcl_timer_get_time_since_last_call(timer, &elapsed_time),
|
|
426
430
|
rcl_get_error_string().str);
|
|
427
431
|
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
432
|
+
v8::Local<v8::BigInt> bigInt =
|
|
433
|
+
v8::BigInt::New(v8::Isolate::GetCurrent(), elapsed_time);
|
|
434
|
+
info.GetReturnValue().Set(bigInt);
|
|
431
435
|
}
|
|
432
436
|
|
|
433
437
|
NAN_METHOD(CreateTimePoint) {
|
|
434
|
-
|
|
438
|
+
if (!info[0]->IsBigInt()) {
|
|
439
|
+
Nan::ThrowTypeError("Timer period must be a BigInt");
|
|
440
|
+
return;
|
|
441
|
+
}
|
|
442
|
+
v8::Local<v8::BigInt> bigInt = info[0].As<v8::BigInt>();
|
|
443
|
+
const int64_t nanoseconds = bigInt->Int64Value();
|
|
435
444
|
uint32_t clock_type = Nan::To<uint32_t>(info[1]).FromJust();
|
|
436
445
|
rcl_time_point_t* time_point =
|
|
437
446
|
reinterpret_cast<rcl_time_point_t*>(malloc(sizeof(rcl_time_point_t)));
|
|
438
447
|
|
|
439
|
-
time_point->nanoseconds =
|
|
448
|
+
time_point->nanoseconds = nanoseconds;
|
|
440
449
|
time_point->clock_type = static_cast<rcl_clock_type_t>(clock_type);
|
|
441
450
|
|
|
442
451
|
auto js_obj =
|
|
@@ -449,16 +458,21 @@ NAN_METHOD(GetNanoseconds) {
|
|
|
449
458
|
Nan::To<v8::Object>(info[0]).ToLocalChecked());
|
|
450
459
|
rcl_time_point_t* time_point =
|
|
451
460
|
reinterpret_cast<rcl_time_point_t*>(time_point_handle->ptr());
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
461
|
+
v8::Local<v8::BigInt> bigInt =
|
|
462
|
+
v8::BigInt::New(v8::Isolate::GetCurrent(), time_point->nanoseconds);
|
|
463
|
+
info.GetReturnValue().Set(bigInt);
|
|
455
464
|
}
|
|
456
465
|
|
|
457
466
|
NAN_METHOD(CreateDuration) {
|
|
458
|
-
|
|
467
|
+
if (!info[0]->IsBigInt()) {
|
|
468
|
+
Nan::ThrowTypeError("Timer period must be a BigInt");
|
|
469
|
+
return;
|
|
470
|
+
}
|
|
471
|
+
v8::Local<v8::BigInt> bigInt = info[0].As<v8::BigInt>();
|
|
472
|
+
const int64_t nanoseconds = bigInt->Int64Value();
|
|
459
473
|
rcl_duration_t* duration =
|
|
460
474
|
reinterpret_cast<rcl_duration_t*>(malloc(sizeof(rcl_duration_t)));
|
|
461
|
-
duration->nanoseconds =
|
|
475
|
+
duration->nanoseconds = nanoseconds;
|
|
462
476
|
|
|
463
477
|
auto js_obj =
|
|
464
478
|
RclHandle::NewInstance(duration, nullptr, [](void* ptr) { free(ptr); });
|
|
@@ -470,10 +484,9 @@ NAN_METHOD(GetDurationNanoseconds) {
|
|
|
470
484
|
Nan::To<v8::Object>(info[0]).ToLocalChecked());
|
|
471
485
|
rcl_duration_t* duration =
|
|
472
486
|
reinterpret_cast<rcl_duration_t*>(duration_handle->ptr());
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
.ToLocalChecked());
|
|
487
|
+
v8::Local<v8::BigInt> bigInt =
|
|
488
|
+
v8::BigInt::New(v8::Isolate::GetCurrent(), duration->nanoseconds);
|
|
489
|
+
info.GetReturnValue().Set(bigInt);
|
|
477
490
|
}
|
|
478
491
|
|
|
479
492
|
NAN_METHOD(SetRosTimeOverrideIsEnabled) {
|
|
@@ -539,25 +552,6 @@ NAN_METHOD(CreateClock) {
|
|
|
539
552
|
}));
|
|
540
553
|
}
|
|
541
554
|
|
|
542
|
-
static void ReturnJSTimeObj(
|
|
543
|
-
Nan::NAN_METHOD_ARGS_TYPE info, int64_t nanoseconds,
|
|
544
|
-
rcl_clock_type_t clock_type = RCL_CLOCK_UNINITIALIZED) {
|
|
545
|
-
auto obj = v8::Object::New(v8::Isolate::GetCurrent());
|
|
546
|
-
|
|
547
|
-
const auto sec = static_cast<std::int32_t>(RCL_NS_TO_S(nanoseconds));
|
|
548
|
-
const auto nanosec =
|
|
549
|
-
static_cast<std::int32_t>(nanoseconds % (1000 * 1000 * 1000));
|
|
550
|
-
const int32_t type = clock_type;
|
|
551
|
-
|
|
552
|
-
Nan::Set(obj, Nan::New("sec").ToLocalChecked(), Nan::New(sec));
|
|
553
|
-
Nan::Set(obj, Nan::New("nanosec").ToLocalChecked(), Nan::New(nanosec));
|
|
554
|
-
if (clock_type != RCL_CLOCK_UNINITIALIZED) {
|
|
555
|
-
Nan::Set(obj, Nan::New("type").ToLocalChecked(), Nan::New(type));
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
info.GetReturnValue().Set(obj);
|
|
559
|
-
}
|
|
560
|
-
|
|
561
555
|
NAN_METHOD(ClockGetNow) {
|
|
562
556
|
rcl_clock_t* clock = reinterpret_cast<rcl_clock_t*>(
|
|
563
557
|
RclHandle::Unwrap<RclHandle>(
|
|
@@ -569,64 +563,9 @@ NAN_METHOD(ClockGetNow) {
|
|
|
569
563
|
THROW_ERROR_IF_NOT_EQUAL(RCL_RET_OK,
|
|
570
564
|
rcl_clock_get_now(clock, &time_point.nanoseconds),
|
|
571
565
|
rcl_get_error_string().str);
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
NAN_METHOD(StaticClockGetNow) {
|
|
577
|
-
int32_t type = Nan::To<int32_t>(info[0]).FromJust();
|
|
578
|
-
|
|
579
|
-
if (type < RCL_ROS_TIME && type > RCL_STEADY_TIME) {
|
|
580
|
-
info.GetReturnValue().Set(Nan::Undefined());
|
|
581
|
-
return;
|
|
582
|
-
}
|
|
583
|
-
|
|
584
|
-
rcl_clock_t ros_clock;
|
|
585
|
-
rcl_time_point_t rcl_time;
|
|
586
|
-
rcl_allocator_t allocator = rcl_get_default_allocator();
|
|
587
|
-
|
|
588
|
-
THROW_ERROR_IF_NOT_EQUAL(RCL_RET_OK,
|
|
589
|
-
rcl_clock_init(static_cast<rcl_clock_type_t>(type),
|
|
590
|
-
&ros_clock, &allocator),
|
|
591
|
-
rcl_get_error_string().str);
|
|
592
|
-
|
|
593
|
-
THROW_ERROR_IF_NOT_EQUAL(RCL_RET_OK,
|
|
594
|
-
rcl_clock_get_now(&ros_clock, &rcl_time.nanoseconds),
|
|
595
|
-
rcl_get_error_string().str);
|
|
596
|
-
|
|
597
|
-
THROW_ERROR_IF_NOT_EQUAL(RCL_RET_OK, rcl_clock_fini(&ros_clock),
|
|
598
|
-
rcl_get_error_string().str);
|
|
599
|
-
|
|
600
|
-
ReturnJSTimeObj(info, rcl_time.nanoseconds, rcl_time.clock_type);
|
|
601
|
-
}
|
|
602
|
-
|
|
603
|
-
NAN_METHOD(TimeDiff) {
|
|
604
|
-
int64_t s_sec = Nan::To<int32_t>(info[0]).FromJust();
|
|
605
|
-
uint32_t s_nano = Nan::To<uint32_t>(info[1]).FromJust();
|
|
606
|
-
int32_t s_type = Nan::To<int32_t>(info[2]).FromJust();
|
|
607
|
-
|
|
608
|
-
int64_t f_sec = Nan::To<int32_t>(info[3]).FromJust();
|
|
609
|
-
uint32_t f_nano = Nan::To<uint32_t>(info[4]).FromJust();
|
|
610
|
-
int32_t f_type = Nan::To<int32_t>(info[5]).FromJust();
|
|
611
|
-
|
|
612
|
-
rcl_time_point_t start;
|
|
613
|
-
rcl_time_point_t finish;
|
|
614
|
-
rcl_duration_t delta;
|
|
615
|
-
|
|
616
|
-
start.nanoseconds = s_sec * 1000 * 1000 * 1000 + s_nano;
|
|
617
|
-
start.clock_type = static_cast<rcl_clock_type_t>(s_type);
|
|
618
|
-
|
|
619
|
-
finish.nanoseconds = f_sec * 1000 * 1000 * 1000 + f_nano;
|
|
620
|
-
finish.clock_type = static_cast<rcl_clock_type_t>(f_type);
|
|
621
|
-
|
|
622
|
-
auto ret = rcl_difference_times(&start, &finish, &delta);
|
|
623
|
-
|
|
624
|
-
if (ret == RCL_RET_OK) {
|
|
625
|
-
ReturnJSTimeObj(info, delta.nanoseconds);
|
|
626
|
-
return;
|
|
627
|
-
}
|
|
628
|
-
|
|
629
|
-
info.GetReturnValue().Set(Nan::Undefined());
|
|
566
|
+
v8::Local<v8::BigInt> bigInt =
|
|
567
|
+
v8::BigInt::New(v8::Isolate::GetCurrent(), time_point.nanoseconds);
|
|
568
|
+
info.GetReturnValue().Set(bigInt);
|
|
630
569
|
}
|
|
631
570
|
|
|
632
571
|
NAN_METHOD(RclTake) {
|
|
@@ -772,7 +711,6 @@ NAN_METHOD(HasContentFilter) {
|
|
|
772
711
|
info.GetReturnValue().Set(Nan::False());
|
|
773
712
|
return;
|
|
774
713
|
#else
|
|
775
|
-
|
|
776
714
|
RclHandle* subscription_handle = RclHandle::Unwrap<RclHandle>(
|
|
777
715
|
Nan::To<v8::Object>(info[0]).ToLocalChecked());
|
|
778
716
|
rcl_subscription_t* subscription =
|
|
@@ -1026,7 +964,7 @@ NAN_METHOD(SendRequest) {
|
|
|
1026
964
|
THROW_ERROR_IF_NOT_EQUAL(rcl_send_request(client, buffer, &sequence_number),
|
|
1027
965
|
RCL_RET_OK, rcl_get_error_string().str);
|
|
1028
966
|
|
|
1029
|
-
info.GetReturnValue().Set(Nan::New((
|
|
967
|
+
info.GetReturnValue().Set(Nan::New(static_cast<uint32_t>(sequence_number)));
|
|
1030
968
|
}
|
|
1031
969
|
|
|
1032
970
|
NAN_METHOD(RclTakeResponse) {
|
|
@@ -1043,7 +981,7 @@ NAN_METHOD(RclTakeResponse) {
|
|
|
1043
981
|
int64_t sequence_number = header.request_id.sequence_number;
|
|
1044
982
|
|
|
1045
983
|
if (ret == RCL_RET_OK) {
|
|
1046
|
-
info.GetReturnValue().Set(Nan::New((
|
|
984
|
+
info.GetReturnValue().Set(Nan::New(static_cast<uint32_t>(sequence_number)));
|
|
1047
985
|
return;
|
|
1048
986
|
}
|
|
1049
987
|
|
|
@@ -1224,7 +1162,7 @@ NAN_METHOD(ValidateFullTopicName) {
|
|
|
1224
1162
|
Nan::Set(
|
|
1225
1163
|
result_list, 0,
|
|
1226
1164
|
Nan::New<v8::String>(std::string(validation_message)).ToLocalChecked());
|
|
1227
|
-
Nan::Set(result_list, 1, Nan::New((
|
|
1165
|
+
Nan::Set(result_list, 1, Nan::New(static_cast<int32_t>(invalid_index)));
|
|
1228
1166
|
|
|
1229
1167
|
info.GetReturnValue().Set(result_list);
|
|
1230
1168
|
}
|
|
@@ -1259,7 +1197,7 @@ NAN_METHOD(ValidateNodeName) {
|
|
|
1259
1197
|
Nan::Set(
|
|
1260
1198
|
result_list, 0,
|
|
1261
1199
|
Nan::New<v8::String>(std::string(validation_message)).ToLocalChecked());
|
|
1262
|
-
Nan::Set(result_list, 1, Nan::New((
|
|
1200
|
+
Nan::Set(result_list, 1, Nan::New(static_cast<int32_t>(invalid_index)));
|
|
1263
1201
|
|
|
1264
1202
|
info.GetReturnValue().Set(result_list);
|
|
1265
1203
|
}
|
|
@@ -1294,7 +1232,7 @@ NAN_METHOD(ValidateTopicName) {
|
|
|
1294
1232
|
Nan::Set(
|
|
1295
1233
|
result_list, 0,
|
|
1296
1234
|
Nan::New<v8::String>(std::string(validation_message)).ToLocalChecked());
|
|
1297
|
-
Nan::Set(result_list, 1, Nan::New((
|
|
1235
|
+
Nan::Set(result_list, 1, Nan::New(static_cast<int32_t>(invalid_index)));
|
|
1298
1236
|
|
|
1299
1237
|
info.GetReturnValue().Set(result_list);
|
|
1300
1238
|
}
|
|
@@ -1329,7 +1267,7 @@ NAN_METHOD(ValidateNamespace) {
|
|
|
1329
1267
|
Nan::Set(
|
|
1330
1268
|
result_list, 0,
|
|
1331
1269
|
Nan::New<v8::String>(std::string(validation_message)).ToLocalChecked());
|
|
1332
|
-
Nan::Set(result_list, 1, Nan::New((
|
|
1270
|
+
Nan::Set(result_list, 1, Nan::New(static_cast<int32_t>(invalid_index)));
|
|
1333
1271
|
|
|
1334
1272
|
info.GetReturnValue().Set(result_list);
|
|
1335
1273
|
}
|
|
@@ -2051,8 +1989,6 @@ std::vector<BindingMethod> binding_methods = {
|
|
|
2051
1989
|
{"timerGetTimeUntilNextCall", TimerGetTimeUntilNextCall},
|
|
2052
1990
|
{"createClock", CreateClock},
|
|
2053
1991
|
{"clockGetNow", ClockGetNow},
|
|
2054
|
-
{"staticClockGetNow", StaticClockGetNow},
|
|
2055
|
-
{"timeDiff", TimeDiff},
|
|
2056
1992
|
{"createTimePoint", CreateTimePoint},
|
|
2057
1993
|
{"getNanoseconds", GetNanoseconds},
|
|
2058
1994
|
{"createDuration", CreateDuration},
|
package/src/rcl_bindings.hpp
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
#ifndef
|
|
16
|
-
#define
|
|
15
|
+
#ifndef SRC_RCL_BINDINGS_HPP_
|
|
16
|
+
#define SRC_RCL_BINDINGS_HPP_
|
|
17
17
|
|
|
18
18
|
#include <nan.h>
|
|
19
19
|
#include <rcl/graph.h>
|
|
@@ -43,4 +43,4 @@ extern std::vector<BindingMethod> binding_methods;
|
|
|
43
43
|
|
|
44
44
|
} // namespace rclnodejs
|
|
45
45
|
|
|
46
|
-
#endif
|
|
46
|
+
#endif // SRC_RCL_BINDINGS_HPP_
|
package/src/rcl_handle.hpp
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
#ifndef
|
|
16
|
-
#define
|
|
15
|
+
#ifndef SRC_RCL_HANDLE_HPP_
|
|
16
|
+
#define SRC_RCL_HANDLE_HPP_
|
|
17
17
|
|
|
18
18
|
#include <nan.h>
|
|
19
19
|
|
|
@@ -68,4 +68,4 @@ class RclHandle : public Nan::ObjectWrap {
|
|
|
68
68
|
|
|
69
69
|
} // namespace rclnodejs
|
|
70
70
|
|
|
71
|
-
#endif
|
|
71
|
+
#endif // SRC_RCL_HANDLE_HPP_
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
#ifndef
|
|
16
|
-
#define
|
|
15
|
+
#ifndef SRC_RCL_LIFECYCLE_BINDINGS_HPP_
|
|
16
|
+
#define SRC_RCL_LIFECYCLE_BINDINGS_HPP_
|
|
17
17
|
|
|
18
18
|
#include <vector>
|
|
19
19
|
|
|
@@ -25,4 +25,4 @@ extern std::vector<BindingMethod> lifecycle_binding_methods;
|
|
|
25
25
|
|
|
26
26
|
} // namespace rclnodejs
|
|
27
27
|
|
|
28
|
-
#endif
|
|
28
|
+
#endif // SRC_RCL_LIFECYCLE_BINDINGS_HPP_
|
package/src/rcl_utilities.hpp
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
#ifndef
|
|
16
|
-
#define
|
|
15
|
+
#ifndef SRC_RCL_UTILITIES_HPP_
|
|
16
|
+
#define SRC_RCL_UTILITIES_HPP_
|
|
17
17
|
|
|
18
18
|
#include <string>
|
|
19
19
|
|
|
@@ -37,4 +37,4 @@ std::string GetErrorMessageAndClear();
|
|
|
37
37
|
|
|
38
38
|
} // namespace rclnodejs
|
|
39
39
|
|
|
40
|
-
#endif
|
|
40
|
+
#endif // SRC_RCL_UTILITIES_HPP_
|
package/src/shadow_node.hpp
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
// See the License for the specific language governing permissions and
|
|
13
13
|
// limitations under the License.
|
|
14
14
|
|
|
15
|
-
#ifndef
|
|
16
|
-
#define
|
|
15
|
+
#ifndef SRC_SHADOW_NODE_HPP_
|
|
16
|
+
#define SRC_SHADOW_NODE_HPP_
|
|
17
17
|
|
|
18
18
|
#include <nan.h>
|
|
19
19
|
|
|
@@ -60,4 +60,4 @@ class ShadowNode : public Nan::ObjectWrap, public Executor::Delegate {
|
|
|
60
60
|
|
|
61
61
|
} // namespace rclnodejs
|
|
62
62
|
|
|
63
|
-
#endif
|
|
63
|
+
#endif // SRC_SHADOW_NODE_HPP_
|
package/types/action_client.d.ts
CHANGED
package/types/action_server.d.ts
CHANGED
package/types/base.d.ts
CHANGED
|
@@ -1,28 +1,27 @@
|
|
|
1
|
-
|
|
2
|
-
/// <reference
|
|
3
|
-
/// <reference
|
|
4
|
-
/// <reference
|
|
5
|
-
/// <reference
|
|
6
|
-
/// <reference
|
|
7
|
-
/// <reference
|
|
8
|
-
/// <reference
|
|
9
|
-
/// <reference
|
|
10
|
-
/// <reference
|
|
11
|
-
/// <reference
|
|
12
|
-
/// <reference
|
|
13
|
-
/// <reference
|
|
14
|
-
/// <reference
|
|
15
|
-
/// <reference
|
|
16
|
-
/// <reference
|
|
17
|
-
/// <reference
|
|
18
|
-
/// <reference
|
|
19
|
-
/// <reference
|
|
20
|
-
/// <reference
|
|
21
|
-
/// <reference
|
|
22
|
-
/// <reference
|
|
23
|
-
/// <reference
|
|
24
|
-
/// <reference
|
|
25
|
-
/// <reference
|
|
26
|
-
/// <reference
|
|
27
|
-
/// <reference
|
|
28
|
-
/// <reference path="timer.d.ts" />
|
|
1
|
+
/// <reference types="./action_client.d.ts" />
|
|
2
|
+
/// <reference types="./action_server.d.ts" />
|
|
3
|
+
/// <reference types="./action_uuid.d.ts" />
|
|
4
|
+
/// <reference types="./client.d.ts" />
|
|
5
|
+
/// <reference types="./clock_type.d.ts" />
|
|
6
|
+
/// <reference types="./clock.d.ts" />
|
|
7
|
+
/// <reference types="./context.d.ts" />
|
|
8
|
+
/// <reference types="./distro.d.ts" />
|
|
9
|
+
/// <reference types="./duration.d.ts" />
|
|
10
|
+
/// <reference types="./entity.d.ts" />
|
|
11
|
+
/// <reference types="./guard_condition.d.ts" />
|
|
12
|
+
/// <reference types="./interfaces.d.ts" />
|
|
13
|
+
/// <reference types="./lifecycle.d.ts" />
|
|
14
|
+
/// <reference types="./lifecycle_publisher.d.ts" />
|
|
15
|
+
/// <reference types="./logging.d.ts" />
|
|
16
|
+
/// <reference types="./node.d.ts" />
|
|
17
|
+
/// <reference types="./node_options.d.ts" />
|
|
18
|
+
/// <reference types="./parameter.d.ts" />
|
|
19
|
+
/// <reference types="./publisher.d.ts" />
|
|
20
|
+
/// <reference types="./qos.d.ts" />
|
|
21
|
+
/// <reference types="./rate.d.ts" />
|
|
22
|
+
/// <reference types="./service.d.ts" />
|
|
23
|
+
/// <reference types="./service_introspection.d.ts" />
|
|
24
|
+
/// <reference types="./subscription.d.ts" />
|
|
25
|
+
/// <reference types="./time_source.d.ts" />
|
|
26
|
+
/// <reference types="./time.d.ts" />
|
|
27
|
+
/// <reference types="./timer.d.ts" />
|
package/types/duration.d.ts
CHANGED
|
@@ -10,15 +10,14 @@ declare module 'rclnodejs' {
|
|
|
10
10
|
* @param seconds - The seconds component of the duration, default = 0.
|
|
11
11
|
* @param nanoseconds - The nanoseconds component of the duration, default = 0.
|
|
12
12
|
*/
|
|
13
|
-
constructor(seconds?:
|
|
13
|
+
constructor(seconds?: bigint, nanoseconds?: bigint);
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* Get the nanosecond component of the Duration.
|
|
17
17
|
*
|
|
18
|
-
* @returns The nanoseconds
|
|
19
|
-
* will be presented in a string of decimal format.
|
|
18
|
+
* @returns The nanoseconds.
|
|
20
19
|
*/
|
|
21
|
-
readonly nanoseconds:
|
|
20
|
+
readonly nanoseconds: bigint;
|
|
22
21
|
|
|
23
22
|
/**
|
|
24
23
|
* Test if this Duration is equal to another Duration.
|
package/types/index.d.ts
CHANGED
package/types/lifecycle.d.ts
CHANGED
|
@@ -53,10 +53,8 @@ declare module 'rclnodejs' {
|
|
|
53
53
|
asMessage(): {
|
|
54
54
|
transition: SerializedState;
|
|
55
55
|
|
|
56
|
-
// eslint-disable-next-line camelcase
|
|
57
56
|
start_state: SerializedState;
|
|
58
57
|
|
|
59
|
-
// eslint-disable-next-line camelcase
|
|
60
58
|
goal_state: SerializedState;
|
|
61
59
|
};
|
|
62
60
|
}
|
|
@@ -249,7 +247,7 @@ declare module 'rclnodejs' {
|
|
|
249
247
|
* Register a callback function to be invoked during the deactivate() action.
|
|
250
248
|
* @param cb - The callback function to invoke.
|
|
251
249
|
*/
|
|
252
|
-
|
|
250
|
+
registerOnDeactivate(cb: TransitionCallback): void;
|
|
253
251
|
|
|
254
252
|
/**
|
|
255
253
|
* Register a callback function to be invoked during the cleanup() action.
|
package/types/node.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable camelcase */
|
|
2
1
|
declare module 'rclnodejs' {
|
|
3
2
|
/**
|
|
4
3
|
* Identifies type of ROS message such as msg or srv.
|
|
@@ -267,7 +266,7 @@ declare module 'rclnodejs' {
|
|
|
267
266
|
* @returns New instance of Timer.
|
|
268
267
|
*/
|
|
269
268
|
createTimer(
|
|
270
|
-
period:
|
|
269
|
+
period: bigint,
|
|
271
270
|
callback: TimerRequestCallback,
|
|
272
271
|
clock?: Clock
|
|
273
272
|
): Timer;
|
package/types/parameter.d.ts
CHANGED
package/types/publisher.d.ts
CHANGED
package/types/time.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { Message, builtin_interfaces } from 'rclnodejs';
|
|
1
|
+
import { builtin_interfaces } from 'rclnodejs';
|
|
4
2
|
|
|
5
3
|
declare module 'rclnodejs' {
|
|
6
4
|
/**
|
|
@@ -14,11 +12,7 @@ declare module 'rclnodejs' {
|
|
|
14
12
|
* @param nanoseconds - The nanoseconds component of the time, default = 0.
|
|
15
13
|
* @param clockType - The clock type, default = Clock.ClockType.SYSTEM_TIME
|
|
16
14
|
*/
|
|
17
|
-
constructor(
|
|
18
|
-
seconds?: number | string,
|
|
19
|
-
nanoseconds?: number | string,
|
|
20
|
-
clockType?: ClockType
|
|
21
|
-
);
|
|
15
|
+
constructor(seconds?: bigint, nanoseconds?: bigint, clockType?: ClockType);
|
|
22
16
|
|
|
23
17
|
/**
|
|
24
18
|
* Get the the clock type of the Time object.
|
|
@@ -27,15 +21,13 @@ declare module 'rclnodejs' {
|
|
|
27
21
|
|
|
28
22
|
/**
|
|
29
23
|
* Get the nanosecond part of the time.
|
|
30
|
-
* If the value is greater than Number.MAX_SAFE_INTEGER (2^53-1) it
|
|
31
|
-
* will be returned in a string of decimal format.
|
|
32
24
|
*/
|
|
33
|
-
readonly nanoseconds:
|
|
25
|
+
readonly nanoseconds: bigint;
|
|
34
26
|
|
|
35
27
|
/**
|
|
36
28
|
* Get the time as a plain JavaScript object.
|
|
37
29
|
*/
|
|
38
|
-
readonly secondsAndNanoseconds: { seconds:
|
|
30
|
+
readonly secondsAndNanoseconds: { seconds: bigint; nanoseconds: bigint };
|
|
39
31
|
|
|
40
32
|
/**
|
|
41
33
|
* Add a duration to this time object.
|
|
@@ -106,7 +98,6 @@ declare module 'rclnodejs' {
|
|
|
106
98
|
*
|
|
107
99
|
* @returns The new Time message.
|
|
108
100
|
*/
|
|
109
|
-
// eslint-disable-next-line camelcase
|
|
110
101
|
toMsg(): builtin_interfaces.msg.Time;
|
|
111
102
|
|
|
112
103
|
/**
|
|
@@ -116,7 +107,6 @@ declare module 'rclnodejs' {
|
|
|
116
107
|
* @param clockType - The type of the time object. Default is ClockType.ROS_TIME
|
|
117
108
|
* @returns The new Time.
|
|
118
109
|
*/
|
|
119
|
-
// eslint-disable-next-line camelcase
|
|
120
110
|
static fromMsg(
|
|
121
111
|
msg: builtin_interfaces.msg.Time,
|
|
122
112
|
clockType?: ClockType
|
package/types/timer.d.ts
CHANGED
|
@@ -4,9 +4,9 @@ declare module 'rclnodejs' {
|
|
|
4
4
|
*/
|
|
5
5
|
interface Timer {
|
|
6
6
|
/**
|
|
7
|
-
* Time between callbacks in
|
|
7
|
+
* Time between callbacks in nanoseconds.
|
|
8
8
|
*/
|
|
9
|
-
readonly period:
|
|
9
|
+
readonly period: bigint;
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Check if the timer is ready.
|
|
@@ -35,15 +35,15 @@ declare module 'rclnodejs' {
|
|
|
35
35
|
/**
|
|
36
36
|
* Get the interval since the last call of this timer.
|
|
37
37
|
*
|
|
38
|
-
* @returns The interval value in
|
|
38
|
+
* @returns The interval value in nanoseconds.
|
|
39
39
|
*/
|
|
40
|
-
timeSinceLastCall():
|
|
40
|
+
timeSinceLastCall(): bigint;
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* Get the interval until the next call will happen.
|
|
44
44
|
*
|
|
45
|
-
* @returns The interval value in
|
|
45
|
+
* @returns The interval value in nanoseconds
|
|
46
46
|
*/
|
|
47
|
-
timeUntilNextCall():
|
|
47
|
+
timeUntilNextCall(): bigint;
|
|
48
48
|
}
|
|
49
49
|
}
|