Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

/share directory and tutorial.repos file are not created after ros_cross_compile #342

Open
jg-spitfire opened this issue Nov 2, 2021 · 9 comments

Comments

@jg-spitfire
Copy link

Hi, I am using the tool in a VM running Ubuntu 18.04.04, after the installation (I install the latest Docker engine), I follow the tutorial but after the ros_cross_compile command I realize that:

1.- tutorial.repos is not created in my workspace
2.- the path install_aarch64/share is unreachable because the share directory is not created, I realize this when I copy the directory install_aarch64 to my target device and run

rosdep install --from-paths install_aarch64/share --ignore-src --rosdistro foxy -y

I got an error that says the path install_aarch64/share is not found

What could be the problem?

@jg-spitfire jg-spitfire changed the title /share directory is not created after ros_cross_compile /share directory and tutorial.repos file are not created after ros_cross_compile Nov 2, 2021
@emersonknapp
Copy link
Contributor

  1. tutorial.repos is left over from an old version of the tutorial, this is not something that the build should create. I have removed it from the list of files in the README.
  2. Thanks for reporting this! The install/share directory will only be there if the build was created with --merge-install. Otherwise, each individual built package will have its own install/PACKAGE/share directory. For this portion of the tutorial, I would recommend adding merge install to the defaults.yaml. It's easier to use merge-installed colcon outputs across machines, so this is probably best practice for a deployable artifact anyways.

I am also noticing that a bug was introduced in the 0.9 version so that a defaults.yaml in the workspace directory will not be respected unless explicitly specified.

I have updatd the README in 921884e to have the correct commands necessary for the tutorial to work as expected at the moment, and will try to put in a fix for the defaults.yaml thing shortly.

@jg-spitfire
Copy link
Author

jg-spitfire commented Nov 4, 2021

@emersonknapp Hi, did you test this with a target platform?, now the share directory is created but when I run in my target:

from
sudo apt update && sudo apt install -y python3-rosdep

from
sudo rosdep init
rosdep update

from your tutorial:
rosdep install --from-paths install_aarch64/share --ignore-src --rosdistro foxy -y

I got an error:

E: Unable to locate package ros-foxy-example-interfaces
ERROR: the following rosdeps failed to install
apt: command [sudo -H apt-get install -y ros-foxy-example-interfaces] failed

My target is a custom Linux distribution from Xilinx built from Yocto, its name is Petalinux, and I installed Ubuntu 20.04 LTS arm64 over that distro

@emersonknapp
Copy link
Contributor

emersonknapp commented Nov 4, 2021

Assuming you have APT on this platform and have ROS dependencies you need to install that way, you still need to set up the ROS 2 APT sources as you would for any system, as described at https://docs.ros.org/en/foxy/Installation/Ubuntu-Install-Debians.html#setup-sources. I have added some language in ccc6497 calling this out.

I am assuming that's the problem you're experiencing here.

Thanks for reporting and following up on these issues - it will improve the experience for others

@jg-spitfire
Copy link
Author

jg-spitfire commented Nov 4, 2021

I already try that, I followed this steps:
add the repo, even I installed the development tools, and I get the error I mentioned before

@emersonknapp
Copy link
Contributor

You shouldn't need the development tools - that's for building, which you have already done.

I wonder if maybe the sources setup didn't work correctly for your custom distro.

  • Are you able to sudo apt-cache search ros-foxy - does this show any packages at all?
  • What are the contents of /etc/apt/sources.list.d/ros2.list?
  • Are there any errors when you apt-get update?

@jg-spitfire
Copy link
Author

jg-spitfire commented Nov 8, 2021

hi @emersonknapp I could solve the error:

E: Unable to locate package ros-foxy-example-interfaces
ERROR: the following rosdeps failed to install
apt: command [sudo -H apt-get install -y ros-foxy-example-interfaces] failed

it was my fault, I was using a 32 bits ubuntu distro in my embedded linux instead a 64 bits, once I run rosdep install --from-paths install_aarch64/share --ignore-src --rosdistro foxy -y a message says that all rosdep dependencies were installed, then I write this commands:

source install_aarch64/setup.bash
ros2 run demo_nodes_cpp talker

but now I get:
-bash: ros2: command not found

I will answer your questions:
1.- Are you able to sudo apt-cache search ros-foxy - does this show any packages at all?
ros2 apt-cache

2.- What are the contents of /etc/apt/sources.list.d/ros2.list?
ros2list

3.- Are there any errors when you apt-get update?
no, I can make updates, upgrades and install packages without issues

@jg-spitfire
Copy link
Author

"Assuming you have APT on this platform and have ROS dependencies you need to install that way, you still need to set up the ROS 2 APT sources as you would for any system"

What dependencies are you talking about?

@jg-spitfire
Copy link
Author

I used the sudo apt install ros-foxy-ros-base and then works!, but that step is not in your tutorial

@jg-spitfire
Copy link
Author

jg-spitfire commented Nov 11, 2021

@emersonknapp when testing the demo in the target board you must add the sources for the listener too:

source install_aarch64/setup.bash
ros2 run demo_nodes_cpp talker

#and in a different shell, add sources too
source install_aarch64/setup.bash
ros2 run demo_nodes_cpp listener

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants