Commit Graph

346 Commits

Author SHA1 Message Date
Martin Dahl 2052ee2afd wait a bit for publisher info in test. 2024-03-19 12:11:47 +01:00
Földi Tamás 285853a1e5 chore: use BEST_AVAILABLE QoS in rolling 2024-03-19 11:54:19 +01:00
Martin Dahl 8a1444d8f6 Update readme. 2024-02-09 15:39:27 +01:00
Martin Dahl 8bd4e0b5e0 Add ros2 iron 2024-02-09 14:53:18 +01:00
Martin Dahl 3ae831acb3 Release 0.8.3 2024-01-14 10:48:21 +01:00
Martin Dahl fe5066fa44 Update readme. 2024-01-11 21:07:45 +01:00
Martin Dahl fe258169dd cargo fmt 2024-01-11 21:03:41 +01:00
NerdToMars b3e4a58eca
add get_publishers_info_by_topic (#80)
* add get_publishers_info_by_topic
2024-01-11 20:55:33 +01:00
Michael Hoy cb87b9c01c
Add raw publisher, convert Context to singleton (#76)
* Add raw publisher

* Add raw publisher examples

* Add more tests. Convert Context into singleton to avoid memory corruption when creatin multiple Context instances
2024-01-07 11:46:59 +01:00
Michael Hoy 3d6936e70a
Add rcl_publisher_get_subscription_count related methods (#75)
* Add rcl_publisher_get_subscription_count related methods

* Update implementation of publisher to handle wait_for_inter_process_subscribers
2023-12-27 23:14:09 +01:00
Martin Dahl d5f2ef0eac `from_serialized_bytes` for WrappedNativeMsgUntyped 2023-12-19 20:41:50 +01:00
Martin Dahl 3518ac9215 Update readme, `tokio_raw_subscriber` example, cargo fmt. 2023-12-18 08:38:34 +01:00
Martin Dahl 3b42626dcb
Merge pull request #74 from mchhoy/message_serialization_helpers
Message serialization helpers
2023-12-14 09:17:18 +01:00
Martin Dahl fb08e1f94b Add deserialization benchmark. 2023-12-13 17:05:12 +01:00
Michael Hoy eb1f461943 Add missing descructors 2023-12-13 22:59:16 +08:00
Michael Hoy f5ba556e2e Move location of from_rcl_error to avoid the need for r2r::Error to be Clone 2023-12-13 22:51:57 +08:00
Michael Hoy 2e17b8ed40 Add comment 2023-12-13 22:44:45 +08:00
Michael Hoy d9cab1058e Merge branch 'master' of github.com:mchhoy/r2r into message_serialization_helpers 2023-12-13 22:42:31 +08:00
Michael Hoy 8b627fa53b Add functions to_serialized_bytes and from_serialized_bytes 2023-12-13 22:42:22 +08:00
Martin Dahl 7b6c8009c4 Update readme. 2023-12-13 14:54:45 +01:00
Martin Dahl 39b9f59fe7 Fix elided_lifetimes_in_associated_constant compiler warning.
Will become an error in a future rust release. https://github.com/rust-lang/rust/issues/115010
2023-12-13 14:52:32 +01:00
Martin Dahl e81f706abe Break out raw subscription test to own file and remove panics. 2023-12-13 12:44:17 +01:00
Martin Dahl 4c38bce214 Reuse the msg buffer to reduce allocations. Added example. cargo fmt 2023-12-13 11:27:52 +01:00
Michael Hoy 21a6551d81 Added raw message subscriber 2023-12-13 11:28:25 +08:00
Martin Dahl 6bc1f5f27b Release 0.8.2 2023-12-11 15:29:35 +01:00
Martin Dahl 01c5d4b626 Prepare for release 2023-12-11 15:25:30 +01:00
Martin Dahl 4e546cda63
Merge pull request #71 from alecrivers/fix-include-directories
Fix include directory parsing on Linux in some cases
2023-12-10 20:36:39 +01:00
Alec Rivers 9664d920ad Fix include directory parsing on Linux in some cases 2023-12-09 22:07:25 -08:00
Martin Dahl 50b5f9da27 Fix ROS expired keys for foxy and galactic images. 2023-12-05 10:38:23 +01:00
Martin Dahl be617d1a16 Add github action for building r2r_minimal_node with colcon. 2023-12-05 09:57:43 +01:00
Martin Dahl 27cc6450cd Fix bug in r2r_cargo 2023-12-05 09:46:44 +01:00
Martin Dahl b685b30af1 Update changelog + version numbers in readme and cmake file. 2023-11-30 14:28:24 +01:00
Martin Dahl 2316022f02 Release 0.8.1 2023-11-30 13:00:43 +01:00
Martin Dahl 7fc96e3eb2 Revert cmake include dirs behaviour 2023-11-30 12:38:49 +01:00
Martin Dahl 4d9da2b7a7 Release 0.8.0 2023-10-05 11:44:22 +02:00
Martin Dahl 6d144337e5 Disable bindgen layout tests 2023-10-05 11:32:59 +02:00
Martin Dahl ae20d3c33b Re-export RosParams macro. 2023-10-05 11:30:54 +02:00
Martin Dahl f2c8a67c0c Prepare for release 0.8.0 2023-10-05 10:51:38 +02:00
Martin Dahl 81adeb15d0 Update README. 2023-10-05 09:37:54 +02:00
Martin Dahl e33a57c6eb Remove special cases from bindgen path management 2023-10-05 09:37:08 +02:00
Michal Sojka 00d7a3db0b Derive ROS parameter description from field doc comments
With this change, adding doc comments to fields of structures used
with `#[derive(RosParams)]` results in those comments being used as
parameter description.

See r2r/examples/parameters_derive.rs for how to use and test this
feature.

*BREAKING CHANGE*

This commit changes r2r public API. Previously Node::params contained
HashMap<String, ParameterValue>, now it contains HashMap<String, Parameter>.

If you previously used the ParameterValue from this HashMap, now you
can get the same by using the .value field of the Parameter structure.
2023-10-05 08:34:22 +02:00
Michal Sojka c12a6fdb76 r2r_macros: Remove TODO
The code is already merged, so renaming makes little sense.
2023-10-05 08:34:22 +02:00
Michal Sojka 804bae7866 Minimal implementation of GetParameterTypes and DescribeParameters services
With this, the parameters are shown in Rqt or Foxglove Studio.
2023-10-05 08:34:22 +02:00
Martin Dahl 0a6e0f571a Restore old cmake integration functionality on windows 2023-09-26 22:14:36 +02:00
Martin Dahl 45e862b79e Workaround for _Check_return_ annotation 2023-09-26 22:14:36 +02:00
Nadhmi JAZI 64bc6af718 add windows support + use cmake_path to have colcon-cargo working
correctly
2023-09-26 22:14:36 +02:00
Martin Dahl 29404f1982 Update README 2023-09-22 08:47:46 +02:00
Michal Sojka 98550c76f7 doc: Parameter handling is no longer "rudimentary" 2023-09-22 08:42:29 +02:00
Michal Sojka a3fe422cd6 Implement derive(RosParams) macro and surrounding infrastructure
With this, declaring and handling node parameters becomes easy. One
just needs to define a structure(s) containing the parameters such as:

    #[derive(RosParams, Default, Debug)]
    struct Params {
        par1: f64,
        par2: i32,
        str: String,
    }

And then instantiate and register it with:

    let params = Arc::new(Mutex::new(Params::default()));
    let (paramater_handler, _) = node.make_derived_parameter_handler(params.clone())?;

This will add three parameters `par1`, `par2` and `str` to the node.
Their type will be `Double`, `Integer` and `String` respectively.
Other Rust types such as `f32` or differently sized integers, e.g.
`u16` are also supported and registered as appropriate ROS parameter
types.

After spawning the handler, e.g.:

    spawner.spawn_local(paramater_handler)?;

changing a parameter with external ROS tools (e.g. `ros2 param set`)
will result in changing the appropriate field in the `Params`
structure. Type conversion is handled automatically. For example,
setting an `i8` field (represented as `Integer` ROS parameter) will
succeed if the value is in range -128 to 127 and fail with appropriate
error message for other values.

The other direction also works: Changing a value in the `Params`
structure will be visible outside of the Node via the `get_parameters`
service.

It is also possible to organize the parameters as several nested
structures with parameters. Then, parameter names of different nesting
levels will be separated by `.`. For example `nested.par3`. See the
full example in `parameters_derive.rs`.
2023-09-22 08:42:29 +02:00
Martin Dahl 1c22daf8a9 Update readme. 2023-09-07 13:34:00 +02:00