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

Turtlebot2 in Gazebo with Melodic #2

Closed
meyerls opened this issue Sep 4, 2019 · 10 comments
Closed

Turtlebot2 in Gazebo with Melodic #2

meyerls opened this issue Sep 4, 2019 · 10 comments
Labels
help wanted Extra attention is needed

Comments

@meyerls
Copy link

meyerls commented Sep 4, 2019

Hello!

I know this might not be a real issue for this repo, but it seems as you guys are the only one talking about ROS Melodic and Turtlebot 2.

I've tried to start gazebo to simply control the turtlebot with the keyboard. So I executed roslaunch turtlebot_gazebo turtlebot _world.launch and roslaunch turtlebot_teleop keyboard_teleop.launch. But it seems as this would not work. Gazebo throws some errors concerning the depth camera etc., but i think this is not the actual problem.

Does anyone can help me?

[ERROR] [1567606707.000028044, 0.190000000]: Failed to load nodelet [/depthimage_to_laserscan] of type [depthimage_to_laserscan/DepthImageToLaserScanNodelet] even after refreshing the cache: According to the loaded plugin descriptions the class depthimage_to_laserscan/DepthImageToLaserScanNodelet with base class type nodelet::Nodelet does not exist. Declared types are depth_image_proc/convert_metric depth_image_proc/crop_foremost depth_image_proc/disparity depth_image_proc/point_cloud_xyz depth_image_proc/point_cloud_xyz_radial depth_image_proc/point_cloud_xyzi depth_image_proc/point_cloud_xyzi_radial depth_image_proc/point_cloud_xyzrgb depth_image_proc/register image_proc/crop_decimate image_proc/crop_nonZero image_proc/crop_non_zero image_proc/debayer image_proc/rectify image_proc/resize image_publisher/image_publisher image_rotate/image_rotate image_view/disparity image_view/image kobuki_bumper2pc/Bumper2PcNodelet kobuki_node/KobukiNodelet kobuki_safety_controller/SafetyControllerNodelet nodelet_tutorial_math/Plus pcl/BAGReader pcl/BoundaryEstimation pcl/ConvexHull2D pcl/CropBox pcl/EuclideanClusterExtraction pcl/ExtractIndices pcl/ExtractPolygonalPrismData pcl/FPFHEstimation pcl/FPFHEstimationOMP pcl/MomentInvariantsEstimation pcl/MovingLeastSquares pcl/NodeletDEMUX pcl/NodeletMUX pcl/NormalEstimation pcl/NormalEstimationOMP pcl/NormalEstimationTBB pcl/PCDReader pcl/PCDWriter pcl/PFHEstimation pcl/PassThrough pcl/PointCloudConcatenateDataSynchronizer pcl/PointCloudConcatenateFieldsSynchronizer pcl/PrincipalCurvaturesEstimation pcl/ProjectInliers pcl/RadiusOutlierRemoval pcl/SACSegmentation pcl/SACSegmentationFromNormals pcl/SHOTEstimation pcl/SHOTEstimationOMP pcl/SegmentDifferences pcl/StatisticalOutlierRemoval pcl/VFHEstimation pcl/VoxelGrid stereo_image_proc/disparity stereo_image_proc/point_cloud2 turtlebot_follower/TurtlebotFollower yocs_cmd_vel_mux/CmdVelMuxNodelet [ERROR] [1567606707.000133371, 0.190000000]: The error before refreshing the cache was: According to the loaded plugin descriptions the class depthimage_to_laserscan/DepthImageToLaserScanNodelet with base class type nodelet::Nodelet does not exist. Declared types are depth_image_proc/convert_metric depth_image_proc/crop_foremost depth_image_proc/disparity depth_image_proc/point_cloud_xyz depth_image_proc/point_cloud_xyz_radial depth_image_proc/point_cloud_xyzi depth_image_proc/point_cloud_xyzi_radial depth_image_proc/point_cloud_xyzrgb depth_image_proc/register image_proc/crop_decimate image_proc/crop_nonZero image_proc/crop_non_zero image_proc/debayer image_proc/rectify image_proc/resize image_publisher/image_publisher image_rotate/image_rotate image_view/disparity image_view/image kobuki_bumper2pc/Bumper2PcNodelet kobuki_node/KobukiNodelet kobuki_safety_controller/SafetyControllerNodelet nodelet_tutorial_math/Plus pcl/BAGReader pcl/BoundaryEstimation pcl/ConvexHull2D pcl/CropBox pcl/EuclideanClusterExtraction pcl/ExtractIndices pcl/ExtractPolygonalPrismData pcl/FPFHEstimation pcl/FPFHEstimationOMP pcl/MomentInvariantsEstimation pcl/MovingLeastSquares pcl/NodeletDEMUX pcl/NodeletMUX pcl/NormalEstimation pcl/NormalEstimationOMP pcl/NormalEstimationTBB pcl/PCDReader pcl/PCDWriter pcl/PFHEstimation pcl/PassThrough pcl/PointCloudConcatenateDataSynchronizer pcl/PointCloudConcatenateFieldsSynchronizer pcl/PrincipalCurvaturesEstimation pcl/ProjectInliers pcl/RadiusOutlierRemoval pcl/SACSegmentation pcl/SACSegmentationFromNormals pcl/SHOTEstimation pcl/SHOTEstimationOMP pcl/SegmentDifferences pcl/StatisticalOutlierRemoval pcl/VFHEstimation pcl/VoxelGrid stereo_image_proc/disparity stereo_image_proc/point_cloud2 turtlebot_follower/TurtlebotFollower yocs_cmd_vel_mux/CmdVelMuxNodelet [FATAL] [1567606707.000422297, 0.190000000]: Failed to load nodelet '/depthimage_to_laserscan of type depthimage_to_laserscan/DepthImageToLaserScanNodelet to manager laserscan_nodelet_manager' [depthimage_to_laserscan-10] process has died [pid 16492, exit code 255, cmd /opt/ros/melodic/lib/nodelet/nodelet load depthimage_to_laserscan/DepthImageToLaserScanNodelet laserscan_nodelet_manager image:=/camera/depth/image_raw scan:=/scan __name:=depthimage_to_laserscan __log:=/home/robonav/.ros/log/db118a78-cf1e-11e9-a8b8-f45c89bf254d/depthimage_to_laserscan-10.log]. log file: /home/robonav/.ros/log/db118a78-cf1e-11e9-a8b8-f45c89bf254d/depthimage_to_laserscan-10*.log

