-
Notifications
You must be signed in to change notification settings - Fork 368
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using this library with ROS2 #315
Comments
Hi @maxlein, As far as I know, ROS# is not tested with ros2-web-bridge. If only problem is the naming of the message fields, then you can change the field names in the message classes manually on your local fork. For the timestamps in the header, Timer.cs is the corresponding script where you can see the "sec" field. You just need to make the necessary changes, then rebuild the library and replace the dll's on the plugins folder. I hope that the difference in the naming convention is the only problem. Could you please right down your experiences regarding the use of ROS# with ros2-web-bridge? There is a plan to implement ROS2 support for ROS# soon, your experience could help us. |
I only looked at some messages till now and they work with these small fixes: diff --git a/Libraries/RosBridgeClient/BaseMessages/Std/msg/Duration.cs b/Libraries/RosBridgeClient/BaseMessages/Std/msg/Duration.cs
index e7851bb..0db29d5 100644
--- a/Libraries/RosBridgeClient/BaseMessages/Std/msg/Duration.cs
+++ b/Libraries/RosBridgeClient/BaseMessages/Std/msg/Duration.cs
@@ -19,19 +19,19 @@ namespace RosSharp.RosBridgeClient.MessageTypes.Std
{
public const string RosMessageName = "std_msgs/Duration";
- public uint secs { get; set; }
- public uint nsecs { get; set; }
+ public uint sec { get; set; }
+ public uint nanosec { get; set; }
public Duration()
{
- secs = 0;
- nsecs = 0;
+ sec = 0;
+ nanosec = 0;
}
- public Duration(uint secs, uint nsecs)
+ public Duration(uint sec, uint nanosec)
{
- this.secs = secs;
- this.nsecs = nsecs;
+ this.sec = sec;
+ this.nanosec = nanosec;
}
}
}
\ No newline at end of file
diff --git a/Libraries/RosBridgeClient/BaseMessages/Std/msg/Time.cs b/Libraries/RosBridgeClient/BaseMessages/Std/msg/Time.cs
index 5ae121c..525a476 100644
--- a/Libraries/RosBridgeClient/BaseMessages/Std/msg/Time.cs
+++ b/Libraries/RosBridgeClient/BaseMessages/Std/msg/Time.cs
@@ -18,19 +18,19 @@ namespace RosSharp.RosBridgeClient.MessageTypes.Std
public class Time : Message
{
public const string RosMessageName = "std_msgs/Time";
- public uint secs { get; set; }
- public uint nsecs { get; set; }
+ public uint sec { get; set; }
+ public uint nanosec { get; set; }
public Time()
{
- secs = 0;
- nsecs = 0;
+ sec = 0;
+ nanosec = 0;
}
- public Time(uint secs, uint nsecs)
+ public Time(uint sec, uint nanosec)
{
- this.secs = secs;
- this.nsecs = nsecs;
+ this.sec = sec;
+ this.nanosec = nanosec;
}
} |
Hello! My team and I are quite new to ROS and are just starting a project to connect it to Unity which is to be used as a simulator. Initially, our choice was to use ROS2 and make use of the fact that it provides some new functionality and will possibly be a bit more long-term solution. However, upon realising that ROS#, an important tool for connecting the two, does not fully support ROS 2, I am left puzzled on which version of ROS to use. Knowing this, and taking our unfamiliarity with the tools into consideration, would you say that it is better to use ROS1 until ROS# fully supports ROS2 and is tested sufficiently, or to use ROS2 anyways and adapt it as @maxlein suggested? Additionally, @maxlein, did you encounter any additional issues upon implementing this fix, or was that the only problem? Any advice would be immensely appreciated! Thank you in advance! |
No, I had no other issues. Works fine and the fix is easy to implement. |
Thank you for the update, really appreciate it! |
Did you end up writing a guide on this subject? where can I find it? |
Hello everyone, |
Hi, I have now compiled a version of the Visual Studio project that makes it ROS2 compatible. So far I have only looked at the communication itself, so changes to the RosBridgeClient.dll. The MessageGenerator.dll and the URDF.dll might already work for ROS2, but i have not checked that yet. I have created a fork of this repository with a branch called ros2: https://github.com/Skoven/ros-sharp/tree/ros2 The issues fixed where:
I hope that this will be of some help to poor souls like me, that struggle with getting ros-sharp to work with ROS2. |
Hi, I recently discovered this library and really like it so far, the documentation is great, and I've found it very easy to use so far! However, I just noticed that actions are not supported for ros2. Are there any plans to make it up to date with the advances in rosbridge_suite, for action support in ros2 (see RobotWebTools/rosbridge_suite#886)? Thanks! |
Hi @Dabuss, Thank you for your interest. It's good to hear that you like it and find it easy to use. Yes, we are planning to add support for ROS2 actions. We didn't include it in the update because the way actions are handled has changed considerably from ROS1 to ROS2 and we want to take our time to implement it as properly as possible. I can't give you an estimated date for action support at the moment, but it's in our todo list. |
I am not sure if this is a bug or just not supported.
But as the timestamp msg has changed from "sec" to "secs" I can only use the ROS1 bridge and not the ROS2 version -> ros2-web-bridge
Is this something known, or in the pipeline?
The text was updated successfully, but these errors were encountered: