Commit Graph

353 Commits

Author SHA1 Message Date
Martin Škoudlil 583c45c9ea Add Callback type to allow tracing callback calls 2025-05-07 12:47:12 +02:00
Martin Škoudlil 2b4f9753d4 Create TracingId type
The TracingId is used as a wrapper for the pointer to allow implementing
Send and Sync traits.

The pointer is used only as an ID and is never dereferenced, therefore, it is safe.
2025-05-07 12:47:12 +02:00
Martin Škoudlil cf03fe1b48 Add r2r_tracing crate
The crate contains tracepoints; either defined directly or imported
from ros2_tracing project (tracetools package).

The crate define a `tracing` feature which should only be used on Linux
because it uses LTTng only available on Linux.
2025-05-07 12:47:11 +02:00
Martin Škoudlil e371130cf1 Make rcl_client_t have stable location
This prevents another client initializing at the same location.
Therefore preventing conflicts in a trace.
2025-04-23 17:12:37 +02:00
Martin Škoudlil 23672cfdb8 Make rcl_service_t have stable location
This prevents another service initializing at the same location.
Therefore preventing conflicts in a trace.
2025-04-23 17:12:37 +02:00
Martin Škoudlil a51bda8901 Make rcl_subscription_t have stable location
This change is necessary because rcl uses address of the rcl handle in
tracepoints. If the location changes further `take` events will not
be correctly assigned to the subscriber.
2025-04-23 17:12:37 +02:00
Martin Škoudlil 5514c475bc Make rcl_publisher_t have stable location
This change is necessary because rcl uses address of the rcl handle in
tracepoints. If the location changes, further publish events will not
be correctly assigned to the publisher.
2025-04-23 17:12:37 +02:00
Martin Dahl 455ea630ec Release 0.9.5 2025-04-22 10:27:18 +02:00
Martin Dahl aa180c5b15
Add `/set_parameters_atomically` (#120, #121)
* Fixed failing `ros2 param ...` on r2r nodes for Jazzy (#120)

Add `/set_parameters_atomically` service to `make_parameter_handler_internal` in `nodes.rs` to fix failing `ros2 param ...` on r2r nodes for Jazzy.

* Atomic behavior for `set_parameters_atomically` (#121).

---------

Co-authored-by: Desmond Germans <desmond@germansmedia.nl>
2025-04-22 10:20:32 +02:00
Benjamin Bjerken 56acba5dd5 Update bindgen 0.63.0 -> 0.71.1 (#116)
This fixes #116 by now generating the missing primitive sequence functions.
Tested to be working on Ubuntu 22.04 with ROS2 Humble and Iron.
2025-04-17 09:54:48 +02:00
Martin Dahl ad25b72e76 Release 0.9.4 2024-11-21 13:56:42 +01:00
Martin Dahl 94db799db2 fix message generation for WChar idl type 2024-11-21 13:45:13 +01:00
Martin Dahl 74ad4410c7 single-':' cargo syntax for compability with rust versions < 1.77 2024-11-19 12:12:33 +01:00
Martin Dahl b1134a6ef0 Release 0.9.3 2024-11-09 09:54:48 +01:00
Shaw Drastin 4517663f27 Expose WrongParameterType 2024-11-09 09:49:52 +01:00
Martin Dahl e6f805b3d3 Update readme 2024-11-02 10:02:01 +01:00
Martin Dahl 1f8e739803 add destroy publisher functions 2024-10-30 20:52:59 +01:00
Martin Dahl 2236b2ac12 Release 0.9.2 2024-10-13 11:30:34 +02:00
Martin Dahl 5ecf4d9123 Update README and fix build docs mistake. 2024-10-13 11:23:06 +02:00
Martin Dahl 4cb5bd362e Silence cfg and ffi warnings. Fixes #108. 2024-10-13 11:02:19 +02:00
James Carl d8fe90b61d
More convinent one time parameter access (#107)
* Implement TryInto for ParameterValue

* Add `get_parameter` method.

* Consolidate 'ParameterNotSet' into 'ParamterWrongType' error

* Add support for optional parameters

* Add example for get_parameter.
2024-10-13 10:51:47 +02:00
Martin Dahl 09c8a8ae11 Release 0.9.1 2024-10-12 10:18:47 +02:00
Tobias Stark 94ceec8cf6 Use copy_nonoverlapping for more efficient sequence filling 2024-10-12 09:45:05 +02:00
Tobias Stark 6311c2013f Add additional assertions to rcl wrapper 2024-10-12 09:45:05 +02:00
Tobias Stark a35d541378 Copy topic name before deleting subscription.
This fixes undefined behaviour, as the
rcl_subscription_get_topic_name documentation
states that the topic is no longer valid when
the subscription dies
2024-10-12 09:39:01 +02:00
Martin Dahl 89cec03d07 Remove dead code. 2024-07-04 18:18:40 +02:00
Desmond Germans cae671ccda Add ros2 jazzy support. 2024-07-04 17:42:07 +02:00
Tobias Stark 05d2c194d0 Avoid memory leak in loaned-message return path 2024-06-18 09:35:08 +02:00
Martin Dahl 21948154fe Release 0.9.0 2024-05-17 12:17:43 +02:00
Martin Dahl 4ef57ccebb Update README 2024-05-17 11:48:49 +02:00
Martin Dahl f7bbf8563f rustfmt 2024-05-17 11:47:26 +02:00
Martin Dahl 381f810d54 Check for null in `from_raw_parts` which rust 1.78 does not like.
Revert temporary fix for CI. Closes #96.
2024-05-17 11:40:05 +02:00
Martin Dahl 33b82da466 Temporary fix for CI until #96 is resolved. 2024-05-17 08:31:46 +02:00
TijlJappens a02a78fbf0
Expose qos profiles for service clients and servers. (#95)
Adds a QosProfile parameter for `Node::create_client` and `Node::node.create_service`.

`QosProfile::default()` can be passed when updating existing code.
2024-05-17 08:27:47 +02:00
Martin Dahl e2d6aba259 Update README 2024-04-29 20:53:47 +02:00
Michal Sojka 6f02234c69 Make order of derived parameters independent of CLI arguments
The previous commit made the order of parameters deterministic
(defined by so called insertion order), but the order still depends on
whether or not some parameters were set from the command line. Command
line parameters are inserted to the IndexMap at Node creation time,
while other RosParams-derived parameters later, during the call to
make_derived_parameter_handler().

This commit ensures that parameters processed by
make_derived_parameter_handler() are always inserted in the same
order, even if some of them were already inserted before due to CLI
arguments.
2024-04-29 20:33:50 +02:00
Michal Sojka e9f375e8f6 Make the order of parameters deterministic
GUI tools for working with parameters (at least Foxglove Studio, rqt
and rig_reconfigure) show the parameters in the same order as returned
by the ListParameters service. r2r stores the parameters in a HashMap,
which iterates keys and values in arbitrary order. The result is that
the GUI tools show the parameters in different order after every node
invocation, which can be quite annoying.

To make the order deterministic, we change the parameter storage from
HashMap to IndexMap, which iterates the map in insertion order.
According to the indexmap documentation, IndexMap is a drop-in
replacement of HashMap so this change should not require code changes
in applications using r2r. At least r2r examples and my projects
needed no changes.
2024-04-29 20:33:50 +02:00
aeon b46e3744b2 Add an r2r_info example to dump the ROS environment report 2024-04-17 08:23:20 +02:00
aeon 28e89bf256 [r2r_common] Remove println!() that taints the build script output 2024-04-17 08:23:20 +02:00
aeon 95fdea3b9c Run rustfmt using new configuration 2024-04-08 12:57:34 +02:00
aeon aad542fd3e Add "edition" and other options in rustfmt.toml 2024-04-08 12:57:34 +02:00
aeon bd998ab880 Fix several clippy warnings 2024-04-08 12:56:47 +02:00
passchaos 17584344c2 feat: remove is_available's node mut-ref dependency, also remove the !Sync constraint
on the future returned
2024-04-08 12:55:52 +02:00
Martin Dahl 13902524f7 Update README. 2024-03-25 08:10:14 +01:00
Martin Škoudlil 11ec445164 Add macro to fail compilation if sim time is not supported
cfg(r2r__rosgraph_msgs__msg__Clock) attribute is not propagated to user
code so this macro can be used to intentionally fail compilation if
sim time is not supported.
2024-03-22 18:45:27 +01:00
Martin Škoudlil c23e2eb1f6 Add panic to sim time examples 2024-03-22 18:38:51 +01:00
Martin Dahl 0fd206ca4f Replace feature with cfg based on whether clock message is compiled 2024-03-22 10:40:15 +01:00
Martin Škoudlil 62897e2afe Add examples showing usage of sim time 2024-03-20 17:39:33 +01:00
Martin Škoudlil 951db6caae Add methods to access TimeSource and shared ROS clock 2024-03-20 17:39:33 +01:00
Martin Škoudlil 0b86dda116 Enable simulated time when the node is started with use_sim_time parameter
add `--ros-args -p use_sim_time:=true` to starting command line
2024-03-20 17:39:32 +01:00