0
$\begingroup$

Rosanswers logo

Hello

I have a robot that is supposed to navigate autonomously, i decided to use the navigation stack in ROS. but i feel lost ! i do not know how to start with it. i already read its tutorials but i can not understand how to apply it to my robot.


specifically the tutorial is not clear for me in the following points


from the beginning how to write the tf for my robot is it only about base_link to base_laser ? and if my URDF is written, how to use it for tf ? ,, next thing i wrote the laser node, the IMU node, the GPS .. separately i did not get how to use them with navigation stack


so i need clear steps to start with navigation stack please.


Originally posted by marawy_alsakaf on ROS Answers with karma: 101 on 2017-10-27

Post score: 2


Original comments

Comment by jayess on 2017-10-27:
What specifically about the tutorials is not clear? Also, it takes a few readings for the tutorials to start to sink in (at least that's how it was for me).

Comment by marawy_alsakaf on 2017-10-27:
@jayess from the beginning how to write the tf for my robot is it only about base_link to base_laser ? my URDF is written, how to use it for tf ? ,, next thing i wrote the laser node, the IMU node, the GPS .. separately i did not get how to use them with navigation stack

Comment by psammut on 2017-10-28:
I highly recommend these tutorials on youtube: https://www.youtube.com/watch?v=8ckSl4MbZLg&list=PLTEmcYHVE7dPWixFnzkd68jPjwGzxHjUG

Comment by marawy_alsakaf on 2017-10-29:
@psammut is it the same steps for real robot or for Gazebo

Comment by R. Tellez on 2017-10-30:
I recommend the following video tutorials:

  1. creation of robot URDF.
  2. TF understanding

For understanding the use of sensors with navigation stack, check the courses at http://www.robotigniteacademy.com

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

To get the urdf specification to be published in the tf tree. Your robot needs to output a sensor_msgs::JointState message which gives the description of all the states in your robot's joints.The names used in the jointstate should correspond to the names used for your joints in the urdf model. Include in your roslaunch a state_publisher node from the robot_state_publisher package. It will subscribe to your jointstate message, read the robot description off the parameter server and publish the tf tree correctly.

<!-- Convert an xacro and put on parameter server -->
<param name="robot_description" command="$(find xacro)/xacro.py '$(find asp_platform)/urdf/asp.xacro'" />

<node name="robot_state_publisher" pkg="robot_state_publisher" type="state_publisher" />

In general your robot needs to respond to a geometry_msgs::twist message published on the output of the navigation stack as the /cmd_vel topic. That is it should be able to be remotely controlled with linear.x as forward and backward and angular.z as rotation for a 2D non-holonomic robot. The robot should also output some sort of estimation of its position, typically via a nav_messages::odometry message which can be used by localisation routines such as amcl combined with some sensor data ie from your laser, to get a good estimate of position.

Once your robot can respond to cmd_vel twist messages, output its pose at least as a odometry message and you have the appropriate localisation routines to get a good estimate of pose and the full tf tree is available via the robot_state_publisher or other methods (you can output the tfs directly if you like) then you should have every thing you need to start using the planners available in the navigation stack.

have fun.


Originally posted by PeterMilani with karma: 1493 on 2017-10-27

This answer was ACCEPTED on the original site

Post score: 3


Original comments

Comment by marawy_alsakaf on 2017-11-04:
ok, "Your robot needs to output a sensor_msgs::JointState message" from where i am supposed to get Jointstate message is it from the URDF ? or from encoders and IMU ?

Comment by PeterMilani on 2017-11-08:
No your robot needs to generate this. This usually (But not always) means writing a driver to communicate with the hardware of your robot, and then publish this on a ros topic. Or if you are running a simulation you need to publish this message with data from your simulation.

$\endgroup$

Your Answer

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