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

commented May 21, 2019

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

@sloretz
Copy link

left a comment

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.

gazebo_ros/launch/gazebo.launch.py Outdated Show resolved Hide resolved
gazebo_ros/launch/gazebo.launch.py Outdated Show resolved Hide resolved
gazebo_ros/launch/gazebo.launch.py Outdated Show resolved Hide resolved
gazebo_ros/launch/gazebo.launch.py Outdated Show resolved Hide resolved
gazebo_ros/launch/gazebo.launch.py Outdated Show resolved Hide resolved
gazebo_ros/launch/gazebo.launch.py Outdated Show resolved Hide resolved

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

This comment has been minimized.

Copy link
@chapulina

chapulina Jul 9, 2019

Contributor

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

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

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

@shiveshkhaitan

This comment has been minimized.

Copy link
Author

commented Jul 11, 2019

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

@chapulina

This comment has been minimized.

Copy link
Contributor

commented Jul 11, 2019

Can we wait for the scripts before merging this?

SGTM

@shiveshkhaitan

This comment has been minimized.

Copy link
Author

commented Jul 19, 2019

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

This comment has been minimized.

Copy link
Contributor

commented Aug 2, 2019

@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);
                ^~~~~~~~~~~~~~~~~~

@shiveshkhaitan shiveshkhaitan force-pushed the shiveshkhaitan:gazebo_ros_path branch from 4ac9951 to 4f8e774 Aug 3, 2019

@chapulina
Copy link
Contributor

left a comment

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 added a commit that referenced this pull request Aug 11, 2019
[ros2] Port gazebo_ros_path plugin to ROS2 (#925)
* [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
Projects
None yet
3 participants
You can’t perform that action at this time.