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

[ros2] new package ros_ign_interfaces, provide some Ignition-specific ROS messages. #152

Merged
merged 5 commits into from
May 18, 2021

Conversation

gezp
Copy link
Contributor

@gezp gezp commented May 4, 2021

This is migration of gazebo_ros_pkgs/gazebo_msgs for Ignition to provide some Ignition-specific ROS messages.

This package is necessary to implement some functions like this #70 .

@gezp gezp requested a review from chapulina as a code owner May 4, 2021 08:01
@chapulina chapulina added the ROS 2 ROS 2 label May 4, 2021
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

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

Thank you for the PR! I think this is an opportunity to improve on the message definitions from gazebo_msgs, otherwise we could just depend on that package.

Some thoughts:

  • The messages should match ign-msgs as much as possible, for seamless integration. This includes matching message names and fields.
  • We should remove textual debug fields like info and status_message, which aren't a standard practice on ROS and just make the messages larger. This kind of information can go into console logging instead. It's also difficult to standardize textual status messages so the receiver knows what to expect.

<description>Message and service data structures for interacting with Ignition from ROS2.</description>
<license>Apache 2.0</license>
<maintainer email="[email protected]">Louise Poubel</maintainer>

Copy link
Contributor

Choose a reason for hiding this comment

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

Feel free to add yourself as author 😉

@@ -0,0 +1,8 @@
string info # text info on this contact
Copy link
Contributor

Choose a reason for hiding this comment

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

I know the message on gazebo_msgs has the info field, which is filled with debug information, but I believe this isn't a good practice. It makes the message larger and doesn't add any new information.

How about removing the field?

@@ -0,0 +1,11 @@
bool pause
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind documenting all the fields in the message? Let's try to do better than ign-msgs 😬

@@ -0,0 +1,11 @@
bool pause
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mind calling this message WorldControl to match ignition::msgs::WorldControl?

@@ -0,0 +1,5 @@
string name # Name of the Ignition Gazebo entity to be deleted.
uint8 type # Type: Model or Light
Copy link
Contributor

Choose a reason for hiding this comment

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

How about adding an entity message like ignition::msgs::Entity and using it here? Using the same pattern as Ignition should make it easier to maintain. It's also easier to only update one messsage if we add new entity types.

string collision1_name # name of contact collision1
string collision2_name # name of contact collision2
geometry_msgs/Wrench[] wrenches # list of forces/torques
geometry_msgs/Wrench total_wrench # sum of forces/torques in every DOF
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd also suggest removing the total_wrench field, because it doesn't add new information. The receiver can calculate it if they need it.

geometry_msgs/Wrench[] wrenches # list of forces/torques
geometry_msgs/Wrench total_wrench # sum of forces/torques in every DOF
geometry_msgs/Vector3[] contact_positions # list of contact position
geometry_msgs/Vector3[] contact_normals # list of contact normals
Copy link
Contributor

Choose a reason for hiding this comment

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

Prefixing these fields with contact_ feels redundant.

geometry_msgs/Wrench total_wrench # sum of forces/torques in every DOF
geometry_msgs/Vector3[] contact_positions # list of contact position
geometry_msgs/Vector3[] contact_normals # list of contact normals
float64[] depths # list of penetration depths
Copy link
Contributor

Choose a reason for hiding this comment

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

I'd suggest changing the name of this message to Contact so it matches ignition::msgs::Contact.

@@ -0,0 +1,12 @@
string name # New name for the entity, overrides the name on the SDF
Copy link
Contributor

Choose a reason for hiding this comment

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

How about renaming this message to EntityFactory so it matches ign-msgs?

gezp added 2 commits May 5, 2021 09:21
@gezp
Copy link
Contributor Author

gezp commented May 5, 2021

According to above advice, I modified and added the definition of message to make them match ign-msgs .

Signed-off-by: gezp <[email protected]>
@gezp
Copy link
Contributor Author

gezp commented May 10, 2021

@chapulina
hi, i have modified my PR, could you review again? after this PR completed, I could try to implement service bridge.

Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

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

Some style nits

find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)


Copy link
Collaborator

Choose a reason for hiding this comment

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

nit:

Suggested change


## Messages (.msg)

* [Contact](msg/Contact.msg) : related to [ignition::msgs::Contact](https://github.com/ignitionrobotics/ign-msgs/blob/ign-msgs7/proto/ignition/msgs/contact.proto). Contant info bewteen collisions in Ignition Gazebo.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same below

Suggested change
* [Contact](msg/Contact.msg) : related to [ignition::msgs::Contact](https://github.com/ignitionrobotics/ign-msgs/blob/ign-msgs7/proto/ignition/msgs/contact.proto). Contant info bewteen collisions in Ignition Gazebo.
* [Contact](msg/Contact.msg): related to [ignition::msgs::Contact](https://github.com/ignitionrobotics/ign-msgs/blob/ign-msgs7/proto/ignition/msgs/contact.proto). Contant info bewteen collisions in Ignition Gazebo.

@@ -0,0 +1,13 @@
#Entity type: constant definition
uint8 NONE = 0
Copy link
Collaborator

Choose a reason for hiding this comment

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

can you indent the default values at the same level ?

Comment on lines 11 to 13
uint64 id #Entity unique identifier accross all types. Defaults to 0
string name #Entity name, which is not guaranteed to be unique.
uint8 type #Entity type.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
uint64 id #Entity unique identifier accross all types. Defaults to 0
string name #Entity name, which is not guaranteed to be unique.
uint8 type #Entity type.
uint64 id # Entity unique identifier accross all types. Defaults to 0
string name # Entity name, which is not guaranteed to be unique.
uint8 type # Entity type.

@@ -0,0 +1,8 @@
bool pause # paused state.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Start comment with a Upper case ( in all msgs )

Suggested change
bool pause # paused state.
bool pause # Paused state.

@ahcorde ahcorde merged commit fff2dbf into gazebosim:ros2 May 18, 2021
chapulina pushed a commit that referenced this pull request Jul 20, 2021
… ROS messages. (#152)

* add new package ros_ign_interfaces,provide some Ignition-specific ros .msg and .srv files

Signed-off-by: gezp <[email protected]>

* modify to match ign-msgs

Signed-off-by: gezp <[email protected]>

* add author info

Signed-off-by: gezp <[email protected]>

* modify comments

Signed-off-by: gezp <[email protected]>

* update code and doc style

Signed-off-by: gezp <[email protected]>
ahcorde pushed a commit that referenced this pull request Jul 20, 2021
… ROS messages. (#152)

* add new package ros_ign_interfaces,provide some Ignition-specific ros .msg and .srv files

Signed-off-by: gezp <[email protected]>

* modify to match ign-msgs

Signed-off-by: gezp <[email protected]>

* add author info

Signed-off-by: gezp <[email protected]>

* modify comments

Signed-off-by: gezp <[email protected]>

* update code and doc style

Signed-off-by: gezp <[email protected]>
@gezp gezp mentioned this pull request Jan 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ROS 2 ROS 2
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants