0
$\begingroup$

Rosanswers logo

Hello,

I am new to ROS (I am using ROS Kinetic) and Gazebo and so far what I have managed to do are the following:

  • Create a URDF model of a 4 wheel robot with a camera on top, a base_link and 4 continuous joints (connecting the wheels with the base_link) with controllers,transmissions and actuators on each one. I also created the appropriate configuration yaml file for the control of my robot.
  • Create launch files for rviz and gazebo and successfully display my robot in these environments.
  • Get image from the camera plugin I added, in gazebo.

My next step is to move my robot. I searched this tutorial, but it is not what I am looking and I am kind of lost right now. I also checked the MoveIt C++ beginner tutorial, but it is referring to the PR2 robot and it doesn't help me to start something on my own and build from it.

To be more specific, what I am thinking of doing next is to create nodes (the motors of the robot and the camera) and according to what image I get from the camera, I would send an appropriate command to the motors to either stop or move on, but I cannot find a tutorial that could help me with that. Even a tutorial with simple movement of a robot could help me, i.e. sending to a motor-node to move forward and simulate this movement in gazebo. If you know a tutorial that could be useful for me to start from, I would appreciate your help.

Thanks for your answers and for your time in advance.


Originally posted by patrchri on ROS Answers with karma: 354 on 2016-07-21

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

The RobotSetup navigation tutorial (http://wiki.ros.org/navigation/Tutorials/RobotSetup) is a good place to start. In particular, the diagram in section 1 of that page shows the relationship between the navigation planners (the box in the middle) and the controller that will set the speeds of the four wheels.

The output of the local planner is a geometry_msgs/Twist message on the /cmd_vel topic (by default). The controller – which you need to supply – has to convert from the linear x velocity and the angular z velocity to wheel speeds for the four motors. You don't specify much about the hardware, so I don't know which direction to point you. There are packages in ROS such as ros_control that are configurable to talk to different hardware. On my robot there is an Arduino-compatible board that controls the motors for a differential-drive robot, so I'm using instead the ros_arduino_bridge package as the controller. (Other options for my case include rosserial_arduino.)

Once you have a controller in place that listens on the /cmd_vel topic, you can send those messages either using rostopic pub or using a panel in rviz. After you get the controller working you will then need to set up the planners, probably using move_base.


Originally posted by Mark Rose with karma: 1563 on 2016-07-21

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by patrchri on 2016-07-22:
I have added controller_manager and hardware_interface from the ros_control metapackage, taken from this tutorial. But the commands from the tutorial haven't worked for me, so probably in the future I will change them.

Comment by patrchri on 2016-07-22:
I wanted to ask you about the link you sent me. In the section 2.1 Creating a Package it says: catkin_create_pkg my_robot_name_2dnav move_base my_tf_configuration_dep my_odom_configuration_dep my_sensor_configuration_dep

Comment by patrchri on 2016-07-22:
Could you please explain me what kind of dependencies it requires. I am referring to my_tf_configuration_dep my_odom_configuration_dep my_sensor_configuration_dep . What packages should I search for? Thanks for answering and for your time again.

Comment by Mark Rose on 2016-07-22:
All but move_base are example dependencies that you might have. The three envisioned packages are: URDF for frame defs (my_tf_configuration_dep), robot controller (my_odom_configuration_dep), and sensor publisher (my_sensor_configuration_dep). You could put all in the new package instead.

Comment by Mark Rose on 2016-07-22:
In that case, your package creation would be just: catkin_create_pkg my_robot_name_2dnav move_base

Comment by Mark Rose on 2016-07-22:
Now, what packages should you search for: you need something that provides a robot controller (listening on /cmd_vel, publishing on /odom) and something that publishes either PointCloud or LaserScan. What you need depends on your hardware.

Comment by patrchri on 2016-07-22:
So to sum up what I need to is:

  • catkin_create_pkg my_robot_name_2dnav move_base roscpp
  • Create a publisher on the /cmd_vel topic (at my_robot_name_2dnav/src/publisher.cpp)
  • Put the controllers I have on my motors to listen to it (create a listener.cpp)
  • Simulate it in gazebo

Correct?

Comment by patrchri on 2016-07-22:
My comment refers to just move my robot...I will forget about the sensor for now.

Comment by Mark Rose on 2016-07-23:
Yes, the robot controller (one or more nodes) should listen on /cmd_vel and command the motors, and then publish the robot position on /odom. Once you get sensors, publish a PointCloud or LaserScan.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.