Instruction requirement for 3.7 Topics Quiz

Hello everyone, I’m in 3.7 Topics Quiz, the requirement is using Publisher and Subscriber to let robot move between 2 point ( home_position and pickup_position)
after somedays to read carefully the instruction and tried to code, but i’m still feeling confuse and hard to code, could you help me to give more detailed instructions?

What parts of the instructions are not clear to you?



Hello Sir
I’m trying to Extract the X and Y from the result of the public but can’t, could you help to give me instructions for this ?

Sorry, I still don’t understand what you mean?

  • Can you show your code?
  • What do x and y represent?
  • What is “public”?

Hello sir, about this quiz requirement

  1. It’s require subscribes to a topic named /nasa_mission of type std_msgs/msg/String.
  2. If someone publishes in the topic /nasa_mission the command Go-Home robot should move to the coordinates {‘x’: 0.0, ‘y’: 0.0} .
    If someone publishes in the topic /nasa_mission the command Go-Pickup robot should move to the coordinates {‘x’: -2.342, ‘y’: 2.432}
    and The tolerance to reach those points has to be around 0.1 meters.

i mean i try to extract the X and Y from the command after someone publishes in the topic /nasa_mission

You should be able to extra the x and y position by studying the message structure. If the message is of type Twist, for instance, and msg is the data published, this could be

x = msg.linear.x
y = msg.linear.y

You should find some examples in that chapter.

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.