Robotics StackExchange | Archived questions

How do I write a code to move Husky robot in gazebo?

I am new to ROS and Gazebo. I have to move 2 robots in a square path simulataneously. To launch 2 Husky robots, I used namespace in the launch file. But I am unable to figure out on how to write a code to move these 2 robots. If not for 2 robots, it would be good if you can tell me how to move 1 Husky robot using code? I am using ROS-Indigo with Gazebo-2.2.2 version on Ubuntu 14.04.

Asked by Pikachu on 2016-06-13 07:14:19 UTC

Comments

Answers

You may need to take this tutorial on controlling the turtlebot (simulated) first.

http://wiki.ros.org/ROS/Tutorials/UnderstandingTopics

The concept is to Publish the "Command Velocity" Message to control the robot if the gazebo had already provided the node that running on ROS as a simulated running robot .

Asked by C3MX on 2016-06-14 14:52:14 UTC

Comments

Since Husky publishes to topic /cmd_vel, you can learn how is done with teleop_twist_keyboard:

http://wiki.ros.org/teleop_twist_keyboard

sudo apt-get install ros-noetic-teleop-twist-keyboard

rosrun teleop_twist_keyboard teleop_twist_keyboard.py

If you are interested in how the python file works, check the repo:

https://github.com/ros-teleop/teleop_twist_keyboard

Link to teleop_twist_keyboard.py code:

https://github.com/ros-teleop/teleop_twist_keyboard/blob/master/teleop_twist_keyboard.py

Hope this helps.

Asked by osilva on 2021-09-11 17:40:02 UTC

Comments