Turtlebot with a Map/ devation of Position after drive into an Object
Hello guys,
First of all i use ros Kinetic with gazebo 7.0.i use a python script where my robot drives to points i give him after this i let my Robot drive into that object to see if he can push the object or not.But after he drives into an object the map mess up with the Robot Position. So when i try to let the robot drive back to the beginning he lands somewhere else. Here is my Code for driving near the objects :
def goto(self, pos, quat):
# Send a goal
self.goal_sent = True
goal = MoveBaseGoal()
goal.target_pose.header.frame_id = 'map'
goal.target_pose.header.stamp = rospy.Time.now()
goal.target_pose.pose = Pose(Point(pos['x'], pos['y'], 0.000),
Quaternion(quat['r1'], quat['r2'], quat['r3'], quat['r4']))
# Start moving
self.move_base.send_goal(goal)
# Allow TurtleBot up to 60 seconds to complete task
success = self.move_base.wait_for_result(rospy.Duration(200))
state = self.move_base.get_state()
result = False
if success and state == GoalStatus.SUCCEEDED:
# We made it!
result = True
else:
self.move_base.cancel_goal()
self.goal_sent = False
return result
def shutdown(self):
if self.goal_sent:
self.move_base.cancel_goal()
rospy.loginfo("Stop")
rospy.sleep(1)
Addionally there is some Code for driving straight into objects. And after trying to push an object he stops and tries to move back to the starting position. The problem here is that there is a little deviation between the robot real position and the position on the map. This deviation causes that the robot don't reach the starting position.
Here is some Code how i bring up my map: First i start:
roslaunch turtlebot_navigation gmapping_demo.launch
i creates a map drive around and save this map. After i done this i run:
roslaunch turtlebot_gazebo amcl_demo.launch map_file:=/home/<user_name>/turtlebot_custom_maps/tutorial.yaml
Is it possible to recalibrate the map position if the Robot or something else ?
Or is there a solution how i can deal with Wheel slapping in my map so i wont get any deviation?
Avoiding obstacles is one of the main purposes of the navigation stack. You can either change the planner parameters to take less into account the presence of obstacles or you can add an additional custom step to drive yourself the robot towards the object/target. More detail would be nice.
I added some informations above can u explain how i can change the planner parameters? As a custom step u mean i can drive near the object and then i drive with a forward command into it ?