ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

What's the difference between ROS package and ROS directory?

asked 2022-02-26 11:14:52 -0500

SPoVi gravatar image

Hello everyone,

I'm running Ubuntu 20.04 with ROS Noetic installed on a VMWare 16.

I'm trying to join the firmware folder of PX4-Autopilot using this command:

roscd px4

following the instructions in the Unit 8 of the book "Mastering ROS for robotics programming - Third edition".(L.Joshep, J.Cacace)

but it's throwing the next error:

roscd: No such package/stack 'px4'.

The book says:

"This folder contains all the files necessary to modify and upload the firmware on the embedded controller (the autopilot) and to simulate source code on different simulators. To link all the necessary elements, the firmware directory is recognized as a ROS package, even though it is not compiled as such. In addition, the name of this package is px4. Note that the name of the directory doesn't necessarily represent the name of the ROS package."

STEPS I HAVE DONE

  1. Donwload de code in my ros workspace:
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
  1. A new directory called "PX4-Autopilot" has been created.

  2. Try to join the firmware folder with the following command:

    roscd px4

edit retag flag offensive close merge delete

Comments

Have you seen #q348818? That seems to be a duplicate of your question.

gvdhoorn gravatar image gvdhoorn  ( 2022-03-01 02:17:21 -0500 )edit

Yes, I did it before posting, thankyou.

My question was more related about why the folder can be called "PX4-Autopilot" and y should be able to call the directory with "roscd px4". As the book says "the name of the directory doesn't necessarily represent the name of the ROS package".

By the way, I found why I could not call it, I understood that when I should install de PX4-Autopilot in my workspace i had to doit in the level ~/catkin_ws. Once I did it inside ~/catkin_ws/src, I could use "roscs px4" to change directory to the "PX4-Autopilot" folder". ~/catkin_ws/src/PX4-Autopilot.

SPoVi gravatar image SPoVi  ( 2022-03-01 03:19:28 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
1

answered 2022-03-02 08:25:23 -0500

gvdhoorn gravatar image

My question was more related about why the folder can be called "PX4-Autopilot" and y should be able to call the directory with "roscd px4".

roscd takes package names as input.

Not directory names.

That's why you can roscd px4 even if the directory you end up in has a different name.

See also wiki/rosbash: roscd:

roscd allows you to change directories using a package name, stack name, or special location.

Usage:

roscd <package-or-stack>[/subdir]

For example:

roscd roscpp

You can continue to use a relative path after the package name to go further into the package:

roscd roscpp/include/ros
edit flag offensive delete link more

Comments

Yes, sorry, I didn't know how to close it. And thanks for the anwser.

SPoVi gravatar image SPoVi  ( 2022-03-10 03:53:16 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-02-26 11:14:52 -0500

Seen: 84 times

Last updated: Mar 02 '22