gym_gazebo2安装
环境
ubuntu18, ros1-melodic & ros2-dashing, gazebo-9.19.0
安装过程
主要参考了gym_gazebo2的安装教程以及gazebo的安装教程(因为需要安装高于gazebo9.9.0的版本)还有如何安装gazebo_ros_pkgs(重点)。
Errors
1. launch_testing_ament_cmakeConfig.cmake
描述
Could not find a package configuration file provided by
"launch_testing_ament_cmake" with any of the following names:
launch_testing_ament_cmakeConfig.cmake
launch_testing_ament_cmake-config.cmake
Add the installation prefix of "launch_testing_ament_cmake" to
CMAKE_PREFIX_PATH or set "launch_testing_ament_cmake_DIR" to a directory
containing one of the above files. If "launch_testing_ament_cmake"
provides a separate development package or SDK, be sure it has been
installed.
Solution:
sudo apt install ros-dashing-launch*
Refer: link
2. gazebo_ros_pkgs
描述
--- stderr: gazebo_ros
In file included from /home/matthew/ros2_mara_ws/src/gazebo_ros_pkgs/gazebo_ros/src/node.cpp:15:0:
/home/matthew/ros2_mara_ws/src/gazebo_ros_pkgs/gazebo_ros/include/gazebo_ros/node.hpp:134:28: error: ‘OnSetParametersCallbackHandle’ in namespace ‘rclcpp::node_interfaces’ does not name a type
rclcpp::node_interfaces::OnSetParametersCallbackHandle::SharedPtr param_change_callback_handler_;
...
Solution:
可见是版本有问题,解决办法如下:
cd ~/ros2_mara_ws # 进入工作空间
#下面这两步相当于是git下来gazebo_ros_pkgs源码,如果因为按照github教程操作而已经存在*gazebo_ros_pkgs*包了,那么可以先把gazebo_ros_pkgs文件夹删除
wget https://raw.githubusercontent.com/ros-simulation/gazebo_ros_pkgs/ros2/gazebo_ros_pkgs.repos
vcs import src < gazebo_ros_pkgs.repos
vcs custom --args checkout dashing #这是重点,错误就是来自版本不匹配
rosdep install --from-paths src --ignore-src -r -y
colcon build --merge-install --packages-skip individual_trajectories_bridge
至此成功安装。