Exercise 4.4.....Navigation

Respected Professor,
When I was solving exercise 4.4,

I did all. But…I couldn’t understand how do I give three different poses. I was thinking of giving velocities in three different loops for different times, but that didn’t work. Then I went for solution. They had given the following:

I realized that it’s been solved in a much more easier way than I thought. I rectified my code, but the robot is not moving at all. Below are the pictures of my code

I run the following command in the terminal:
roslaunch send_goals husky_launcher.launch
Do I need to run any other command in other terminal to make it move. Or, is there something I need to add in my python code. Please help me out.

Also, I didn’t understand that:

  1. Is it compulsory to give the goal in the order of: map…then giving positions for x y and z…and then orientations

  2. How do I know the sequence. For example: goal.target_pose.header.frame_id = 'map' . Is there any place where I can see this structure ? Yeah, I did see it in one place when I wrote the command rostopic pub /move_base/goal move_base_msgs/MoveBaseActionGoal [tab][tab].

    But, is this the only place where I can see and understand this structure ? Is there no other link to any website where I can understand this or any other command which can show me this much better like rosmsg show etc

  3. Apparently the code is not in loop. Am I correct? Is that what I am supposed to add extra?

  4. How do I make my loop infinite ? by adding ctrl_c shutdown loop ?

  5. I think the code is only for one pose, so do I need to add two more ? The question asks 3 poses


First of all: Please I highly recommend you to do the ROSBAsics Course because it will explain a lot of the questions you are posting here.

Remember that you nee dto launch the bnavigation before anything else, otherwise thi cript wont work because there no movebase to send the goals to.

1-2) I supose you mean why the data that you are sending is like that. Thats because the messgae has that structure. if you do: rosmsg show move_base_msgs/MoveBaseGoal, it will indicate you the size of it.

3-4) Yeah you have to add the loop, you can use :slight_smile:

  while not rospy.is_shutdown():
  1. you need to add two more yes. You could try to create a class to send a pose so that you dont have to repeat the code three times.
1 Like

Thank you Professor Miguel @duckfrost
Surely I’ll go back to all those basics and work on them. My foundation seems to be weaker than I expected.