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] Port gazebo_ros_path plugin to ROS2 #925

Merged
merged 4 commits into from
Aug 11, 2019

Conversation

shiveshkhaitan
Copy link

Port gazebo_ros_paths_plugin plugin to ROS2.

To export a model, plugin or media file, a package needs to export them from package.xml e.g.

<export>
    <gazebo_ros gazebo_model_path="${prefix}/models"/>
    <gazebo_ros gazebo_media_path="${prefix}/models"/>
</export>

The directory also needs to be installed from CMakeLists.txt e.g.

install(DIRECTORY models
          DESTINATION share/${PROJECT_NAME})

The plugin is directly included in gazebo.launch.py launch file.

@chapulina chapulina self-assigned this May 21, 2019
@chapulina chapulina added the ros2 label May 21, 2019
Copy link
Contributor

@sloretz sloretz left a comment

Choose a reason for hiding this comment

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

With a few changes this mostly works for me. I tested with model and world/media path. I did not try adding a plugin path.


world_argument = launch.actions.DeclareLaunchArgument(
'world',
default_value='worlds/empty.world')
Copy link
Contributor

Choose a reason for hiding this comment

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

The default value could be an empty string. This way we're sure we're using Gazebo's default value, in case that ever changes.

@chapulina
Copy link
Contributor

@shiveshkhaitan , mind rebasing this and adding a migration guide? Thanks!

@shiveshkhaitan
Copy link
Author

Porting gazebo_ros launch scripts might require some changes in this. Can we wait for the scripts before merging this?

@chapulina
Copy link
Contributor

Can we wait for the scripts before merging this?

SGTM

@shiveshkhaitan
Copy link
Author

I have removed the gazebo launch part as gazebo_ros_paths was originally supposed to be a plugin. The plugin is now available as a python script which can be used by other launch files gzclient, gzserver

@chapulina
Copy link
Contributor

@shiveshkhaitan , can you rebase against the latest ros2 branch? (And we shouldn't forget to backport to dashing). This branch doesn't currently build:

/home/developer/ros2_ws/src/ros-simulation/gazebo_ros_pkgs/gazebo_ros/src/node.cpp: In static member function 'static gazebo_ros::Node::SharedPtr gazebo_ros::Node::Get(sdf::ElementPtr)':
/home/developer/ros2_ws/src/ros-simulation/gazebo_ros_pkgs/gazebo_ros/src/node.cpp:82:16: error: 'class rclcpp::NodeOptions' has no member named 'initial_parameters'
   node_options.initial_parameters(initial_parameters);
                ^~~~~~~~~~~~~~~~~~

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.

LGTM.

@shiveshkhaitan , we just need a migration guide and a backport to dashing.

@chapulina chapulina merged commit fa923b2 into ros-simulation:ros2 Aug 11, 2019
chapulina pushed a commit that referenced this pull request Aug 11, 2019
* [ros2] Port gazebo_ros_path plugin

* Minor fixes

* Change plugin launch file to python script

* Fix for flake8 test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants