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

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

asked 2016-06-13 07:14:19 -0500

Pikachu gravatar image

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.

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
0

answered 2021-09-11 17:40:02 -0500

osilva gravatar image

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

http://wiki.ros.org/teleop_twist_keyb...

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_...

Link to teleop_twist_keyboard.py code:

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

Hope this helps.

edit flag offensive delete link more
0

answered 2016-06-14 14:52:14 -0500

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

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

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 .

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2016-06-13 07:14:19 -0500

Seen: 1,618 times

Last updated: Sep 11 '21