@gaunthan
Copy link
Owner

gaunthan commented Sep 5, 2019

It seems the problem was caused by the lack of "depthimage_to_laserscan/DepthImageToLaserScanNodelet".

Try this

sudo apt install ros-melodic-depthimage-to-laserscan -y

@gaunthan
Copy link
Owner

gaunthan commented Sep 5, 2019

Or maybe this issue will help:rajanya/comprobfall2018-hw3#1

@meyerls
Copy link
Author

meyerls commented Sep 5, 2019

Nice, thanks! sudo apt install ros-melodic-depthimage-to-laserscan -y worked and no errors are thrown.

@meyerls
Copy link
Author

meyerls commented Sep 5, 2019

But the main problem controlling the Turtlebot in gazebo with turtlebot_teleop does not work.

It seems that it publishes to the correct topic (/mobile_base/commands/velocity), but nothing happens in gazebo.

@gaunthan
Copy link
Owner

gaunthan commented Sep 5, 2019

According to the launch file, keyboard_teleop.launch (of turtlebot_teleop)

<launch>
  <!-- turtlebot_teleop_key already has its own built in velocity smoother -->
  <node pkg="turtlebot_teleop" type="turtlebot_teleop_key" name="turtlebot_teleop_keyboard"  output="screen">
    <param name="scale_linear" value="0.5" type="double"/>
    <param name="scale_angular" value="1.5" type="double"/>
    <remap from="turtlebot_teleop_keyboard/cmd_vel" to="cmd_vel_mux/input/teleop"/>
  </node>
</launch>

The messages should be published to topic /cmd_vel_mux/input/teleop, instead of /mobile_base/commands/velocity.

If you expect to receive the messages from /mobile_base/commands/velocity, maybe you need to remap the output topic. Try modify the launch file keyboard_teleop.launch

# <remap from="turtlebot_teleop_keyboard/cmd_vel" to="cmd_vel_mux/input/teleop"/>
<remap from="turtlebot_teleop_keyboard/cmd_vel" to="/mobile_base/commands/velocit"/>

You can use this command to locate the launch file: locate keyboard_teleop.launch

@gaunthan gaunthan added the help wanted Extra attention is needed label Sep 5, 2019
@meyerls
Copy link
Author

meyerls commented Sep 10, 2019

Sadly this does not work. For both cases the messages are published by the correct topic and I checked also if the values are changing. Do you have some hint how to check where the Turtlebot in gazebo is subscribing the turtlebot_teleop_keyboard topic?

@gaunthan
Copy link
Owner

Well, you can use rqt_graph to view active topics.

@meyerls
Copy link
Author

meyerls commented Sep 10, 2019

Oh nice this might be the problem! It seems as mobile_base does not forward the messages to gazebo and Turtlebot_teleop_keyboard doesn't even publish to cmd_vel_mux or mobile_base. Thats strange, both topic print value for roslaunch turtlebot_teleop keyboard_teleop.launch and roslaunch turtlebot_teleop keyboard_teleop.launch. Beside this I am able to control my real Turtlebot with these commands.

rqt_graph_nodes

rqt_graph_nodes_topics

@oscarmendezm
Copy link

The problem appears to be in kobuki_gazebo.urdf.xacro, where the plugin libgazebo_ros_kobuki.so is being loaded. I don't think this actually exists in Melodic, not sure why it doesn't throw an error. You can add it by copying the kobuki_gazebo_plugins folder form here. Once this is compiled, it should start working.

@zouyonghao
Copy link

It works fine after installing kobuki_desktop and yocs_velocity_smoother

And before those, I also install ros-melodic-joy

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants