ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Tracked Vehicle cmd_vel topic ROS2

asked 2023-06-19 08:52:12 -0500

bafhcs gravatar image

Hi there,

I'm using ROS2 Humble on Ubuntu 22.04

i want to simulate a tracked Vehicle in Gazebo with the "libSimpleTrackedVehiclePlugin.so". Everything works fine in gazebo. I can control the Robot with the libKeysToCmdVelPlugin.so. But i can't control the robot by publishing the cmd_vel topic in ROS2. I already found this: https://github.com/lprobsth/gazebo_ro...

Unfortunately this package ist for ROS not for ROS2. Is it possilbe to convert it in a ROS2 package? I'm on the very beginning on my ROS career, sorry...

Thank you very much

edit retag flag offensive close merge delete

Comments

Sure, its always possible to convert a ROS 1 package to ROS 2.

stevemacenski gravatar image stevemacenski  ( 2023-06-19 14:09:49 -0500 )edit

i already startet to convert in to ROS2. For me its very difficult because i have only few experience. I created a new ROS2 branch and forked the repo. I would be very thankful if we work together on this project https://github.com/fab-sch/gazebo_ros...

bafhcs gravatar image bafhcs  ( 2023-06-19 14:44:39 -0500 )edit

I don't think you need to port that package. I think you can use the ros gazebo brigde.

jrtg gravatar image jrtg  ( 2023-06-20 05:40:31 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2023-06-20 07:07:29 -0500

jrtg gravatar image

I tested it, it is fairly easy with the ros_gz_bridge:

  1. Start the simulation: gz sim ./tracked_vehicle_simple.sdf (or ign sim ... depending on the Gazebo version)

  2. In another terminal, start the bridge:

    ros2 run ros_gz_bridge parameter_bridge /model/simple_tracked/cmd_vel@geometry_msgs/msg/Twist]gz.msgs.Twist


  3. Publish Twist messages from your ROS node, or e.g. from the cli:

    ros2 topic pub /model/simple_tracked/cmd_vel geometry_msgs/msg/Twist "linear: { x: 1 }"


Note that, depending on your Gazebo version, you might have to write gz.msgs.Twist in step 2, or ignition.msgs.Twist as 'ignition' was renamed to 'gz' starting from Gazebo Garden.

Note also that gz topic -l currently _does not_ list topics to which there is no active publisher. If you're not sure to which topic you should publish, start the simulation with option '-v 4', e.g. gz sim ./tracked_vehicle_simple.sdf -v 4 and typically it will be mentioned in the debug output.

edit flag offensive delete link more
0

answered 2023-06-20 07:55:06 -0500

bafhcs gravatar image

updated 2023-06-20 07:56:21 -0500

thank you very much!! i just updated to gazebo garden because i had Gazebo 11 installed. Unfortunately gz sim crashes immediatley after the start...

xxx@LIFEBOOK:~$ gz sim Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway. terminate called after throwing an instance of 'Ogre::RenderingAPIException' what(): OGRE EXCEPTION(3:RenderingAPIException): Vertex Program 100000000VertexShader_vs failed to compile. See compile log above for details. in GLSLShader::compile at ./RenderSystems/GL3Plus/src/GLSL/OgreGLSLShader.cpp (line 361) Stack trace (most recent call last) in thread 6364: 10 Object "[0xffffffffffffffff]", at 0xffffffffffffffff, in 9 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f6f45d269ff, in 8 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f6f45c94b42, in 7 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f6f3f49199d, in 6 Object "/lib/x86_64-linux-gnu/libQt5Core.so.5", at 0x7f6f3f48ff90, in qTerminate() 5 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f6f414ae2b6, in std::terminate() 4 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f6f414ae24b, in 3 Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7f6f414a2bbd, in 2 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f6f45c287f2, in abort 1 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f6f45c42475, in raise 0 Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x7f6f45c96a7c, in pthread_kill

edit flag offensive delete link more

Comments

I don't know.

Try the following command: gz sim -v 4 --render-engine ogre2 and see if it either works or if there is more info in the debug output.

Alternatively, try with an sdf, e.g. gz sim -v 4 minimal_scene.sdf

jrtg gravatar image jrtg  ( 2023-06-23 02:47:06 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2023-06-19 08:51:07 -0500

Seen: 654 times

Last updated: Jun 20 '23