Skip to content
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

Porting to ROS2 #48

Merged
merged 14 commits into from Oct 15, 2020
Merged

Porting to ROS2 #48

merged 14 commits into from Oct 15, 2020

Conversation

RoboticsYY
Copy link

@RoboticsYY RoboticsYY commented Aug 4, 2020

This PR intends to port the warehouse_ros package to ROS2.

The migration involves:

  • Porting CMakeLists.txt and package.xml to ROS2.
  • Migrating tf to tf2.
  • Migrating `ROS time and duration to tf2 time_point and duration.
  • Implementing ROS2 log print.
  • Implementing ROS2 message serialization.
  • Implementing ROS2 message traits to get message type info.
  • Using OpenSSL interface to get the MD5Sum string of message.

@RoboticsYY RoboticsYY mentioned this pull request Aug 9, 2020
@RoboticsYY RoboticsYY force-pushed the pr-ros2 branch 4 times, most recently from 1287a10 to 09c78ea Compare August 9, 2020 09:01
@RoboticsYY RoboticsYY changed the title [WIP] Porting to ROS2 Porting to ROS2 Aug 12, 2020
Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I left some comments to clarify

.travis.yml Outdated Show resolved Hide resolved
include/warehouse_ros/impl/message_collection_impl.hpp Outdated Show resolved Hide resolved
src/transform_collection.cpp Outdated Show resolved Hide resolved
const std::string md5 = Md5().value();
const std::string datatype = rosidl_generator_traits::data_type<M>();
// TODO: Get MD5Sum value
// typedef typename ros::message_traits::MD5Sum<M> Md5;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure if md5 will be supported and also I didn't see any other corresponding trait. But it seems like hashing is critical here. Couldn't we just hash the serialized message type string using std::hash https://en.cppreference.com/w/cpp/utility/hash?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea! I found a method from openssl to get the md5sum string from the message type. But I think this is still not equal to the function on ros1 that returns the hash number of the message definition. I'm not sure if this is enough for the application.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me! Are you sure this is different? ROS1 also seems to hash the message type, but then again this check should actually compare if the message definition matches. For now this should work though, as this should really just protect against using mismatching message versions. Maybe we could throw a warning about this.

@RoboticsYY RoboticsYY force-pushed the pr-ros2 branch 8 times, most recently from d29dc9a to 2ce731d Compare August 23, 2020 10:48
Copy link
Member

@henningkayser henningkayser left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@RoboticsYY Looks good to me, if you think this is ready I'll merge this.

@RoboticsYY RoboticsYY force-pushed the pr-ros2 branch 3 times, most recently from a0ee1f7 to 506449f Compare October 10, 2020 02:44
.travis.yml Outdated
@@ -1,6 +1,6 @@
# This config file for Travis CI utilizes https://github.com/ros-planning/moveit_ci/ package.
sudo: required
dist: trusty
dist: xenial
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
dist: xenial
dist: bionic

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not critical, though

@henningkayser
Copy link
Member

@RoboticsYY These are really a lot of commits. Are you planning to group them in chunks? Otherwise I would squash-merge

@RoboticsYY
Copy link
Author

@henningkayser It's OK for me to make a squash-merge.

@henningkayser henningkayser merged commit 4650924 into moveit:ros2 Oct 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants