# ROS2 Navigation Unit 2 - Getting Started

**URL:** <https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443>\
**Category:** ROS2 Navigation Humble\
**Tags:** howto\
**Created:** [July 25, 2024, 2:37am UTC](https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443 "2024-07-25T02:37:48Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Eldgar](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/eldgar/32/9841_2.png) [@Eldgar](https://get-help.theconstruct.ai/u/Eldgar)\
**Post date:** [July 25, 2024, 2:37am UTC](https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443/1 "2024-07-25T02:37:48Z")

</div>

So I am having trouble getting started in this unit

It implies there should be a cartographer\_ros pkg as a wrapper, am I expected to read that documentation and build the pkg?  
I see nothing mentioned about it other than a description.

To launch `cartographer,’ launch two nodes:

#### 1. Launch of the `cartographer_node`

These are the fields you need to indicate in the node launch:

- The `cartographer_node` is provided by the package `cartographer_ros`
- The executable is called `cartographer_node`
- The parameters it requires are:
  1. `use_sim_time`: is a boolean indicating whether the node must synchronize its time with the simulation

- The arguments are:
  1. `configuration_directory`: the directory where to find the configuration files
  2. `configuration_basename`: the config file name

might be obvious for some others, but I see no cartographer\_ros pkg in my ros2\_ws directory  
user:~/ros2\_ws/src$ ls  
ros2\_nav\_files  
user:~/ros2\_ws/src$

---

<div class="post-metadata">

**Author:** ![jpvaldivia7](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/jpvaldivia7/32/8925_2.png) [@jpvaldivia7](https://get-help.theconstruct.ai/u/jpvaldivia7)\
**Post date:** [July 25, 2024, 3:46am UTC](https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443/2 "2024-07-25T03:46:34Z")

</div>

Hi Eldgar,  
The task you have to do is build a launch file using the cartographer\_ros package with the specifications mentioned. As you said there is no cartographer\_ros in your ros2\_ws. However, if you run “ros2 pkg list” you will see cartographer\_ros package, that means is already sourced in your workspace. Also, you can see where is installed or where it comes from with the command: “ros2 pkg prefix package\_name” and if you replace “package\_name” with cartographer\_ros you will see where is the package installed.

---

<div class="post-metadata">

**Author:** ![Eldgar](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/eldgar/32/9841_2.png) [@Eldgar](https://get-help.theconstruct.ai/u/Eldgar)\
**Post date:** [July 26, 2024, 3:33am UTC](https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443/3 "2024-07-26T03:33:02Z")

</div>

OK thanks.

So it looks like I don’t edit the launch files in the /opt/ros/humble but in the launch directory of nav2\_project

def generate\_launch\_description():  
return LaunchDescription([  
#SetEnvironmentVariable(‘RCUTILS\_CONSOLE\_STDOUT\_LINE\_BUFFERED’, ‘1’),  
SetEnvironmentVariable(‘RCUTILS\_LOGGING\_BUFFERED\_STREAM’, ‘1’),  
Node(  
package=‘cartographer\_ros’, node\_executable=‘cartographer\_node’, output=‘screen’,  
arguments=[  
‘-configuration\_directory’, get\_package\_share\_directory(‘nav2\_project’) + ‘/config’,  
‘-configuration\_basename’, ‘cartographer.lua’  
],  
),  
Node(  
package=‘cartographer\_ros’,  
node\_executable=‘occupancy\_grid\_node’,  
output=‘screen’,  
arguments=[‘-resolution’, ‘0.02’, ‘-publish\_period\_sec’, ‘1.0’]  
),  
])

Only a few minor shanges

---

<div class="post-metadata">

**Author:** ![rtellez](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/rtellez/32/9813_2.png) [@rtellez](https://get-help.theconstruct.ai/u/rtellez)\
**Post date:** [July 26, 2024, 8:02am UTC](https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443/4 "2024-07-26T08:02:53Z")

</div>

Hi Eldgar,  
you need to take first the ROS2 Basics (Python) course so you will understand better those points. You need to know the content of ROS 2 Basics before taking this Navigation course, because it provides the basic knowledge for understanding third party packages.

The Cartographer and the Nav2 are a third party packages, and we are using them for doing the navigation

---

<div class="post-metadata">

**Author:** ![Eldgar](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/eldgar/32/9841_2.png) [@Eldgar](https://get-help.theconstruct.ai/u/Eldgar)\
**Post date:** [July 26, 2024, 2:07pm UTC](https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443/5 "2024-07-26T14:07:25Z")

</div>

Yes I did take the ros2 basics course.

All the work I did there mostly involved making my own packages in the ros2\_ws/src directory.  
That’s why I was a bit confused.

---

<div class="post-metadata">

**Author:** ![jpvaldivia7](https://get-help.theconstruct.ai/user_avatar/get-help.theconstruct.ai/jpvaldivia7/32/8925_2.png) [@jpvaldivia7](https://get-help.theconstruct.ai/u/jpvaldivia7)\
**Post date:** [July 29, 2024, 12:28pm UTC](https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443/6 "2024-07-29T12:28:40Z")

</div>

Do not worry Eldgar, it is confusing. After some practice or more courses you will get all those concepts internalized!

---

<div class="post-metadata">

**Author:** ![system](https://get-help.theconstruct.ai/uploads/default/original/2X/9/9d3ce8305cc0d0d9b6e07d15767a6f245c526f1b.jpeg) [@system](https://get-help.theconstruct.ai/u/system)\
**Post date:** [August 3, 2024, 12:28pm UTC](https://get-help.theconstruct.ai/t/ros2-navigation-unit-2-getting-started/31443/7 "2024-08-03T12:28:45Z")

</div>

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