Robotics StackExchange | Archived questions

How to add Models and Plugins to turtlebot_simulator empty worlds?

I've edited the default turtlebotemptyworld to include the human model I have created. I'm just looking to have it slide forward along the ground for a set distance so the turtlebot can attempt to follow it with the POMDP program I have running.

I'm trying to follow this tutorial but I can't quite work out how to create a plugin, build it and have it work with the turtlebot simulator empty world launch.

Thanks.


Edit:

Would I be able to just add to my model in the .world file:

<plugin filename="libanimate_pose.so" name="pose_animation" />

Then add the cmake file stuff in the turtlebot_gazebo cmake file:

    cmake_minimum_required(VERSION 2.8 FATAL_ERROR)

include (FindPkgConfig)
if (PKG_CONFIG_FOUND)
  pkg_check_modules(GAZEBO gazebo)
endif()
include_directories(${GAZEBO_INCLUDE_DIRS})
link_directories(${GAZEBO_LIBRARY_DIRS})

add_library(animate_pose SHARED animate_pose.cc)
target_link_libraries(animate_pose ${GAZEBO_libraries})

And build and hope it works?


Edit:

The Turtlebot_gazebo Directory doesn't contain a CMakeList.txt so I tried to create one and build but it didn't work surprisingly. I've added the plugin line to the world but it is obviously erroring because the plugin file doesnt exist.

/opt/ros/hydro/share/turtlebot_gazebo/worlds/animate_pose.cc

Asked by Alkaros on 2013-10-13 17:44:49 UTC

Comments

Answers

Ha, that's a cool model! :-)

Actually, you could use a simplified version of the kobuki gazebo plugin - strip everything but the parts linked to processing the velocity commands. Afterwards load that plugin with your model and you should be able to drive that human around just like the Kobuki/TurtleBot.

Probably there is also a simply Gazebo way to do this, e.g. add a joint to your model and use the built-in tools to set the joint's velocity. However, I never did that and hence can't provide much information about it.

Good luck and please report your progress somewhere! Would love to see the TurtleBot following that human.

@edits:

You are not supposed to modify the files installed through debs, i.e. everything in /opt/ros/hydro. Please read the ROS tutorials about creating own packages and workspaces and how to set-up a source install of the turtlebot software first.

Furthermore, when using ROS and Gazebo, I recommend to do one thing at a time. Otherwise you can easily get confused. So, try to get ROS-only and Gazebo-only tutorials/examples running first, before you attempt to mix both. This will give you a better idea about what is actually failing.

Asked by bit-pirate on 2013-10-13 19:13:16 UTC

Comments

I'll let you guys know when I get it done. The tutorial shows how you can give a set of actions to a model and it just moves along the paths/ turns and the likes. If you scroll down to the Animation Plugin section. I'm hoping I can take code similar to that but I'm just not sure how to merge it in.

Asked by Alkaros on 2013-10-13 23:19:11 UTC

I'm working on something similar and I've been having good luck with the Planer Mover Plugin. I've copied the urdf given in the tutorial, spawned the model then sent it /cmd_vel messages and it works well. If you want to do a quick test, here's is the velocity command I've been sending from the terminal:

rostopic pub /cmd_vel geometry_msgs/Twist -r 10000 '[10, 0, 0]' '[0, 0, 5]'

Asked by Angus on 2013-11-16 21:32:02 UTC

Comments