ros-simulation / gazebo_ros_pkgs

Wrappers, tools and additional API's for using ROS with Gazebo
http://wiki.ros.org/gazebo_ros_pkgs
783 stars 773 forks source link

[ros2] gazebo_ros_api_plugin split #779

Open chapulina opened 6 years ago

chapulina commented 6 years ago

The gazebo_ros_api_plugin is quite large and offers a lot of functionality all at once. While porting it to ROS 2, it would be nice to take the opportunity to also break that plugin into smaller ones so that:

See the table below for a proposal of a split based on what kind of entity (model / link / joint / etc) an API targets.

I also considered a split which takes into account whether an API provides access to ground truth that wouldn't be available in the real world, or whether it allows altering simulation with a god's hand, i.e. in a way a robot wouldn't be able to in the real world. But after marking the API below with these 2 characteristics (to the best of my knowledge), it became clear to me that they really go hand-in-hand, and maybe the most useful approach would make each API disable-able within their plugins.

Another question I have is whether the new plugins should be in gazebo_plugins instead of gazebo_ros.

API Ground truth God's hand Proposed category Comments
apply_joint_effort   gazebo_ros_force_system :heavy_check_mark: #941 
clear_joint_forces   gazebo_ros_force_system :heavy_check_mark: #941 
get_joint_properties     gazebo_ros_properties :heavy_check_mark: #868 #972
set_joint_properties   gazebo_ros_properties  :heavy_check_mark: #868 #972
         
clear_body_wrenches   gazebo_ros_force_system  :heavy_check_mark: #941
apply_body_wrench   gazebo_ros_force_system :heavy_check_mark: #941
link_states   gazebo_ros_state  :heavy_check_mark: #969
get_link_properties     gazebo_ros_properties  :heavy_check_mark: #868 #972
set_link_properties   gazebo_ros_properties  :heavy_check_mark: #868 #972
get_link_state   gazebo_ros_state :heavy_check_mark: #839
set_link_state   gazebo_ros_state :heavy_check_mark: #839
         
model_states   gazebo_ros_state :heavy_check_mark: #968
get_model_state   gazebo_ros_state :heavy_check_mark: #839
set_model_state   gazebo_ros_state :heavy_check_mark: #839
set_model_configuration   ?  Maybe this belongs to joint?
get_model_properties   gazebo_ros_properties  :heavy_check_mark: #868 #972
         
get_world_properties     gazebo_ros_properties  :warning: Deprecated, use get_model_list
get_physics_properties     gazebo_ros_properties :construction: #973
set_physics_properties   gazebo_ros_properties :construction: #973
         
get_light_properties gazebo_ros_properties :heavy_check_mark: #868 #972
set_light_properties gazebo_ros_properties :heavy_check_mark: #868 #972
spawn_sdf_model   gazebo_ros_factory :heavy_check_mark: #808
spawn_urdf_model   gazebo_ros_factory :heavy_check_mark: #808
delete_light   gazebo_ros_factory :heavy_check_mark: #808
delete_model   gazebo_ros_factory :heavy_check_mark: #808
         
clock     gazebo_ros_init :heavy_check_mark: #794
pub_clock_frequency gazebo_ros_init :heavy_check_mark: #794
unpause_physics   gazebo_ros_init :heavy_check_mark: #866
pause_physics   gazebo_ros_init :heavy_check_mark: #866
reset_simulation   gazebo_ros_init :heavy_check_mark: #866
reset_world   gazebo_ros_init :heavy_check_mark: #866
enable_ros_network :warning: Deprecated, just remove the undesired plugins
kev-the-dev commented 6 years ago

A couple ideas I have for the port:

Otherwise this splitting looks good to me! It makes sense to me to just put all the plugins (including the sensors, etc) into gazebo_ros and not reintroduce gazebo_plugins.

chapulina commented 6 years ago

Started a migration page: ROS 2 Migration: gazebo_ros_api_plugin

chapulina commented 6 years ago

Migration page for spawn / delete: ROS 2 Migration: Spawn and delete

chapulina commented 6 years ago

I was thinking of dividing plugins into state and properties instead of by entity type (link / joint / model / world). I'm also inclined to deprecate apply/clear_body_wrench, since they duplicate gazebo_ros_force.

Thoughts, @j-rivero ?

j-rivero commented 6 years ago

I was thinking of dividing plugins into state and properties instead of by entity type (link / joint / model / world).

I can find more use cases for diving them into state and properties than by having them divided by type, so +1.

I'm also inclined to deprecate apply/clear_body_wrench, since they duplicate gazebo_ros_force.

I have no experience with both so can not comment anything against the removal.

nzlz commented 5 years ago

I would be interested in having properties migrated to ros2, in a gazebo_ros_properties plugin I guess. Please let me know if anyone is already doing this work, otherwise I can try to do it myself. Update: followed at PR https://github.com/ros-simulation/gazebo_ros_pkgs/pull/868.

leander2189 commented 2 years ago

Regarding SetModelConfiguration service, is it already ported to ROS2?

If it isn't I might be able to do it, as I need it for my current project