Part4 Ros2 Navigation

Hello Team the construct,

I am facing a Misunderstanding in the Ros2 Navigation in the part 4 i just need someone to clear some points and to tell me if i understood it well:

We are asked:

Create a spot recorder script.

Earlier in this project, we created a map of the environment, but still we don’t know the coordinates of any location on the map.

To get to know the location of a point on the map, we will create a script that will save the location of a marked point from Rviz to the YAML file.

For that, we will subscribe to the /initialpose topic so that we can get the position and orientation of the robot at the spot.

There are 3 spots you need to record for this project:

corner1 and 2 and the pedestrian

To record, you should start only the map_server node and RViz2 , then select 2D_Pose_Estimate to mark the location.


What i understood is that i will create a python3 script that will sub to the topic /intial pose to perform the asked task but like i will just create the sub no need to any service server or anything else second thing is that we will just run the map_server and the rviz2 and the code i want to know the code we will run it as a python3 script or how and should we create a new package or i will use for example the localization package please i need someone to clear the points :

  1. the script will only contain a subscriber it will not contain any message or any service ?
  2. i will run the map_server and the rviz2 and the script as a python3 script ? and using the 2d_estimate_pose i will click on the spots and it will just save the spots so if i clicked 50 spots the file will save 50 spots ?
  3. Should i create a new pkg for this part or i will use any pkg for example : localization pkg

Best Regards,

Ghassan

Please anyone can clear it :grin:

Hi @ghassan11 ,

For the sake of God (or for the sake of yourself if you don’t believe in God), please use punctuation in your paragraph. There are things called phrases, sentences, full stop / period, comma, hyphen / dash in English. Make use of them. Please STOP making sentences with about 100 words without punctuation marks. I cannot understand where you are starting a sentence and where the sentence ends. If you continue this practice, I will flag you.
Clarity in communication is a MUST, when you are requesting help from others.

If you are running Rviz along with the Nav2 Stack, then you can do the following:

  1. Subscribe to /clicked_point to get the point chosen on the Rviz map.
  2. Subscribe to /goal_pose to get the goal pose from Rviz map.
  3. Subscribe to /initialpose to get the robot’s starting pose only - this will not give the robot’s current pose.
  4. Subscribe to /amcl_pose to get the robot’s current pose. You can also subscribe to /odom to get the current robot pose, but that will be unfiltered data.

Now to navigate to a clicked point on the RViz map, you need to:

  1. Subscribe to /goal_pose to get the requested goal pose on Rviz.
  2. Save the requested goal pose coordinates into the yaml file.
  3. Use the action call to send the goal pose to the Nav2 Stack to make the robot navigate to the requested goal pose, using /navigate_to_pose action topic.

I hope this solves your doubt / issue / confusion.

Regards,
Girish

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