0
$\begingroup$

Rosanswers logo

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


Originally posted by SPoVi on ROS Answers with karma: 3 on 2022-02-26

Post score: 0


Original comments

Comment by gvdhoorn on 2022-03-01:
Have you seen #q348818? That seems to be a duplicate of your question.

Comment by SPoVi on 2022-03-01:
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.

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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

Originally posted by gvdhoorn with karma: 86574 on 2022-03-02

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by SPoVi on 2022-03-10:
Yes, sorry, I didn't know how to close it. And thanks for the anwser.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.