Closed mathew-kurian closed 9 years ago
This is strange, your Odometry seems to publish the robots real pose in the world, no matter how I set the heading at start. Can you rotate the walls in the Gazebo-Simulation a little bit?
@skasperski You mean the whole map itself?
Yes, the "walls"-object in Gazebo.
Let me look into that. If I can't do it. I will ask the person in charge of the navigation system tomorrow. He should know. For now, I made the robot start at an edge wall (facing it) and then the it moved away from the wall and did the exploration. It performed really well until it the following error which i have never seen before.
Failed to extrapolate transform. Requires look up transform into past... (something like that;
my terminal was not set to unlimited history which made me loose the error)
You can rotate the model by adjusting pose of "walls_model" in
/bwi_common/utexas_gdc/3ne.world
Wow! The map it produced is shown below. It failed because on the following error:
[ERROR] [1418298728.908840716, 1174.531000000]: Could not get robot position: Lookup would require extrapolation into the past.
Requested time 1163.711000000 but the earliest data is at time 1164.903000000,
when looking up transform from frame [base_link] to frame [map]
The map looks good. It's strange to have this kind of TF-error out of a sudden. Maybe some node couldn't catch up after the Mapper has been busy completing a loop-closure. Can you just restart the exploration-action and see if it finishes correctly?
@skasperski I am trying that but it seems to be something wrong with the computer not keeping up with the resource requirements. So it should be fine. Out of curiosity what does the conformance_weight do? And on a sidenote, your robot models for Tutorial4 don't seem to work for some reason (hydro). It gives me an error in RobotModel (some tf frames have not been found). Additionally, how do you handle which robot to give the commands to. I see that sim_joy is sending commands to all the robots, how do you choose which one to give a command to. In your tutorial, it says press 1 and then use the joystick to control robot_0. But, I am not sure how you are giving each one their command uniquely. Furthurmore, what happens if I miss the estimated frequency too many times as in the following line of code (https://github.com/skasperski/navigation_2d/blob/487bb2b1ff598b76e7a063075bee62cf1c983918/nav2d_navigator/src/RobotNavigator.cpp#L778)?
what does the conformance_weight do?
It determines, how strictly the operator follows the direction given by the navigator. So it reduces the influence of the obstacle avoidance.
your robot models for Tutorial4 don't seem to work for some reason (hydro).
Yes, because the model expects to get the state of the wheels as dynamic transform, which is not provided by the Stage-Simulator. But the model in RVIZ is not really useful anyway and I think the pioneer model will be fixed (or is already).
how do you handle which robot to give the commands to?
Stage puts every robot in a namespace, so you have "/robot_0/cmd_vel", "/robot_1/cmd_vel" and so on. sim_joy publishes to these topics depending on which button you hold while moving the stick.
what happens if I miss the estimated frequency too many times
Then the navigator will not be able to update the command and the operator will continue following the last received command. This can cause oscillating behaviour if the robot moves too fast.
Thanks for the detailed response. But can you let me know where in sim_joy does the check on "which button you hold" before publishing it. For some reason, i can't spot it.
Thanks. Wow can't believe i didn't see that. Its 3:10AM here so I'm getting tired.
Yep, this also happens to me, if I look at code for too long. ;)
@skasperski In tutorial4, the first robot is localized and is doing the mapping. However, the second robot_2 starts moving, robot_1 cannot be controlled by the joystick. Why is that?
@skasperski I have the multiagent tutorial working now, but I have to manually move robot2 until the point cloud is minimized and then we can start the navigator. So this leads to my question, how do we get the second robot to localize? Algorithmically speaking
Hold button 1 to move robot_0 and button 2 to move robot_1. (This assumes that you are using sim_joy, else you can control only 1 robot) The second robot uses basically AMCL (http://wiki.ros.org/amcl) to localize itself in the map. Though it is a build-in version and not the node from navigation-stack.
@skasperski I meant without having to use the joystick for the second one.
Oh, then you have to start operator and navigator on these robots. Tutorial 4 focuses on the mapping, so the autonomous navigation is left out.
@skasperski I tried that but it only worked when the point cloud on the second robot was minimized. And the /robot_1/StartMapping 3 would just get stuck
Sure, because the navigator needs to know where the robot is in order to plan a path.
@skasperski So you have to physically (via. joystick) move the second robot initlaly before starting the mapping and navigation on itself?
Yes. Of course it would be much cooler to have some autonomous localization behaviour, that moves the robot around until it is localized, but such a thing does not exist so far.
@skasperski Hahaha. I am sorry I am new to this (as you could already tell).
I just remembered something: If you know where you robot is (which is usually the case when you are in simulation), you can initialize the mapper with this pose. The mapper listens on the topic "initialpose" (geometry_msgs::PoseWithCovarianceStamped) and localizes itself on the given point. So you can use this to quickly start mapping when the poses of both robots are known.
@skasperski I will take a look at that. thanks!
Curiousity. Why not? Is this considered an NP Hard problem?
You mean the localization behaviour? No, I don't think it'll be too hard. A very simple approach would be to send a forward-command to the Operator (which will avoid obstacles automatically) untill the localization completed. The tricky part is, that your map should be fairly complete around the second robot before you can start localizing.
@skasperski I see. That makes sense. What is the "robot_state_publisher"?
It publishes the link connection between robot parts and is usually used for complex moving robots (manipulator arms for example). In nav2d it is only needed to visualize the robot model.
Can you check-in your launch file so I can run it?
@skasperski Its all good now. I am sorry!
@skasperski I wanted to share the link of the demo to you. It can be accessed at UT-BWI. The website is just a simple demo made just for the presentation. It does notify you with an error sometime due to a bug in RVIZ. But other than that, everything runs smoothly. Your library is well-built and ingenious. I also wanted to thank you for taking the time to respond to all my questions.
Issue closed. Thank you again for all your help.
Hi,
Our tf tree does not have an offset frame between the map and the odometry. So, is there anyway we can just remove that from MultiMapper.cpp and have no problems. Or is that a required component for your library? And what is the purpose of the offset tf for your implementation?
Bear with me as I am still new to this.
Thank you!