0
$\begingroup$

Rosanswers logo

Hi Everyone,

I've been trying to study ROS for a week now getting no where. I can build pushers listeners and understand basic ROS structure without an issue however Im having issues with how to set up the navigation stack for sensors and odometry. I'm really confused about how to include the packages and package types. Should tf sensors and odometry be implemented by myself in separate packages? If so is there any guideline? The tutorials aren't comprehensive enough for my understanding. I tried to look for how to set these up or find some ready made projects with navigation stack so I could guide myself but couldn't find all. Any help will be extremely appreciated.

Kind regards, Maciej


Originally posted by maciejm on ROS Answers with karma: 33 on 2015-12-02

Post score: 0


Original comments

Comment by jarvisschultz on 2015-12-09:
The turtlebot_navigation package has a few tutorials that allow you to run the full navstack w/ a simulated turtlebot.

Comment by jarvisschultz on 2015-12-09:
The launch files and configuration files in the turtlebot_navigation package would be a good way to see how to configure the navstack.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You need to write your own packages as follows:

1- TF tree publisher: http://wiki.ros.org/navigation/Tutorials/RobotSetup/TF

2- Odometry publisher: http://wiki.ros.org/navigation/Tutorials/RobotSetup/Odom

3- There must be a node subscribing to the "cmd_vel" topic that is capable of taking (vx, vy, vtheta) <==> (cmd_vel.linear.x, cmd_vel.linear.y, cmd_vel.angular.z). To do this you create a subscriber with a call back like follows:

subscriber:

ros::Subscriber sub = n.subscribe("cmd_vel", 1, movecallback);

And the call back would be:

void movecallback(const geometry_msgs::Twist::ConstPtr& vel)
{
  //ROS_INFO("I heard: [%s]", msg->data.c_str());
  geometry_msgs::Twist new_vel = *vel;
  float v = sqrt (new_vel.linear.x * new_vel.linear.x + new_vel.linear.y * new_vel.linear.y);
  float vth = new_vel.angular.z;
  // here you need to send v and vth as linear and angular velocities to your robot
  }

For the rest you need to setup launch files as described here: http://wiki.ros.org/navigation/Tutorials/RobotSetup. You need to also install gmapping to be able to create a map, navigation stack do not work without a map unless you change its default to do slam.

Hope it helps Mohsen


Originally posted by mohsen1989m with karma: 397 on 2015-12-09

This answer was ACCEPTED on the original site

Post score: 1

$\endgroup$

Your Answer

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