From 4a2cb4084f1a9b69b16a26caa9669a878820952e Mon Sep 17 00:00:00 2001 From: "Patrick, Simmel" <patrick.simmel@stud.th-deg.de> Date: Fri, 4 Mar 2022 09:44:24 +0100 Subject: [PATCH] Add needed files --- Makefile | 22 + README.md | 135 +++--- build/.built_by | 1 + build/COLCON_IGNORE | 0 build/my_pkg/colcon_build.rc | 1 + .../my_pkg/colcon_command_prefix_setup_py.sh | 1 + .../colcon_command_prefix_setup_py.sh.env | 52 +++ build/my_pkg/my_pkg | 1 + build/my_pkg/my_pkg.egg-info/PKG-INFO | 12 + build/my_pkg/my_pkg.egg-info/SOURCES.txt | 13 + .../my_pkg.egg-info/dependency_links.txt | 1 + build/my_pkg/my_pkg.egg-info/entry_points.txt | 3 + build/my_pkg/my_pkg.egg-info/requires.txt | 1 + build/my_pkg/my_pkg.egg-info/top_level.txt | 1 + build/my_pkg/my_pkg.egg-info/zip-safe | 1 + build/my_pkg/package.xml | 1 + build/my_pkg/resource/my_pkg | 1 + build/my_pkg/setup.cfg | 1 + build/my_pkg/setup.py | 1 + .../share/my_pkg/hook/pythonpath_develop.dsv | 1 + .../share/my_pkg/hook/pythonpath_develop.ps1 | 3 + .../share/my_pkg/hook/pythonpath_develop.sh | 3 + install/.colcon_install_layout | 1 + install/COLCON_IGNORE | 0 install/_local_setup_util_ps1.py | 404 ++++++++++++++++++ install/_local_setup_util_sh.py | 404 ++++++++++++++++++ install/local_setup.bash | 107 +++++ install/local_setup.ps1 | 55 +++ install/local_setup.sh | 137 ++++++ install/local_setup.zsh | 120 ++++++ install/my_pkg/lib/my_pkg/tb3 | 33 ++ .../python3.10/site-packages/my-pkg.egg-link | 2 + .../resource_index/packages/my_pkg | 0 .../my_pkg/share/colcon-core/packages/my_pkg | 0 .../share/my_pkg/hook/ament_prefix_path.dsv | 1 + .../share/my_pkg/hook/ament_prefix_path.ps1 | 3 + .../share/my_pkg/hook/ament_prefix_path.sh | 3 + .../my_pkg/share/my_pkg/hook/pythonpath.dsv | 1 + .../my_pkg/share/my_pkg/hook/pythonpath.ps1 | 3 + .../my_pkg/share/my_pkg/hook/pythonpath.sh | 3 + install/my_pkg/share/my_pkg/package.bash | 31 ++ install/my_pkg/share/my_pkg/package.dsv | 9 + install/my_pkg/share/my_pkg/package.ps1 | 117 +++++ install/my_pkg/share/my_pkg/package.sh | 88 ++++ install/my_pkg/share/my_pkg/package.xml | 18 + install/my_pkg/share/my_pkg/package.zsh | 42 ++ install/setup.bash | 37 ++ install/setup.ps1 | 31 ++ install/setup.sh | 53 +++ install/setup.zsh | 37 ++ load_workspace.sh | 5 + log/COLCON_IGNORE | 0 log/build_2022-03-01_11-42-39/events.log | 92 ++++ log/build_2022-03-01_11-42-39/logger_all.log | 140 ++++++ .../my_pkg/command.log | 2 + .../my_pkg/stderr.log | 4 + .../my_pkg/stdout.log | 22 + .../my_pkg/stdout_stderr.log | 26 ++ .../my_pkg/streams.log | 28 ++ log/latest | 1 + log/latest_build | 1 + ros.sh | 23 + run.sh | 1 + set_my_ros_domain_id.sh | 1 + src/my_pkg/my_pkg/__init__.py | 0 .../__pycache__/__init__.cpython-310.pyc | Bin 0 -> 156 bytes .../my_pkg/__pycache__/tb3.cpython-310.pyc | Bin 0 -> 3194 bytes src/my_pkg/my_pkg/tb3.py | 1 + src/my_pkg/package.xml | 18 + src/my_pkg/resource/my_pkg | 0 src/my_pkg/setup.cfg | 4 + src/my_pkg/setup.py | 26 ++ src/my_pkg/test/test_copyright.py | 23 + src/my_pkg/test/test_flake8.py | 25 ++ src/my_pkg/test/test_pep257.py | 23 + tb3.py | 134 ++++++ tb3_challenge4.py | 98 +++++ tb3_challenge5_old.py | 125 ++++++ tb3_right_hand.py | 141 ++++++ tools/stop-tb3.sh | 1 + tools/tb3_teleop.sh | 1 + 81 files changed, 2897 insertions(+), 65 deletions(-) create mode 100644 Makefile create mode 100644 build/.built_by create mode 100644 build/COLCON_IGNORE create mode 100644 build/my_pkg/colcon_build.rc create mode 100644 build/my_pkg/colcon_command_prefix_setup_py.sh create mode 100644 build/my_pkg/colcon_command_prefix_setup_py.sh.env create mode 120000 build/my_pkg/my_pkg create mode 100644 build/my_pkg/my_pkg.egg-info/PKG-INFO create mode 100644 build/my_pkg/my_pkg.egg-info/SOURCES.txt create mode 100644 build/my_pkg/my_pkg.egg-info/dependency_links.txt create mode 100644 build/my_pkg/my_pkg.egg-info/entry_points.txt create mode 100644 build/my_pkg/my_pkg.egg-info/requires.txt create mode 100644 build/my_pkg/my_pkg.egg-info/top_level.txt create mode 100644 build/my_pkg/my_pkg.egg-info/zip-safe create mode 120000 build/my_pkg/package.xml create mode 120000 build/my_pkg/resource/my_pkg create mode 120000 build/my_pkg/setup.cfg create mode 120000 build/my_pkg/setup.py create mode 100644 build/my_pkg/share/my_pkg/hook/pythonpath_develop.dsv create mode 100644 build/my_pkg/share/my_pkg/hook/pythonpath_develop.ps1 create mode 100644 build/my_pkg/share/my_pkg/hook/pythonpath_develop.sh create mode 100644 install/.colcon_install_layout create mode 100644 install/COLCON_IGNORE create mode 100644 install/_local_setup_util_ps1.py create mode 100644 install/_local_setup_util_sh.py create mode 100644 install/local_setup.bash create mode 100644 install/local_setup.ps1 create mode 100644 install/local_setup.sh create mode 100644 install/local_setup.zsh create mode 100755 install/my_pkg/lib/my_pkg/tb3 create mode 100644 install/my_pkg/lib/python3.10/site-packages/my-pkg.egg-link create mode 100644 install/my_pkg/share/ament_index/resource_index/packages/my_pkg create mode 100644 install/my_pkg/share/colcon-core/packages/my_pkg create mode 100644 install/my_pkg/share/my_pkg/hook/ament_prefix_path.dsv create mode 100644 install/my_pkg/share/my_pkg/hook/ament_prefix_path.ps1 create mode 100644 install/my_pkg/share/my_pkg/hook/ament_prefix_path.sh create mode 100644 install/my_pkg/share/my_pkg/hook/pythonpath.dsv create mode 100644 install/my_pkg/share/my_pkg/hook/pythonpath.ps1 create mode 100644 install/my_pkg/share/my_pkg/hook/pythonpath.sh create mode 100644 install/my_pkg/share/my_pkg/package.bash create mode 100644 install/my_pkg/share/my_pkg/package.dsv create mode 100644 install/my_pkg/share/my_pkg/package.ps1 create mode 100644 install/my_pkg/share/my_pkg/package.sh create mode 100644 install/my_pkg/share/my_pkg/package.xml create mode 100644 install/my_pkg/share/my_pkg/package.zsh create mode 100644 install/setup.bash create mode 100644 install/setup.ps1 create mode 100644 install/setup.sh create mode 100644 install/setup.zsh create mode 100644 load_workspace.sh create mode 100644 log/COLCON_IGNORE create mode 100644 log/build_2022-03-01_11-42-39/events.log create mode 100644 log/build_2022-03-01_11-42-39/logger_all.log create mode 100644 log/build_2022-03-01_11-42-39/my_pkg/command.log create mode 100644 log/build_2022-03-01_11-42-39/my_pkg/stderr.log create mode 100644 log/build_2022-03-01_11-42-39/my_pkg/stdout.log create mode 100644 log/build_2022-03-01_11-42-39/my_pkg/stdout_stderr.log create mode 100644 log/build_2022-03-01_11-42-39/my_pkg/streams.log create mode 120000 log/latest create mode 120000 log/latest_build create mode 100644 ros.sh create mode 100755 run.sh create mode 100644 set_my_ros_domain_id.sh create mode 100644 src/my_pkg/my_pkg/__init__.py create mode 100644 src/my_pkg/my_pkg/__pycache__/__init__.cpython-310.pyc create mode 100644 src/my_pkg/my_pkg/__pycache__/tb3.cpython-310.pyc create mode 120000 src/my_pkg/my_pkg/tb3.py create mode 100644 src/my_pkg/package.xml create mode 100644 src/my_pkg/resource/my_pkg create mode 100644 src/my_pkg/setup.cfg create mode 100644 src/my_pkg/setup.py create mode 100644 src/my_pkg/test/test_copyright.py create mode 100644 src/my_pkg/test/test_flake8.py create mode 100644 src/my_pkg/test/test_pep257.py create mode 100644 tb3.py create mode 100644 tb3_challenge4.py create mode 100644 tb3_challenge5_old.py create mode 100644 tb3_right_hand.py create mode 100755 tools/stop-tb3.sh create mode 100755 tools/tb3_teleop.sh diff --git a/Makefile b/Makefile new file mode 100644 index 0000000..2dc6755 --- /dev/null +++ b/Makefile @@ -0,0 +1,22 @@ +all: \ + src/my_pkg \ + set_my_ros_domain_id.sh + +# generates a random ROS_DOMAIN_ID for simultaneous users on a machine +set_my_ros_domain_id.sh: + echo export ROS_DOMAIN_ID=$(shell seq 0 255 | shuf | head -1) > $@ + +src/my_pkg: | tb3.py + ros2 pkg create my_pkg \ + --build-type ament_python \ + --node-name tb3 \ + --destination-directory src + ln -srf tb3.py src/my_pkg/my_pkg/tb3.py + colcon build --symlink-install + +%/: + mkdir -p $@ + +clean: + $(RM) -r build install log src + $(RM) set_my_ros_domain_id.sh diff --git a/README.md b/README.md index 3da7f7e..2da740f 100644 --- a/README.md +++ b/README.md @@ -1,92 +1,97 @@ -# ros2_project +# Turtlebot3 ROS2 template +## Preparing ROS workspaces and environment variables +`rosenv` alias (example in `ros.sh`) which activates preinstalled `ros-base`, `gazebo-ros-pkgs`, and `turtlebot3` workspaces. If `ros.sh` is installed in `/etc/profile.d` then `ros.sh` will be automatically loaded everytime you open a terminal. Then you can type `rosenv` to activate the ROS environment in a new terminal. -## Getting started +Setting up your `ROS_DOMAIN_ID`, e.g., if multiple users are working on the same server. You can use `set_my_ros_domain_id.sh` for this. Generate a random id with `make set_my_ros_domain_id.sh` -To make it easy for you to get started with GitLab, here's a list of recommended next steps. +# Setup -Already a pro? Just edit this README.md and make it your own. Want to make it easy? [Use the template at the bottom](#editing-this-readme)! +Open three terminal windows for: -## Add your files +1. running your ROS node +2. writing code +3. launching & monitoring Gazebo -- [ ] [Create](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#create-a-file) or [upload](https://docs.gitlab.com/ee/user/project/repository/web_editor.html#upload-a-file) files -- [ ] [Add files using the command line](https://docs.gitlab.com/ee/gitlab-basics/add-file.html#add-a-file-using-the-command-line) or push an existing Git repository with the following command: +### 1st window - running your ROS node -``` -cd existing_repo -git remote add origin https://mygit.th-deg.de/ps16214/ros2_project.git -git branch -M main -git push -uf origin main -``` - -## Integrate with your tools - -- [ ] [Set up project integrations](https://mygit.th-deg.de/ps16214/ros2_project/-/settings/integrations) - -## Collaborate with your team -- [ ] [Invite team members and collaborators](https://docs.gitlab.com/ee/user/project/members/) -- [ ] [Create a new merge request](https://docs.gitlab.com/ee/user/project/merge_requests/creating_merge_requests.html) -- [ ] [Automatically close issues from merge requests](https://docs.gitlab.com/ee/user/project/issues/managing_issues.html#closing-issues-automatically) -- [ ] [Enable merge request approvals](https://docs.gitlab.com/ee/user/project/merge_requests/approvals/) -- [ ] [Automatically merge when pipeline succeeds](https://docs.gitlab.com/ee/user/project/merge_requests/merge_when_pipeline_succeeds.html) - -## Test and Deploy - -Use the built-in continuous integration in GitLab. - -- [ ] [Get started with GitLab CI/CD](https://docs.gitlab.com/ee/ci/quick_start/index.html) -- [ ] [Analyze your code for known vulnerabilities with Static Application Security Testing(SAST)](https://docs.gitlab.com/ee/user/application_security/sast/) -- [ ] [Deploy to Kubernetes, Amazon EC2, or Amazon ECS using Auto Deploy](https://docs.gitlab.com/ee/topics/autodevops/requirements.html) -- [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/) -- [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html) +```sh +git clone https://mygit.th-deg.de/gaydos/tb3-ros2-template && cd tb3-ros2-template +make # creates a ROS package, builds it and links `tb3.py` to the file in `src/.../tb3.py` (creates a shortcut) +. ./set_my_ros_domain_id.sh # sets a random `ROS_DOMAIN_ID`. Useful when multiple users are working on the same server +. ./install/local_setup.sh # activate current workspace (you can also use `. ./load_workspace.sh`) +``` -*** +Then you can run your ROS node: +```sh +ros2 run my_pkg tb3 # (you can also use `./run.sh`) +``` -# Editing this README +This should at least output: +``` +waiting for messages... +``` -When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template. +If the robot is already brought up, then you should also get `LaserScan` messages: +``` +F: 0.5624107122421265 +R: 0.3894226849079132 +... +``` -## Suggestions for a good README -Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information. +### 2nd window - writing code -## Name -Choose a self-explaining name for your project. +Open `tb3.py` with your your favorite text editor, e.g., `vim`, `Visual Studio Code (Code OSS)` -## Description -Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors. +### 3rd window - launching & monitoring Gazebo -## Badges -On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge. +```sh +rosenv +gazebo --verbose WORLD_FILE # the world file can be e.g., world.sdf +``` -## Visuals -Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method. +Should output: +``` +Gazebo multi-robot simulator, ... +... +[Msg] Waiting for master. +[Msg] Connected to gazebo master @ http://127.0.0.1:11345 +... +[Msg] Loading world file [/home/...] +... +``` -## Installation -Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection. +And if you open a world with TB3 or add it manually: +``` +[INFO] [1608802634.071946263] [gazebo_ros_node]: ROS was initialized without arguments. +... +``` -## Usage -Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README. +After TB3 is instantiated, you should see `LaserScan` values in the first window -## Support -Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc. -## Roadmap -If you have ideas for releases in the future, it is a good idea to list them in the README. +## Notes -## Contributing -State if you are open to contributions and what your requirements are for accepting them. +- In Gazebo, use CTRL+r on Gazebo to restart the simulation. This way you do not have to close and open Gazebo +- use CTRL+C to kill a command line process, e.g., your ROS program or non-responsive Gazebo +- if you get the following error: -For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self. + ``` + [Err] ... EXCEPTION: Unable to start server[bind: Address already in use]. There is probably another Gazebo process running. + ``` -You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser. + then choose another port for Gazebo, e.g.: -## Authors and acknowledgment -Show your appreciation to those who have contributed to the project. + ``` + $ GAZEBO_MASTER_URI=:12346 gazebo --verbose challenge_2.sdf + ``` -## License -For open source projects, say how it is licensed. +- if you do not use the simulation, then close Gazebo to leave the processor resources for others. If the system is slow, `htop` may show you the reason. `htop` shows who the active processes belong to and processor usage. +- you can kill a process with process id 12345 using `kill 12345`. The process id is shown in the `PID` column in `htop`. +- `make clean` removes all generated files which may help in case of an error +- `tools/` folder contain convenience scripts, e.g., -## Project status -If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers. + - `stop-tb3.sh`: to stop the robot manually + - `tb3-teleop.sh`: teleoperation using keyboard diff --git a/build/.built_by b/build/.built_by new file mode 100644 index 0000000..06e74ac --- /dev/null +++ b/build/.built_by @@ -0,0 +1 @@ +colcon diff --git a/build/COLCON_IGNORE b/build/COLCON_IGNORE new file mode 100644 index 0000000..e69de29 diff --git a/build/my_pkg/colcon_build.rc b/build/my_pkg/colcon_build.rc new file mode 100644 index 0000000..573541a --- /dev/null +++ b/build/my_pkg/colcon_build.rc @@ -0,0 +1 @@ +0 diff --git a/build/my_pkg/colcon_command_prefix_setup_py.sh b/build/my_pkg/colcon_command_prefix_setup_py.sh new file mode 100644 index 0000000..f9867d5 --- /dev/null +++ b/build/my_pkg/colcon_command_prefix_setup_py.sh @@ -0,0 +1 @@ +# generated from colcon_core/shell/template/command_prefix.sh.em diff --git a/build/my_pkg/colcon_command_prefix_setup_py.sh.env b/build/my_pkg/colcon_command_prefix_setup_py.sh.env new file mode 100644 index 0000000..924818f --- /dev/null +++ b/build/my_pkg/colcon_command_prefix_setup_py.sh.env @@ -0,0 +1,52 @@ +AMENT_PREFIX_PATH=/home/ps16214/py_pubsub/install/py_pubsub:/opt/ros/galactic-turtlebot3-quickstart:/opt/ros/galactic +CMAKE_PREFIX_PATH=/opt/ros/galactic-turtlebot3-quickstart:/opt/ros/galactic +COLCON=1 +COLCON_PREFIX_PATH=/home/ps16214/py_pubsub/install:/opt/ros/galactic-turtlebot3-quickstart:/opt/ros/galactic +CONDA_EXE=/usr/bin/conda +CONDA_SHLVL=0 +CUDA_PATH=/opt/cuda +CYCLONEDDS_URI=/share/cyclonedds-profile.xml +DBUS_SESSION_BUS_ADDRESS=unix:path=/run/user/36945/bus +DISPLAY=localhost:25.0 +GAZEBO_MASTER_URI=http://localhost:11345 +GAZEBO_MODEL_DATABASE_URI=http://models.gazebosim.org +GAZEBO_MODEL_PATH=/usr/share/gazebo-11/models:/opt/ros/galactic/../galactic-turtlebot3-quickstart/share/turtlebot3_gazebo/models: +GAZEBO_PLUGIN_PATH=/usr/lib/gazebo-11/plugins:/opt/ros/galactic/../galactic-turtlebot3-quickstart/lib: +GAZEBO_RESOURCE_PATH=/usr/share/gazebo-11:/opt/ros/galactic/../galactic-turtlebot3-quickstart/share/turtlebot3_gazebo/worlds: +HG=/usr/bin/hg +HOME=/home/ps16214 +LANG=en_US.UTF-8 +LD_LIBRARY_PATH=/usr/lib/gazebo-11/plugins:/opt/ros/galactic-turtlebot3-quickstart/lib:/opt/ros/galactic/opt/yaml_cpp_vendor/lib:/opt/ros/galactic/opt/rviz_ogre_vendor/lib:/opt/ros/galactic/lib:/usr/lib/gazebo-11/plugins: +LOGNAME=ps16214 +MAIL=/var/spool/mail/ps16214 +MAKEFLAGS= +MAKELEVEL=1 +MAKE_TERMERR=/dev/pts/21 +MAKE_TERMOUT=/dev/pts/21 +MFLAGS= +MKLROOT=/opt/intel/mkl +MOTD_SHOWN=pam +OGRE_RESOURCE_PATH=/usr/lib/OGRE +OLDPWD=/home/ps16214 +PATH=/opt/ros/galactic-turtlebot3-quickstart/bin:/opt/ros/galactic/bin:/usr/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/cuda/bin:/opt/cuda/nsight_compute:/opt/cuda/nsight_systems/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/share/ +PKG_CONFIG_PATH=/opt/ros/galactic-turtlebot3-quickstart/lib/pkgconfig:/opt/ros/galactic/lib/pkgconfig +PWD=/home/ps16214/tb3-ros2-template/build/my_pkg +PYTHONPATH=/home/ps16214/py_pubsub/install/py_pubsub/lib/python3.10/site-packages:/opt/ros/galactic-turtlebot3-quickstart/lib/python3.10/site-packages:/opt/ros/galactic/lib/python3.10/site-packages +ROS_DISTRO=galactic +ROS_DOMAIN_ID=55 +ROS_LOCALHOST_ONLY=0 +ROS_PYTHON_VERSION=3 +ROS_VERSION=2 +SHELL=/bin/bash +SHLVL=1 +SSH_CLIENT=10.1.65.86 34906 22 +SSH_CONNECTION=10.1.65.86 34906 195.37.232.77 22 +SSH_TTY=/dev/pts/21 +TERM=xterm-256color +TURTLEBOT3_MODEL=waffle_pi +USER=ps16214 +XDG_RUNTIME_DIR=/run/user/36945 +XDG_SESSION_CLASS=user +XDG_SESSION_ID=182 +XDG_SESSION_TYPE=tty +_=/usr/bin/env diff --git a/build/my_pkg/my_pkg b/build/my_pkg/my_pkg new file mode 120000 index 0000000..df263f1 --- /dev/null +++ b/build/my_pkg/my_pkg @@ -0,0 +1 @@ +/home/ps16214/tb3-ros2-template/src/my_pkg/my_pkg \ No newline at end of file diff --git a/build/my_pkg/my_pkg.egg-info/PKG-INFO b/build/my_pkg/my_pkg.egg-info/PKG-INFO new file mode 100644 index 0000000..122c663 --- /dev/null +++ b/build/my_pkg/my_pkg.egg-info/PKG-INFO @@ -0,0 +1,12 @@ +Metadata-Version: 2.1 +Name: my-pkg +Version: 0.0.0 +Summary: TODO: Package description +Home-page: UNKNOWN +Maintainer: ps16214 +Maintainer-email: ps16214@todo.todo +License: TODO: License declaration +Platform: UNKNOWN + +UNKNOWN + diff --git a/build/my_pkg/my_pkg.egg-info/SOURCES.txt b/build/my_pkg/my_pkg.egg-info/SOURCES.txt new file mode 100644 index 0000000..e51a291 --- /dev/null +++ b/build/my_pkg/my_pkg.egg-info/SOURCES.txt @@ -0,0 +1,13 @@ +package.xml +setup.cfg +setup.py +my_pkg/__init__.py +my_pkg/tb3.py +my_pkg.egg-info/PKG-INFO +my_pkg.egg-info/SOURCES.txt +my_pkg.egg-info/dependency_links.txt +my_pkg.egg-info/entry_points.txt +my_pkg.egg-info/requires.txt +my_pkg.egg-info/top_level.txt +my_pkg.egg-info/zip-safe +resource/my_pkg \ No newline at end of file diff --git a/build/my_pkg/my_pkg.egg-info/dependency_links.txt b/build/my_pkg/my_pkg.egg-info/dependency_links.txt new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/build/my_pkg/my_pkg.egg-info/dependency_links.txt @@ -0,0 +1 @@ + diff --git a/build/my_pkg/my_pkg.egg-info/entry_points.txt b/build/my_pkg/my_pkg.egg-info/entry_points.txt new file mode 100644 index 0000000..506e57b --- /dev/null +++ b/build/my_pkg/my_pkg.egg-info/entry_points.txt @@ -0,0 +1,3 @@ +[console_scripts] +tb3 = my_pkg.tb3:main + diff --git a/build/my_pkg/my_pkg.egg-info/requires.txt b/build/my_pkg/my_pkg.egg-info/requires.txt new file mode 100644 index 0000000..49fe098 --- /dev/null +++ b/build/my_pkg/my_pkg.egg-info/requires.txt @@ -0,0 +1 @@ +setuptools diff --git a/build/my_pkg/my_pkg.egg-info/top_level.txt b/build/my_pkg/my_pkg.egg-info/top_level.txt new file mode 100644 index 0000000..b5a0f45 --- /dev/null +++ b/build/my_pkg/my_pkg.egg-info/top_level.txt @@ -0,0 +1 @@ +my_pkg diff --git a/build/my_pkg/my_pkg.egg-info/zip-safe b/build/my_pkg/my_pkg.egg-info/zip-safe new file mode 100644 index 0000000..8b13789 --- /dev/null +++ b/build/my_pkg/my_pkg.egg-info/zip-safe @@ -0,0 +1 @@ + diff --git a/build/my_pkg/package.xml b/build/my_pkg/package.xml new file mode 120000 index 0000000..bbfc145 --- /dev/null +++ b/build/my_pkg/package.xml @@ -0,0 +1 @@ +/home/ps16214/tb3-ros2-template/src/my_pkg/package.xml \ No newline at end of file diff --git a/build/my_pkg/resource/my_pkg b/build/my_pkg/resource/my_pkg new file mode 120000 index 0000000..b12fd10 --- /dev/null +++ b/build/my_pkg/resource/my_pkg @@ -0,0 +1 @@ +/home/ps16214/tb3-ros2-template/src/my_pkg/resource/my_pkg \ No newline at end of file diff --git a/build/my_pkg/setup.cfg b/build/my_pkg/setup.cfg new file mode 120000 index 0000000..f564287 --- /dev/null +++ b/build/my_pkg/setup.cfg @@ -0,0 +1 @@ +/home/ps16214/tb3-ros2-template/src/my_pkg/setup.cfg \ No newline at end of file diff --git a/build/my_pkg/setup.py b/build/my_pkg/setup.py new file mode 120000 index 0000000..008b948 --- /dev/null +++ b/build/my_pkg/setup.py @@ -0,0 +1 @@ +/home/ps16214/tb3-ros2-template/src/my_pkg/setup.py \ No newline at end of file diff --git a/build/my_pkg/share/my_pkg/hook/pythonpath_develop.dsv b/build/my_pkg/share/my_pkg/hook/pythonpath_develop.dsv new file mode 100644 index 0000000..c5762d7 --- /dev/null +++ b/build/my_pkg/share/my_pkg/hook/pythonpath_develop.dsv @@ -0,0 +1 @@ +prepend-non-duplicate;PYTHONPATH;/home/ps16214/tb3-ros2-template/build/my_pkg diff --git a/build/my_pkg/share/my_pkg/hook/pythonpath_develop.ps1 b/build/my_pkg/share/my_pkg/hook/pythonpath_develop.ps1 new file mode 100644 index 0000000..2a24c36 --- /dev/null +++ b/build/my_pkg/share/my_pkg/hook/pythonpath_develop.ps1 @@ -0,0 +1,3 @@ +# generated from colcon_powershell/shell/template/hook_prepend_value.ps1.em + +colcon_prepend_unique_value PYTHONPATH "$env:COLCON_CURRENT_PREFIX\/home/ps16214/tb3-ros2-template/build/my_pkg" diff --git a/build/my_pkg/share/my_pkg/hook/pythonpath_develop.sh b/build/my_pkg/share/my_pkg/hook/pythonpath_develop.sh new file mode 100644 index 0000000..503f113 --- /dev/null +++ b/build/my_pkg/share/my_pkg/hook/pythonpath_develop.sh @@ -0,0 +1,3 @@ +# generated from colcon_core/shell/template/hook_prepend_value.sh.em + +_colcon_prepend_unique_value PYTHONPATH "/home/ps16214/tb3-ros2-template/build/my_pkg" diff --git a/install/.colcon_install_layout b/install/.colcon_install_layout new file mode 100644 index 0000000..3aad533 --- /dev/null +++ b/install/.colcon_install_layout @@ -0,0 +1 @@ +isolated diff --git a/install/COLCON_IGNORE b/install/COLCON_IGNORE new file mode 100644 index 0000000..e69de29 diff --git a/install/_local_setup_util_ps1.py b/install/_local_setup_util_ps1.py new file mode 100644 index 0000000..24fb7aa --- /dev/null +++ b/install/_local_setup_util_ps1.py @@ -0,0 +1,404 @@ +# Copyright 2016-2019 Dirk Thomas +# Licensed under the Apache License, Version 2.0 + +import argparse +from collections import OrderedDict +import os +from pathlib import Path +import sys + + +FORMAT_STR_COMMENT_LINE = '# {comment}' +FORMAT_STR_SET_ENV_VAR = 'Set-Item -Path "Env:{name}" -Value "{value}"' +FORMAT_STR_USE_ENV_VAR = '$env:{name}' +FORMAT_STR_INVOKE_SCRIPT = '_colcon_prefix_powershell_source_script "{script_path}"' +FORMAT_STR_REMOVE_LEADING_SEPARATOR = '' +FORMAT_STR_REMOVE_TRAILING_SEPARATOR = '' + +DSV_TYPE_APPEND_NON_DUPLICATE = 'append-non-duplicate' +DSV_TYPE_PREPEND_NON_DUPLICATE = 'prepend-non-duplicate' +DSV_TYPE_PREPEND_NON_DUPLICATE_IF_EXISTS = 'prepend-non-duplicate-if-exists' +DSV_TYPE_SET = 'set' +DSV_TYPE_SET_IF_UNSET = 'set-if-unset' +DSV_TYPE_SOURCE = 'source' + + +def main(argv=sys.argv[1:]): # noqa: D103 + parser = argparse.ArgumentParser( + description='Output shell commands for the packages in topological ' + 'order') + parser.add_argument( + 'primary_extension', + help='The file extension of the primary shell') + parser.add_argument( + 'additional_extension', nargs='?', + help='The additional file extension to be considered') + parser.add_argument( + '--merged-install', action='store_true', + help='All install prefixes are merged into a single location') + args = parser.parse_args(argv) + + packages = get_packages(Path(__file__).parent, args.merged_install) + + ordered_packages = order_packages(packages) + for pkg_name in ordered_packages: + if _include_comments(): + print( + FORMAT_STR_COMMENT_LINE.format_map( + {'comment': 'Package: ' + pkg_name})) + prefix = os.path.abspath(os.path.dirname(__file__)) + if not args.merged_install: + prefix = os.path.join(prefix, pkg_name) + for line in get_commands( + pkg_name, prefix, args.primary_extension, + args.additional_extension + ): + print(line) + + for line in _remove_ending_separators(): + print(line) + + +def get_packages(prefix_path, merged_install): + """ + Find packages based on colcon-specific files created during installation. + + :param Path prefix_path: The install prefix path of all packages + :param bool merged_install: The flag if the packages are all installed + directly in the prefix or if each package is installed in a subdirectory + named after the package + :returns: A mapping from the package name to the set of runtime + dependencies + :rtype: dict + """ + packages = {} + # since importing colcon_core isn't feasible here the following constant + # must match colcon_core.location.get_relative_package_index_path() + subdirectory = 'share/colcon-core/packages' + if merged_install: + # return if workspace is empty + if not (prefix_path / subdirectory).is_dir(): + return packages + # find all files in the subdirectory + for p in (prefix_path / subdirectory).iterdir(): + if not p.is_file(): + continue + if p.name.startswith('.'): + continue + add_package_runtime_dependencies(p, packages) + else: + # for each subdirectory look for the package specific file + for p in prefix_path.iterdir(): + if not p.is_dir(): + continue + if p.name.startswith('.'): + continue + p = p / subdirectory / p.name + if p.is_file(): + add_package_runtime_dependencies(p, packages) + + # remove unknown dependencies + pkg_names = set(packages.keys()) + for k in packages.keys(): + packages[k] = {d for d in packages[k] if d in pkg_names} + + return packages + + +def add_package_runtime_dependencies(path, packages): + """ + Check the path and if it exists extract the packages runtime dependencies. + + :param Path path: The resource file containing the runtime dependencies + :param dict packages: A mapping from package names to the sets of runtime + dependencies to add to + """ + content = path.read_text() + dependencies = set(content.split(os.pathsep) if content else []) + packages[path.name] = dependencies + + +def order_packages(packages): + """ + Order packages topologically. + + :param dict packages: A mapping from package name to the set of runtime + dependencies + :returns: The package names + :rtype: list + """ + # select packages with no dependencies in alphabetical order + to_be_ordered = list(packages.keys()) + ordered = [] + while to_be_ordered: + pkg_names_without_deps = [ + name for name in to_be_ordered if not packages[name]] + if not pkg_names_without_deps: + reduce_cycle_set(packages) + raise RuntimeError( + 'Circular dependency between: ' + ', '.join(sorted(packages))) + pkg_names_without_deps.sort() + pkg_name = pkg_names_without_deps[0] + to_be_ordered.remove(pkg_name) + ordered.append(pkg_name) + # remove item from dependency lists + for k in list(packages.keys()): + if pkg_name in packages[k]: + packages[k].remove(pkg_name) + return ordered + + +def reduce_cycle_set(packages): + """ + Reduce the set of packages to the ones part of the circular dependency. + + :param dict packages: A mapping from package name to the set of runtime + dependencies which is modified in place + """ + last_depended = None + while len(packages) > 0: + # get all remaining dependencies + depended = set() + for pkg_name, dependencies in packages.items(): + depended = depended.union(dependencies) + # remove all packages which are not dependent on + for name in list(packages.keys()): + if name not in depended: + del packages[name] + if last_depended: + # if remaining packages haven't changed return them + if last_depended == depended: + return packages.keys() + # otherwise reduce again + last_depended = depended + + +def _include_comments(): + # skipping comment lines when COLCON_TRACE is not set speeds up the + # processing especially on Windows + return bool(os.environ.get('COLCON_TRACE')) + + +def get_commands(pkg_name, prefix, primary_extension, additional_extension): + commands = [] + package_dsv_path = os.path.join(prefix, 'share', pkg_name, 'package.dsv') + if os.path.exists(package_dsv_path): + commands += process_dsv_file( + package_dsv_path, prefix, primary_extension, additional_extension) + return commands + + +def process_dsv_file( + dsv_path, prefix, primary_extension=None, additional_extension=None +): + commands = [] + if _include_comments(): + commands.append(FORMAT_STR_COMMENT_LINE.format_map({'comment': dsv_path})) + with open(dsv_path, 'r') as h: + content = h.read() + lines = content.splitlines() + + basenames = OrderedDict() + for i, line in enumerate(lines): + # skip over empty or whitespace-only lines + if not line.strip(): + continue + try: + type_, remainder = line.split(';', 1) + except ValueError: + raise RuntimeError( + "Line %d in '%s' doesn't contain a semicolon separating the " + 'type from the arguments' % (i + 1, dsv_path)) + if type_ != DSV_TYPE_SOURCE: + # handle non-source lines + try: + commands += handle_dsv_types_except_source( + type_, remainder, prefix) + except RuntimeError as e: + raise RuntimeError( + "Line %d in '%s' %s" % (i + 1, dsv_path, e)) from e + else: + # group remaining source lines by basename + path_without_ext, ext = os.path.splitext(remainder) + if path_without_ext not in basenames: + basenames[path_without_ext] = set() + assert ext.startswith('.') + ext = ext[1:] + if ext in (primary_extension, additional_extension): + basenames[path_without_ext].add(ext) + + # add the dsv extension to each basename if the file exists + for basename, extensions in basenames.items(): + if not os.path.isabs(basename): + basename = os.path.join(prefix, basename) + if os.path.exists(basename + '.dsv'): + extensions.add('dsv') + + for basename, extensions in basenames.items(): + if not os.path.isabs(basename): + basename = os.path.join(prefix, basename) + if 'dsv' in extensions: + # process dsv files recursively + commands += process_dsv_file( + basename + '.dsv', prefix, primary_extension=primary_extension, + additional_extension=additional_extension) + elif primary_extension in extensions and len(extensions) == 1: + # source primary-only files + commands += [ + FORMAT_STR_INVOKE_SCRIPT.format_map({ + 'prefix': prefix, + 'script_path': basename + '.' + primary_extension})] + elif additional_extension in extensions: + # source non-primary files + commands += [ + FORMAT_STR_INVOKE_SCRIPT.format_map({ + 'prefix': prefix, + 'script_path': basename + '.' + additional_extension})] + + return commands + + +def handle_dsv_types_except_source(type_, remainder, prefix): + commands = [] + if type_ in (DSV_TYPE_SET, DSV_TYPE_SET_IF_UNSET): + try: + env_name, value = remainder.split(';', 1) + except ValueError: + raise RuntimeError( + "doesn't contain a semicolon separating the environment name " + 'from the value') + try_prefixed_value = os.path.join(prefix, value) if value else prefix + if os.path.exists(try_prefixed_value): + value = try_prefixed_value + if type_ == DSV_TYPE_SET: + commands += _set(env_name, value) + elif type_ == DSV_TYPE_SET_IF_UNSET: + commands += _set_if_unset(env_name, value) + else: + assert False + elif type_ in ( + DSV_TYPE_APPEND_NON_DUPLICATE, + DSV_TYPE_PREPEND_NON_DUPLICATE, + DSV_TYPE_PREPEND_NON_DUPLICATE_IF_EXISTS + ): + try: + env_name_and_values = remainder.split(';') + except ValueError: + raise RuntimeError( + "doesn't contain a semicolon separating the environment name " + 'from the values') + env_name = env_name_and_values[0] + values = env_name_and_values[1:] + for value in values: + if not value: + value = prefix + elif not os.path.isabs(value): + value = os.path.join(prefix, value) + if ( + type_ == DSV_TYPE_PREPEND_NON_DUPLICATE_IF_EXISTS and + not os.path.exists(value) + ): + comment = 'skip extending {env_name} with not existing path: ' \ + '{value}'.format_map(locals()) + if _include_comments(): + commands.append( + FORMAT_STR_COMMENT_LINE.format_map({'comment': comment})) + elif type_ == DSV_TYPE_APPEND_NON_DUPLICATE: + commands += _append_unique_value(env_name, value) + else: + commands += _prepend_unique_value(env_name, value) + else: + raise RuntimeError( + 'contains an unknown environment hook type: ' + type_) + return commands + + +env_state = {} + + +def _append_unique_value(name, value): + global env_state + if name not in env_state: + if os.environ.get(name): + env_state[name] = set(os.environ[name].split(os.pathsep)) + else: + env_state[name] = set() + # append even if the variable has not been set yet, in case a shell script sets the + # same variable without the knowledge of this Python script. + # later _remove_ending_separators() will cleanup any unintentional leading separator + extend = FORMAT_STR_USE_ENV_VAR.format_map({'name': name}) + os.pathsep + line = FORMAT_STR_SET_ENV_VAR.format_map( + {'name': name, 'value': extend + value}) + if value not in env_state[name]: + env_state[name].add(value) + else: + if not _include_comments(): + return [] + line = FORMAT_STR_COMMENT_LINE.format_map({'comment': line}) + return [line] + + +def _prepend_unique_value(name, value): + global env_state + if name not in env_state: + if os.environ.get(name): + env_state[name] = set(os.environ[name].split(os.pathsep)) + else: + env_state[name] = set() + # prepend even if the variable has not been set yet, in case a shell script sets the + # same variable without the knowledge of this Python script. + # later _remove_ending_separators() will cleanup any unintentional trailing separator + extend = os.pathsep + FORMAT_STR_USE_ENV_VAR.format_map({'name': name}) + line = FORMAT_STR_SET_ENV_VAR.format_map( + {'name': name, 'value': value + extend}) + if value not in env_state[name]: + env_state[name].add(value) + else: + if not _include_comments(): + return [] + line = FORMAT_STR_COMMENT_LINE.format_map({'comment': line}) + return [line] + + +# generate commands for removing prepended underscores +def _remove_ending_separators(): + # do nothing if the shell extension does not implement the logic + if FORMAT_STR_REMOVE_TRAILING_SEPARATOR is None: + return [] + + global env_state + commands = [] + for name in env_state: + # skip variables that already had values before this script started prepending + if name in os.environ: + continue + commands += [ + FORMAT_STR_REMOVE_LEADING_SEPARATOR.format_map({'name': name}), + FORMAT_STR_REMOVE_TRAILING_SEPARATOR.format_map({'name': name})] + return commands + + +def _set(name, value): + global env_state + env_state[name] = value + line = FORMAT_STR_SET_ENV_VAR.format_map( + {'name': name, 'value': value}) + return [line] + + +def _set_if_unset(name, value): + global env_state + line = FORMAT_STR_SET_ENV_VAR.format_map( + {'name': name, 'value': value}) + if env_state.get(name, os.environ.get(name)): + line = FORMAT_STR_COMMENT_LINE.format_map({'comment': line}) + return [line] + + +if __name__ == '__main__': # pragma: no cover + try: + rc = main() + except RuntimeError as e: + print(str(e), file=sys.stderr) + rc = 1 + sys.exit(rc) diff --git a/install/_local_setup_util_sh.py b/install/_local_setup_util_sh.py new file mode 100644 index 0000000..7b7ad9d --- /dev/null +++ b/install/_local_setup_util_sh.py @@ -0,0 +1,404 @@ +# Copyright 2016-2019 Dirk Thomas +# Licensed under the Apache License, Version 2.0 + +import argparse +from collections import OrderedDict +import os +from pathlib import Path +import sys + + +FORMAT_STR_COMMENT_LINE = '# {comment}' +FORMAT_STR_SET_ENV_VAR = 'export {name}="{value}"' +FORMAT_STR_USE_ENV_VAR = '${name}' +FORMAT_STR_INVOKE_SCRIPT = 'COLCON_CURRENT_PREFIX="{prefix}" _colcon_prefix_sh_source_script "{script_path}"' +FORMAT_STR_REMOVE_LEADING_SEPARATOR = 'if [ "$(echo -n ${name} | head -c 1)" = ":" ]; then export {name}=${{{name}#?}} ; fi' +FORMAT_STR_REMOVE_TRAILING_SEPARATOR = 'if [ "$(echo -n ${name} | tail -c 1)" = ":" ]; then export {name}=${{{name}%?}} ; fi' + +DSV_TYPE_APPEND_NON_DUPLICATE = 'append-non-duplicate' +DSV_TYPE_PREPEND_NON_DUPLICATE = 'prepend-non-duplicate' +DSV_TYPE_PREPEND_NON_DUPLICATE_IF_EXISTS = 'prepend-non-duplicate-if-exists' +DSV_TYPE_SET = 'set' +DSV_TYPE_SET_IF_UNSET = 'set-if-unset' +DSV_TYPE_SOURCE = 'source' + + +def main(argv=sys.argv[1:]): # noqa: D103 + parser = argparse.ArgumentParser( + description='Output shell commands for the packages in topological ' + 'order') + parser.add_argument( + 'primary_extension', + help='The file extension of the primary shell') + parser.add_argument( + 'additional_extension', nargs='?', + help='The additional file extension to be considered') + parser.add_argument( + '--merged-install', action='store_true', + help='All install prefixes are merged into a single location') + args = parser.parse_args(argv) + + packages = get_packages(Path(__file__).parent, args.merged_install) + + ordered_packages = order_packages(packages) + for pkg_name in ordered_packages: + if _include_comments(): + print( + FORMAT_STR_COMMENT_LINE.format_map( + {'comment': 'Package: ' + pkg_name})) + prefix = os.path.abspath(os.path.dirname(__file__)) + if not args.merged_install: + prefix = os.path.join(prefix, pkg_name) + for line in get_commands( + pkg_name, prefix, args.primary_extension, + args.additional_extension + ): + print(line) + + for line in _remove_ending_separators(): + print(line) + + +def get_packages(prefix_path, merged_install): + """ + Find packages based on colcon-specific files created during installation. + + :param Path prefix_path: The install prefix path of all packages + :param bool merged_install: The flag if the packages are all installed + directly in the prefix or if each package is installed in a subdirectory + named after the package + :returns: A mapping from the package name to the set of runtime + dependencies + :rtype: dict + """ + packages = {} + # since importing colcon_core isn't feasible here the following constant + # must match colcon_core.location.get_relative_package_index_path() + subdirectory = 'share/colcon-core/packages' + if merged_install: + # return if workspace is empty + if not (prefix_path / subdirectory).is_dir(): + return packages + # find all files in the subdirectory + for p in (prefix_path / subdirectory).iterdir(): + if not p.is_file(): + continue + if p.name.startswith('.'): + continue + add_package_runtime_dependencies(p, packages) + else: + # for each subdirectory look for the package specific file + for p in prefix_path.iterdir(): + if not p.is_dir(): + continue + if p.name.startswith('.'): + continue + p = p / subdirectory / p.name + if p.is_file(): + add_package_runtime_dependencies(p, packages) + + # remove unknown dependencies + pkg_names = set(packages.keys()) + for k in packages.keys(): + packages[k] = {d for d in packages[k] if d in pkg_names} + + return packages + + +def add_package_runtime_dependencies(path, packages): + """ + Check the path and if it exists extract the packages runtime dependencies. + + :param Path path: The resource file containing the runtime dependencies + :param dict packages: A mapping from package names to the sets of runtime + dependencies to add to + """ + content = path.read_text() + dependencies = set(content.split(os.pathsep) if content else []) + packages[path.name] = dependencies + + +def order_packages(packages): + """ + Order packages topologically. + + :param dict packages: A mapping from package name to the set of runtime + dependencies + :returns: The package names + :rtype: list + """ + # select packages with no dependencies in alphabetical order + to_be_ordered = list(packages.keys()) + ordered = [] + while to_be_ordered: + pkg_names_without_deps = [ + name for name in to_be_ordered if not packages[name]] + if not pkg_names_without_deps: + reduce_cycle_set(packages) + raise RuntimeError( + 'Circular dependency between: ' + ', '.join(sorted(packages))) + pkg_names_without_deps.sort() + pkg_name = pkg_names_without_deps[0] + to_be_ordered.remove(pkg_name) + ordered.append(pkg_name) + # remove item from dependency lists + for k in list(packages.keys()): + if pkg_name in packages[k]: + packages[k].remove(pkg_name) + return ordered + + +def reduce_cycle_set(packages): + """ + Reduce the set of packages to the ones part of the circular dependency. + + :param dict packages: A mapping from package name to the set of runtime + dependencies which is modified in place + """ + last_depended = None + while len(packages) > 0: + # get all remaining dependencies + depended = set() + for pkg_name, dependencies in packages.items(): + depended = depended.union(dependencies) + # remove all packages which are not dependent on + for name in list(packages.keys()): + if name not in depended: + del packages[name] + if last_depended: + # if remaining packages haven't changed return them + if last_depended == depended: + return packages.keys() + # otherwise reduce again + last_depended = depended + + +def _include_comments(): + # skipping comment lines when COLCON_TRACE is not set speeds up the + # processing especially on Windows + return bool(os.environ.get('COLCON_TRACE')) + + +def get_commands(pkg_name, prefix, primary_extension, additional_extension): + commands = [] + package_dsv_path = os.path.join(prefix, 'share', pkg_name, 'package.dsv') + if os.path.exists(package_dsv_path): + commands += process_dsv_file( + package_dsv_path, prefix, primary_extension, additional_extension) + return commands + + +def process_dsv_file( + dsv_path, prefix, primary_extension=None, additional_extension=None +): + commands = [] + if _include_comments(): + commands.append(FORMAT_STR_COMMENT_LINE.format_map({'comment': dsv_path})) + with open(dsv_path, 'r') as h: + content = h.read() + lines = content.splitlines() + + basenames = OrderedDict() + for i, line in enumerate(lines): + # skip over empty or whitespace-only lines + if not line.strip(): + continue + try: + type_, remainder = line.split(';', 1) + except ValueError: + raise RuntimeError( + "Line %d in '%s' doesn't contain a semicolon separating the " + 'type from the arguments' % (i + 1, dsv_path)) + if type_ != DSV_TYPE_SOURCE: + # handle non-source lines + try: + commands += handle_dsv_types_except_source( + type_, remainder, prefix) + except RuntimeError as e: + raise RuntimeError( + "Line %d in '%s' %s" % (i + 1, dsv_path, e)) from e + else: + # group remaining source lines by basename + path_without_ext, ext = os.path.splitext(remainder) + if path_without_ext not in basenames: + basenames[path_without_ext] = set() + assert ext.startswith('.') + ext = ext[1:] + if ext in (primary_extension, additional_extension): + basenames[path_without_ext].add(ext) + + # add the dsv extension to each basename if the file exists + for basename, extensions in basenames.items(): + if not os.path.isabs(basename): + basename = os.path.join(prefix, basename) + if os.path.exists(basename + '.dsv'): + extensions.add('dsv') + + for basename, extensions in basenames.items(): + if not os.path.isabs(basename): + basename = os.path.join(prefix, basename) + if 'dsv' in extensions: + # process dsv files recursively + commands += process_dsv_file( + basename + '.dsv', prefix, primary_extension=primary_extension, + additional_extension=additional_extension) + elif primary_extension in extensions and len(extensions) == 1: + # source primary-only files + commands += [ + FORMAT_STR_INVOKE_SCRIPT.format_map({ + 'prefix': prefix, + 'script_path': basename + '.' + primary_extension})] + elif additional_extension in extensions: + # source non-primary files + commands += [ + FORMAT_STR_INVOKE_SCRIPT.format_map({ + 'prefix': prefix, + 'script_path': basename + '.' + additional_extension})] + + return commands + + +def handle_dsv_types_except_source(type_, remainder, prefix): + commands = [] + if type_ in (DSV_TYPE_SET, DSV_TYPE_SET_IF_UNSET): + try: + env_name, value = remainder.split(';', 1) + except ValueError: + raise RuntimeError( + "doesn't contain a semicolon separating the environment name " + 'from the value') + try_prefixed_value = os.path.join(prefix, value) if value else prefix + if os.path.exists(try_prefixed_value): + value = try_prefixed_value + if type_ == DSV_TYPE_SET: + commands += _set(env_name, value) + elif type_ == DSV_TYPE_SET_IF_UNSET: + commands += _set_if_unset(env_name, value) + else: + assert False + elif type_ in ( + DSV_TYPE_APPEND_NON_DUPLICATE, + DSV_TYPE_PREPEND_NON_DUPLICATE, + DSV_TYPE_PREPEND_NON_DUPLICATE_IF_EXISTS + ): + try: + env_name_and_values = remainder.split(';') + except ValueError: + raise RuntimeError( + "doesn't contain a semicolon separating the environment name " + 'from the values') + env_name = env_name_and_values[0] + values = env_name_and_values[1:] + for value in values: + if not value: + value = prefix + elif not os.path.isabs(value): + value = os.path.join(prefix, value) + if ( + type_ == DSV_TYPE_PREPEND_NON_DUPLICATE_IF_EXISTS and + not os.path.exists(value) + ): + comment = 'skip extending {env_name} with not existing path: ' \ + '{value}'.format_map(locals()) + if _include_comments(): + commands.append( + FORMAT_STR_COMMENT_LINE.format_map({'comment': comment})) + elif type_ == DSV_TYPE_APPEND_NON_DUPLICATE: + commands += _append_unique_value(env_name, value) + else: + commands += _prepend_unique_value(env_name, value) + else: + raise RuntimeError( + 'contains an unknown environment hook type: ' + type_) + return commands + + +env_state = {} + + +def _append_unique_value(name, value): + global env_state + if name not in env_state: + if os.environ.get(name): + env_state[name] = set(os.environ[name].split(os.pathsep)) + else: + env_state[name] = set() + # append even if the variable has not been set yet, in case a shell script sets the + # same variable without the knowledge of this Python script. + # later _remove_ending_separators() will cleanup any unintentional leading separator + extend = FORMAT_STR_USE_ENV_VAR.format_map({'name': name}) + os.pathsep + line = FORMAT_STR_SET_ENV_VAR.format_map( + {'name': name, 'value': extend + value}) + if value not in env_state[name]: + env_state[name].add(value) + else: + if not _include_comments(): + return [] + line = FORMAT_STR_COMMENT_LINE.format_map({'comment': line}) + return [line] + + +def _prepend_unique_value(name, value): + global env_state + if name not in env_state: + if os.environ.get(name): + env_state[name] = set(os.environ[name].split(os.pathsep)) + else: + env_state[name] = set() + # prepend even if the variable has not been set yet, in case a shell script sets the + # same variable without the knowledge of this Python script. + # later _remove_ending_separators() will cleanup any unintentional trailing separator + extend = os.pathsep + FORMAT_STR_USE_ENV_VAR.format_map({'name': name}) + line = FORMAT_STR_SET_ENV_VAR.format_map( + {'name': name, 'value': value + extend}) + if value not in env_state[name]: + env_state[name].add(value) + else: + if not _include_comments(): + return [] + line = FORMAT_STR_COMMENT_LINE.format_map({'comment': line}) + return [line] + + +# generate commands for removing prepended underscores +def _remove_ending_separators(): + # do nothing if the shell extension does not implement the logic + if FORMAT_STR_REMOVE_TRAILING_SEPARATOR is None: + return [] + + global env_state + commands = [] + for name in env_state: + # skip variables that already had values before this script started prepending + if name in os.environ: + continue + commands += [ + FORMAT_STR_REMOVE_LEADING_SEPARATOR.format_map({'name': name}), + FORMAT_STR_REMOVE_TRAILING_SEPARATOR.format_map({'name': name})] + return commands + + +def _set(name, value): + global env_state + env_state[name] = value + line = FORMAT_STR_SET_ENV_VAR.format_map( + {'name': name, 'value': value}) + return [line] + + +def _set_if_unset(name, value): + global env_state + line = FORMAT_STR_SET_ENV_VAR.format_map( + {'name': name, 'value': value}) + if env_state.get(name, os.environ.get(name)): + line = FORMAT_STR_COMMENT_LINE.format_map({'comment': line}) + return [line] + + +if __name__ == '__main__': # pragma: no cover + try: + rc = main() + except RuntimeError as e: + print(str(e), file=sys.stderr) + rc = 1 + sys.exit(rc) diff --git a/install/local_setup.bash b/install/local_setup.bash new file mode 100644 index 0000000..54e87c3 --- /dev/null +++ b/install/local_setup.bash @@ -0,0 +1,107 @@ +# generated from colcon_bash/shell/template/prefix.bash.em + +# This script extends the environment with all packages contained in this +# prefix path. + +# a bash script is able to determine its own path if necessary +if [ -z "$COLCON_CURRENT_PREFIX" ]; then + _colcon_prefix_bash_COLCON_CURRENT_PREFIX="$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)" +else + _colcon_prefix_bash_COLCON_CURRENT_PREFIX="$COLCON_CURRENT_PREFIX" +fi + +# function to prepend a value to a variable +# which uses colons as separators +# duplicates as well as trailing separators are avoided +# first argument: the name of the result variable +# second argument: the value to be prepended +_colcon_prefix_bash_prepend_unique_value() { + # arguments + _listname="$1" + _value="$2" + + # get values from variable + eval _values=\"\$$_listname\" + # backup the field separator + _colcon_prefix_bash_prepend_unique_value_IFS="$IFS" + IFS=":" + # start with the new value + _all_values="$_value" + # iterate over existing values in the variable + for _item in $_values; do + # ignore empty strings + if [ -z "$_item" ]; then + continue + fi + # ignore duplicates of _value + if [ "$_item" = "$_value" ]; then + continue + fi + # keep non-duplicate values + _all_values="$_all_values:$_item" + done + unset _item + # restore the field separator + IFS="$_colcon_prefix_bash_prepend_unique_value_IFS" + unset _colcon_prefix_bash_prepend_unique_value_IFS + # export the updated variable + eval export $_listname=\"$_all_values\" + unset _all_values + unset _values + + unset _value + unset _listname +} + +# add this prefix to the COLCON_PREFIX_PATH +_colcon_prefix_bash_prepend_unique_value COLCON_PREFIX_PATH "$_colcon_prefix_bash_COLCON_CURRENT_PREFIX" +unset _colcon_prefix_bash_prepend_unique_value + +# check environment variable for custom Python executable +if [ -n "$COLCON_PYTHON_EXECUTABLE" ]; then + if [ ! -f "$COLCON_PYTHON_EXECUTABLE" ]; then + echo "error: COLCON_PYTHON_EXECUTABLE '$COLCON_PYTHON_EXECUTABLE' doesn't exist" + return 1 + fi + _colcon_python_executable="$COLCON_PYTHON_EXECUTABLE" +else + # try the Python executable known at configure time + _colcon_python_executable="/usr/bin/python" + # if it doesn't exist try a fall back + if [ ! -f "$_colcon_python_executable" ]; then + if ! /usr/bin/env python3 --version > /dev/null 2> /dev/null; then + echo "error: unable to find python3 executable" + return 1 + fi + _colcon_python_executable=`/usr/bin/env python3 -c "import sys; print(sys.executable)"` + fi +fi + +# function to source another script with conditional trace output +# first argument: the path of the script +_colcon_prefix_sh_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo ". \"$1\"" + fi + . "$1" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# get all commands in topological order +_colcon_ordered_commands="$($_colcon_python_executable "$_colcon_prefix_bash_COLCON_CURRENT_PREFIX/_local_setup_util_sh.py" sh bash)" +unset _colcon_python_executable +if [ -n "$COLCON_TRACE" ]; then + echo "Execute generated script:" + echo "<<<" + echo "${_colcon_ordered_commands}" + echo ">>>" +fi +eval "${_colcon_ordered_commands}" +unset _colcon_ordered_commands + +unset _colcon_prefix_sh_source_script + +unset _colcon_prefix_bash_COLCON_CURRENT_PREFIX diff --git a/install/local_setup.ps1 b/install/local_setup.ps1 new file mode 100644 index 0000000..07caed9 --- /dev/null +++ b/install/local_setup.ps1 @@ -0,0 +1,55 @@ +# generated from colcon_powershell/shell/template/prefix.ps1.em + +# This script extends the environment with all packages contained in this +# prefix path. + +# check environment variable for custom Python executable +if ($env:COLCON_PYTHON_EXECUTABLE) { + if (!(Test-Path "$env:COLCON_PYTHON_EXECUTABLE" -PathType Leaf)) { + echo "error: COLCON_PYTHON_EXECUTABLE '$env:COLCON_PYTHON_EXECUTABLE' doesn't exist" + exit 1 + } + $_colcon_python_executable="$env:COLCON_PYTHON_EXECUTABLE" +} else { + # use the Python executable known at configure time + $_colcon_python_executable="/usr/bin/python" + # if it doesn't exist try a fall back + if (!(Test-Path "$_colcon_python_executable" -PathType Leaf)) { + if (!(Get-Command "python3" -ErrorAction SilentlyContinue)) { + echo "error: unable to find python3 executable" + exit 1 + } + $_colcon_python_executable="python3" + } +} + +# function to source another script with conditional trace output +# first argument: the path of the script +function _colcon_prefix_powershell_source_script { + param ( + $_colcon_prefix_powershell_source_script_param + ) + # source script with conditional trace output + if (Test-Path $_colcon_prefix_powershell_source_script_param) { + if ($env:COLCON_TRACE) { + echo ". '$_colcon_prefix_powershell_source_script_param'" + } + . "$_colcon_prefix_powershell_source_script_param" + } else { + Write-Error "not found: '$_colcon_prefix_powershell_source_script_param'" + } +} + +# get all commands in topological order +$_colcon_ordered_commands = & "$_colcon_python_executable" "$(Split-Path $PSCommandPath -Parent)/_local_setup_util_ps1.py" ps1 + +# execute all commands in topological order +if ($env:COLCON_TRACE) { + echo "Execute generated script:" + echo "<<<" + $_colcon_ordered_commands.Split([Environment]::NewLine, [StringSplitOptions]::RemoveEmptyEntries) | Write-Output + echo ">>>" +} +if ($_colcon_ordered_commands) { + $_colcon_ordered_commands.Split([Environment]::NewLine, [StringSplitOptions]::RemoveEmptyEntries) | Invoke-Expression +} diff --git a/install/local_setup.sh b/install/local_setup.sh new file mode 100644 index 0000000..49f0e75 --- /dev/null +++ b/install/local_setup.sh @@ -0,0 +1,137 @@ +# generated from colcon_core/shell/template/prefix.sh.em + +# This script extends the environment with all packages contained in this +# prefix path. + +# since a plain shell script can't determine its own path when being sourced +# either use the provided COLCON_CURRENT_PREFIX +# or fall back to the build time prefix (if it exists) +_colcon_prefix_sh_COLCON_CURRENT_PREFIX="/home/ps16214/tb3-ros2-template/install" +if [ -z "$COLCON_CURRENT_PREFIX" ]; then + if [ ! -d "$_colcon_prefix_sh_COLCON_CURRENT_PREFIX" ]; then + echo "The build time path \"$_colcon_prefix_sh_COLCON_CURRENT_PREFIX\" doesn't exist. Either source a script for a different shell or set the environment variable \"COLCON_CURRENT_PREFIX\" explicitly." 1>&2 + unset _colcon_prefix_sh_COLCON_CURRENT_PREFIX + return 1 + fi +else + _colcon_prefix_sh_COLCON_CURRENT_PREFIX="$COLCON_CURRENT_PREFIX" +fi + +# function to prepend a value to a variable +# which uses colons as separators +# duplicates as well as trailing separators are avoided +# first argument: the name of the result variable +# second argument: the value to be prepended +_colcon_prefix_sh_prepend_unique_value() { + # arguments + _listname="$1" + _value="$2" + + # get values from variable + eval _values=\"\$$_listname\" + # backup the field separator + _colcon_prefix_sh_prepend_unique_value_IFS="$IFS" + IFS=":" + # start with the new value + _all_values="$_value" + _contained_value="" + # iterate over existing values in the variable + for _item in $_values; do + # ignore empty strings + if [ -z "$_item" ]; then + continue + fi + # ignore duplicates of _value + if [ "$_item" = "$_value" ]; then + _contained_value=1 + continue + fi + # keep non-duplicate values + _all_values="$_all_values:$_item" + done + unset _item + if [ -z "$_contained_value" ]; then + if [ -n "$COLCON_TRACE" ]; then + if [ "$_all_values" = "$_value" ]; then + echo "export $_listname=$_value" + else + echo "export $_listname=$_value:\$$_listname" + fi + fi + fi + unset _contained_value + # restore the field separator + IFS="$_colcon_prefix_sh_prepend_unique_value_IFS" + unset _colcon_prefix_sh_prepend_unique_value_IFS + # export the updated variable + eval export $_listname=\"$_all_values\" + unset _all_values + unset _values + + unset _value + unset _listname +} + +# add this prefix to the COLCON_PREFIX_PATH +_colcon_prefix_sh_prepend_unique_value COLCON_PREFIX_PATH "$_colcon_prefix_sh_COLCON_CURRENT_PREFIX" +unset _colcon_prefix_sh_prepend_unique_value + +# check environment variable for custom Python executable +if [ -n "$COLCON_PYTHON_EXECUTABLE" ]; then + if [ ! -f "$COLCON_PYTHON_EXECUTABLE" ]; then + echo "error: COLCON_PYTHON_EXECUTABLE '$COLCON_PYTHON_EXECUTABLE' doesn't exist" + return 1 + fi + _colcon_python_executable="$COLCON_PYTHON_EXECUTABLE" +else + # try the Python executable known at configure time + _colcon_python_executable="/usr/bin/python" + # if it doesn't exist try a fall back + if [ ! -f "$_colcon_python_executable" ]; then + if ! /usr/bin/env python3 --version > /dev/null 2> /dev/null; then + echo "error: unable to find python3 executable" + return 1 + fi + _colcon_python_executable=`/usr/bin/env python3 -c "import sys; print(sys.executable)"` + fi +fi + +# function to source another script with conditional trace output +# first argument: the path of the script +_colcon_prefix_sh_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo "# . \"$1\"" + fi + . "$1" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# get all commands in topological order +_colcon_ordered_commands="$($_colcon_python_executable "$_colcon_prefix_sh_COLCON_CURRENT_PREFIX/_local_setup_util_sh.py" sh)" +unset _colcon_python_executable +if [ -n "$COLCON_TRACE" ]; then + echo "_colcon_prefix_sh_source_script() { + if [ -f \"\$1\" ]; then + if [ -n \"\$COLCON_TRACE\" ]; then + echo \"# . \\\"\$1\\\"\" + fi + . \"\$1\" + else + echo \"not found: \\\"\$1\\\"\" 1>&2 + fi + }" + echo "# Execute generated script:" + echo "# <<<" + echo "${_colcon_ordered_commands}" + echo "# >>>" + echo "unset _colcon_prefix_sh_source_script" +fi +eval "${_colcon_ordered_commands}" +unset _colcon_ordered_commands + +unset _colcon_prefix_sh_source_script + +unset _colcon_prefix_sh_COLCON_CURRENT_PREFIX diff --git a/install/local_setup.zsh b/install/local_setup.zsh new file mode 100644 index 0000000..0763f1b --- /dev/null +++ b/install/local_setup.zsh @@ -0,0 +1,120 @@ +# generated from colcon_zsh/shell/template/prefix.zsh.em + +# This script extends the environment with all packages contained in this +# prefix path. + +# a zsh script is able to determine its own path if necessary +if [ -z "$COLCON_CURRENT_PREFIX" ]; then + _colcon_prefix_zsh_COLCON_CURRENT_PREFIX="$(builtin cd -q "`dirname "${(%):-%N}"`" > /dev/null && pwd)" +else + _colcon_prefix_zsh_COLCON_CURRENT_PREFIX="$COLCON_CURRENT_PREFIX" +fi + +# function to convert array-like strings into arrays +# to workaround SH_WORD_SPLIT not being set +_colcon_prefix_zsh_convert_to_array() { + local _listname=$1 + local _dollar="$" + local _split="{=" + local _to_array="(\"$_dollar$_split$_listname}\")" + eval $_listname=$_to_array +} + +# function to prepend a value to a variable +# which uses colons as separators +# duplicates as well as trailing separators are avoided +# first argument: the name of the result variable +# second argument: the value to be prepended +_colcon_prefix_zsh_prepend_unique_value() { + # arguments + _listname="$1" + _value="$2" + + # get values from variable + eval _values=\"\$$_listname\" + # backup the field separator + _colcon_prefix_zsh_prepend_unique_value_IFS="$IFS" + IFS=":" + # start with the new value + _all_values="$_value" + # workaround SH_WORD_SPLIT not being set + _colcon_prefix_zsh_convert_to_array _values + # iterate over existing values in the variable + for _item in $_values; do + # ignore empty strings + if [ -z "$_item" ]; then + continue + fi + # ignore duplicates of _value + if [ "$_item" = "$_value" ]; then + continue + fi + # keep non-duplicate values + _all_values="$_all_values:$_item" + done + unset _item + # restore the field separator + IFS="$_colcon_prefix_zsh_prepend_unique_value_IFS" + unset _colcon_prefix_zsh_prepend_unique_value_IFS + # export the updated variable + eval export $_listname=\"$_all_values\" + unset _all_values + unset _values + + unset _value + unset _listname +} + +# add this prefix to the COLCON_PREFIX_PATH +_colcon_prefix_zsh_prepend_unique_value COLCON_PREFIX_PATH "$_colcon_prefix_zsh_COLCON_CURRENT_PREFIX" +unset _colcon_prefix_zsh_prepend_unique_value +unset _colcon_prefix_zsh_convert_to_array + +# check environment variable for custom Python executable +if [ -n "$COLCON_PYTHON_EXECUTABLE" ]; then + if [ ! -f "$COLCON_PYTHON_EXECUTABLE" ]; then + echo "error: COLCON_PYTHON_EXECUTABLE '$COLCON_PYTHON_EXECUTABLE' doesn't exist" + return 1 + fi + _colcon_python_executable="$COLCON_PYTHON_EXECUTABLE" +else + # try the Python executable known at configure time + _colcon_python_executable="/usr/bin/python" + # if it doesn't exist try a fall back + if [ ! -f "$_colcon_python_executable" ]; then + if ! /usr/bin/env python3 --version > /dev/null 2> /dev/null; then + echo "error: unable to find python3 executable" + return 1 + fi + _colcon_python_executable=`/usr/bin/env python3 -c "import sys; print(sys.executable)"` + fi +fi + +# function to source another script with conditional trace output +# first argument: the path of the script +_colcon_prefix_sh_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo ". \"$1\"" + fi + . "$1" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# get all commands in topological order +_colcon_ordered_commands="$($_colcon_python_executable "$_colcon_prefix_zsh_COLCON_CURRENT_PREFIX/_local_setup_util_sh.py" sh zsh)" +unset _colcon_python_executable +if [ -n "$COLCON_TRACE" ]; then + echo "Execute generated script:" + echo "<<<" + echo "${_colcon_ordered_commands}" + echo ">>>" +fi +eval "${_colcon_ordered_commands}" +unset _colcon_ordered_commands + +unset _colcon_prefix_sh_source_script + +unset _colcon_prefix_zsh_COLCON_CURRENT_PREFIX diff --git a/install/my_pkg/lib/my_pkg/tb3 b/install/my_pkg/lib/my_pkg/tb3 new file mode 100755 index 0000000..4e2b31d --- /dev/null +++ b/install/my_pkg/lib/my_pkg/tb3 @@ -0,0 +1,33 @@ +#!/usr/bin/python +# EASY-INSTALL-ENTRY-SCRIPT: 'my-pkg','console_scripts','tb3' +import re +import sys + +# for compatibility with easy_install; see #2198 +__requires__ = 'my-pkg' + +try: + from importlib.metadata import distribution +except ImportError: + try: + from importlib_metadata import distribution + except ImportError: + from pkg_resources import load_entry_point + + +def importlib_load_entry_point(spec, group, name): + dist_name, _, _ = spec.partition('==') + matches = ( + entry_point + for entry_point in distribution(dist_name).entry_points + if entry_point.group == group and entry_point.name == name + ) + return next(matches).load() + + +globals().setdefault('load_entry_point', importlib_load_entry_point) + + +if __name__ == '__main__': + sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0]) + sys.exit(load_entry_point('my-pkg', 'console_scripts', 'tb3')()) diff --git a/install/my_pkg/lib/python3.10/site-packages/my-pkg.egg-link b/install/my_pkg/lib/python3.10/site-packages/my-pkg.egg-link new file mode 100644 index 0000000..19696b5 --- /dev/null +++ b/install/my_pkg/lib/python3.10/site-packages/my-pkg.egg-link @@ -0,0 +1,2 @@ +/home/ps16214/tb3-ros2-template/build/my_pkg +. \ No newline at end of file diff --git a/install/my_pkg/share/ament_index/resource_index/packages/my_pkg b/install/my_pkg/share/ament_index/resource_index/packages/my_pkg new file mode 100644 index 0000000..e69de29 diff --git a/install/my_pkg/share/colcon-core/packages/my_pkg b/install/my_pkg/share/colcon-core/packages/my_pkg new file mode 100644 index 0000000..e69de29 diff --git a/install/my_pkg/share/my_pkg/hook/ament_prefix_path.dsv b/install/my_pkg/share/my_pkg/hook/ament_prefix_path.dsv new file mode 100644 index 0000000..79d4c95 --- /dev/null +++ b/install/my_pkg/share/my_pkg/hook/ament_prefix_path.dsv @@ -0,0 +1 @@ +prepend-non-duplicate;AMENT_PREFIX_PATH; diff --git a/install/my_pkg/share/my_pkg/hook/ament_prefix_path.ps1 b/install/my_pkg/share/my_pkg/hook/ament_prefix_path.ps1 new file mode 100644 index 0000000..26b9997 --- /dev/null +++ b/install/my_pkg/share/my_pkg/hook/ament_prefix_path.ps1 @@ -0,0 +1,3 @@ +# generated from colcon_powershell/shell/template/hook_prepend_value.ps1.em + +colcon_prepend_unique_value AMENT_PREFIX_PATH "$env:COLCON_CURRENT_PREFIX" diff --git a/install/my_pkg/share/my_pkg/hook/ament_prefix_path.sh b/install/my_pkg/share/my_pkg/hook/ament_prefix_path.sh new file mode 100644 index 0000000..f3041f6 --- /dev/null +++ b/install/my_pkg/share/my_pkg/hook/ament_prefix_path.sh @@ -0,0 +1,3 @@ +# generated from colcon_core/shell/template/hook_prepend_value.sh.em + +_colcon_prepend_unique_value AMENT_PREFIX_PATH "$COLCON_CURRENT_PREFIX" diff --git a/install/my_pkg/share/my_pkg/hook/pythonpath.dsv b/install/my_pkg/share/my_pkg/hook/pythonpath.dsv new file mode 100644 index 0000000..257067d --- /dev/null +++ b/install/my_pkg/share/my_pkg/hook/pythonpath.dsv @@ -0,0 +1 @@ +prepend-non-duplicate;PYTHONPATH;lib/python3.10/site-packages diff --git a/install/my_pkg/share/my_pkg/hook/pythonpath.ps1 b/install/my_pkg/share/my_pkg/hook/pythonpath.ps1 new file mode 100644 index 0000000..caffe83 --- /dev/null +++ b/install/my_pkg/share/my_pkg/hook/pythonpath.ps1 @@ -0,0 +1,3 @@ +# generated from colcon_powershell/shell/template/hook_prepend_value.ps1.em + +colcon_prepend_unique_value PYTHONPATH "$env:COLCON_CURRENT_PREFIX\lib/python3.10/site-packages" diff --git a/install/my_pkg/share/my_pkg/hook/pythonpath.sh b/install/my_pkg/share/my_pkg/hook/pythonpath.sh new file mode 100644 index 0000000..660c348 --- /dev/null +++ b/install/my_pkg/share/my_pkg/hook/pythonpath.sh @@ -0,0 +1,3 @@ +# generated from colcon_core/shell/template/hook_prepend_value.sh.em + +_colcon_prepend_unique_value PYTHONPATH "$COLCON_CURRENT_PREFIX/lib/python3.10/site-packages" diff --git a/install/my_pkg/share/my_pkg/package.bash b/install/my_pkg/share/my_pkg/package.bash new file mode 100644 index 0000000..29af6a0 --- /dev/null +++ b/install/my_pkg/share/my_pkg/package.bash @@ -0,0 +1,31 @@ +# generated from colcon_bash/shell/template/package.bash.em + +# This script extends the environment for this package. + +# a bash script is able to determine its own path if necessary +if [ -z "$COLCON_CURRENT_PREFIX" ]; then + # the prefix is two levels up from the package specific share directory + _colcon_package_bash_COLCON_CURRENT_PREFIX="$(builtin cd "`dirname "${BASH_SOURCE[0]}"`/../.." > /dev/null && pwd)" +else + _colcon_package_bash_COLCON_CURRENT_PREFIX="$COLCON_CURRENT_PREFIX" +fi + +# function to source another script with conditional trace output +# first argument: the path of the script +# additional arguments: arguments to the script +_colcon_package_bash_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo ". \"$1\"" + fi + . "$@" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# source sh script of this package +_colcon_package_bash_source_script "$_colcon_package_bash_COLCON_CURRENT_PREFIX/share/my_pkg/package.sh" + +unset _colcon_package_bash_source_script +unset _colcon_package_bash_COLCON_CURRENT_PREFIX diff --git a/install/my_pkg/share/my_pkg/package.dsv b/install/my_pkg/share/my_pkg/package.dsv new file mode 100644 index 0000000..8c96c9d --- /dev/null +++ b/install/my_pkg/share/my_pkg/package.dsv @@ -0,0 +1,9 @@ +source;share/my_pkg/hook/pythonpath.ps1 +source;share/my_pkg/hook/pythonpath.dsv +source;share/my_pkg/hook/pythonpath.sh +source;share/my_pkg/hook/ament_prefix_path.ps1 +source;share/my_pkg/hook/ament_prefix_path.dsv +source;share/my_pkg/hook/ament_prefix_path.sh +source;../../build/my_pkg/share/my_pkg/hook/pythonpath_develop.ps1 +source;../../build/my_pkg/share/my_pkg/hook/pythonpath_develop.dsv +source;../../build/my_pkg/share/my_pkg/hook/pythonpath_develop.sh diff --git a/install/my_pkg/share/my_pkg/package.ps1 b/install/my_pkg/share/my_pkg/package.ps1 new file mode 100644 index 0000000..b23a5b9 --- /dev/null +++ b/install/my_pkg/share/my_pkg/package.ps1 @@ -0,0 +1,117 @@ +# generated from colcon_powershell/shell/template/package.ps1.em + +# function to append a value to a variable +# which uses colons as separators +# duplicates as well as leading separators are avoided +# first argument: the name of the result variable +# second argument: the value to be prepended +function colcon_append_unique_value { + param ( + $_listname, + $_value + ) + + # get values from variable + if (Test-Path Env:$_listname) { + $_values=(Get-Item env:$_listname).Value + } else { + $_values="" + } + $_duplicate="" + # start with no values + $_all_values="" + # iterate over existing values in the variable + if ($_values) { + $_values.Split(";") | ForEach { + # not an empty string + if ($_) { + # not a duplicate of _value + if ($_ -eq $_value) { + $_duplicate="1" + } + if ($_all_values) { + $_all_values="${_all_values};$_" + } else { + $_all_values="$_" + } + } + } + } + # append only non-duplicates + if (!$_duplicate) { + # avoid leading separator + if ($_all_values) { + $_all_values="${_all_values};${_value}" + } else { + $_all_values="${_value}" + } + } + + # export the updated variable + Set-Item env:\$_listname -Value "$_all_values" +} + +# function to prepend a value to a variable +# which uses colons as separators +# duplicates as well as trailing separators are avoided +# first argument: the name of the result variable +# second argument: the value to be prepended +function colcon_prepend_unique_value { + param ( + $_listname, + $_value + ) + + # get values from variable + if (Test-Path Env:$_listname) { + $_values=(Get-Item env:$_listname).Value + } else { + $_values="" + } + # start with the new value + $_all_values="$_value" + # iterate over existing values in the variable + if ($_values) { + $_values.Split(";") | ForEach { + # not an empty string + if ($_) { + # not a duplicate of _value + if ($_ -ne $_value) { + # keep non-duplicate values + $_all_values="${_all_values};$_" + } + } + } + } + # export the updated variable + Set-Item env:\$_listname -Value "$_all_values" +} + +# function to source another script with conditional trace output +# first argument: the path of the script +# additional arguments: arguments to the script +function colcon_package_source_powershell_script { + param ( + $_colcon_package_source_powershell_script + ) + # source script with conditional trace output + if (Test-Path $_colcon_package_source_powershell_script) { + if ($env:COLCON_TRACE) { + echo ". '$_colcon_package_source_powershell_script'" + } + . "$_colcon_package_source_powershell_script" + } else { + Write-Error "not found: '$_colcon_package_source_powershell_script'" + } +} + + +# a powershell script is able to determine its own path +# the prefix is two levels up from the package specific share directory +$env:COLCON_CURRENT_PREFIX=(Get-Item $PSCommandPath).Directory.Parent.Parent.FullName + +colcon_package_source_powershell_script "$env:COLCON_CURRENT_PREFIX\share/my_pkg/hook/pythonpath.ps1" +colcon_package_source_powershell_script "$env:COLCON_CURRENT_PREFIX\share/my_pkg/hook/ament_prefix_path.ps1" +colcon_package_source_powershell_script "$env:COLCON_CURRENT_PREFIX\../../build/my_pkg/share/my_pkg/hook/pythonpath_develop.ps1" + +Remove-Item Env:\COLCON_CURRENT_PREFIX diff --git a/install/my_pkg/share/my_pkg/package.sh b/install/my_pkg/share/my_pkg/package.sh new file mode 100644 index 0000000..f9a0feb --- /dev/null +++ b/install/my_pkg/share/my_pkg/package.sh @@ -0,0 +1,88 @@ +# generated from colcon_core/shell/template/package.sh.em + +# This script extends the environment for this package. + +# function to prepend a value to a variable +# which uses colons as separators +# duplicates as well as trailing separators are avoided +# first argument: the name of the result variable +# second argument: the value to be prepended +_colcon_prepend_unique_value() { + # arguments + _listname="$1" + _value="$2" + + # get values from variable + eval _values=\"\$$_listname\" + # backup the field separator + _colcon_prepend_unique_value_IFS=$IFS + IFS=":" + # start with the new value + _all_values="$_value" + # workaround SH_WORD_SPLIT not being set in zsh + if [ "$(command -v colcon_zsh_convert_to_array)" ]; then + colcon_zsh_convert_to_array _values + fi + # iterate over existing values in the variable + for _item in $_values; do + # ignore empty strings + if [ -z "$_item" ]; then + continue + fi + # ignore duplicates of _value + if [ "$_item" = "$_value" ]; then + continue + fi + # keep non-duplicate values + _all_values="$_all_values:$_item" + done + unset _item + # restore the field separator + IFS=$_colcon_prepend_unique_value_IFS + unset _colcon_prepend_unique_value_IFS + # export the updated variable + eval export $_listname=\"$_all_values\" + unset _all_values + unset _values + + unset _value + unset _listname +} + +# since a plain shell script can't determine its own path when being sourced +# either use the provided COLCON_CURRENT_PREFIX +# or fall back to the build time prefix (if it exists) +_colcon_package_sh_COLCON_CURRENT_PREFIX="/home/ps16214/tb3-ros2-template/install/my_pkg" +if [ -z "$COLCON_CURRENT_PREFIX" ]; then + if [ ! -d "$_colcon_package_sh_COLCON_CURRENT_PREFIX" ]; then + echo "The build time path \"$_colcon_package_sh_COLCON_CURRENT_PREFIX\" doesn't exist. Either source a script for a different shell or set the environment variable \"COLCON_CURRENT_PREFIX\" explicitly." 1>&2 + unset _colcon_package_sh_COLCON_CURRENT_PREFIX + return 1 + fi + COLCON_CURRENT_PREFIX="$_colcon_package_sh_COLCON_CURRENT_PREFIX" +fi +unset _colcon_package_sh_COLCON_CURRENT_PREFIX + +# function to source another script with conditional trace output +# first argument: the path of the script +# additional arguments: arguments to the script +_colcon_package_sh_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo "# . \"$1\"" + fi + . "$@" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# source sh hooks +_colcon_package_sh_source_script "$COLCON_CURRENT_PREFIX/share/my_pkg/hook/pythonpath.sh" +_colcon_package_sh_source_script "$COLCON_CURRENT_PREFIX/share/my_pkg/hook/ament_prefix_path.sh" +_colcon_package_sh_source_script "$COLCON_CURRENT_PREFIX/../../build/my_pkg/share/my_pkg/hook/pythonpath_develop.sh" + +unset _colcon_package_sh_source_script +unset COLCON_CURRENT_PREFIX + +# do not unset _colcon_prepend_unique_value since it might be used by non-primary shell hooks diff --git a/install/my_pkg/share/my_pkg/package.xml b/install/my_pkg/share/my_pkg/package.xml new file mode 100644 index 0000000..3799194 --- /dev/null +++ b/install/my_pkg/share/my_pkg/package.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> +<package format="3"> + <name>my_pkg</name> + <version>0.0.0</version> + <description>TODO: Package description</description> + <maintainer email="ps16214@todo.todo">ps16214</maintainer> + <license>TODO: License declaration</license> + + <test_depend>ament_copyright</test_depend> + <test_depend>ament_flake8</test_depend> + <test_depend>ament_pep257</test_depend> + <test_depend>python3-pytest</test_depend> + + <export> + <build_type>ament_python</build_type> + </export> +</package> diff --git a/install/my_pkg/share/my_pkg/package.zsh b/install/my_pkg/share/my_pkg/package.zsh new file mode 100644 index 0000000..09eaa5d --- /dev/null +++ b/install/my_pkg/share/my_pkg/package.zsh @@ -0,0 +1,42 @@ +# generated from colcon_zsh/shell/template/package.zsh.em + +# This script extends the environment for this package. + +# a zsh script is able to determine its own path if necessary +if [ -z "$COLCON_CURRENT_PREFIX" ]; then + # the prefix is two levels up from the package specific share directory + _colcon_package_zsh_COLCON_CURRENT_PREFIX="$(builtin cd -q "`dirname "${(%):-%N}"`/../.." > /dev/null && pwd)" +else + _colcon_package_zsh_COLCON_CURRENT_PREFIX="$COLCON_CURRENT_PREFIX" +fi + +# function to source another script with conditional trace output +# first argument: the path of the script +# additional arguments: arguments to the script +_colcon_package_zsh_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo ". \"$1\"" + fi + . "$@" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# function to convert array-like strings into arrays +# to workaround SH_WORD_SPLIT not being set +colcon_zsh_convert_to_array() { + local _listname=$1 + local _dollar="$" + local _split="{=" + local _to_array="(\"$_dollar$_split$_listname}\")" + eval $_listname=$_to_array +} + +# source sh script of this package +_colcon_package_zsh_source_script "$_colcon_package_zsh_COLCON_CURRENT_PREFIX/share/my_pkg/package.sh" +unset convert_zsh_to_array + +unset _colcon_package_zsh_source_script +unset _colcon_package_zsh_COLCON_CURRENT_PREFIX diff --git a/install/setup.bash b/install/setup.bash new file mode 100644 index 0000000..024a819 --- /dev/null +++ b/install/setup.bash @@ -0,0 +1,37 @@ +# generated from colcon_bash/shell/template/prefix_chain.bash.em + +# This script extends the environment with the environment of other prefix +# paths which were sourced when this file was generated as well as all packages +# contained in this prefix path. + +# function to source another script with conditional trace output +# first argument: the path of the script +_colcon_prefix_chain_bash_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo ". \"$1\"" + fi + . "$1" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# source chained prefixes +# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script +COLCON_CURRENT_PREFIX="/opt/ros/galactic" +_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash" +# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script +COLCON_CURRENT_PREFIX="/opt/ros/galactic-turtlebot3-quickstart" +_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash" +# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script +COLCON_CURRENT_PREFIX="/home/ps16214/py_pubsub/install" +_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash" + +# source this prefix +# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script +COLCON_CURRENT_PREFIX="$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)" +_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash" + +unset COLCON_CURRENT_PREFIX +unset _colcon_prefix_chain_bash_source_script diff --git a/install/setup.ps1 b/install/setup.ps1 new file mode 100644 index 0000000..bc93b44 --- /dev/null +++ b/install/setup.ps1 @@ -0,0 +1,31 @@ +# generated from colcon_powershell/shell/template/prefix_chain.ps1.em + +# This script extends the environment with the environment of other prefix +# paths which were sourced when this file was generated as well as all packages +# contained in this prefix path. + +# function to source another script with conditional trace output +# first argument: the path of the script +function _colcon_prefix_chain_powershell_source_script { + param ( + $_colcon_prefix_chain_powershell_source_script_param + ) + # source script with conditional trace output + if (Test-Path $_colcon_prefix_chain_powershell_source_script_param) { + if ($env:COLCON_TRACE) { + echo ". '$_colcon_prefix_chain_powershell_source_script_param'" + } + . "$_colcon_prefix_chain_powershell_source_script_param" + } else { + Write-Error "not found: '$_colcon_prefix_chain_powershell_source_script_param'" + } +} + +# source chained prefixes +_colcon_prefix_chain_powershell_source_script "/opt/ros/galactic\local_setup.ps1" +_colcon_prefix_chain_powershell_source_script "/opt/ros/galactic-turtlebot3-quickstart\local_setup.ps1" +_colcon_prefix_chain_powershell_source_script "/home/ps16214/py_pubsub/install\local_setup.ps1" + +# source this prefix +$env:COLCON_CURRENT_PREFIX=(Split-Path $PSCommandPath -Parent) +_colcon_prefix_chain_powershell_source_script "$env:COLCON_CURRENT_PREFIX\local_setup.ps1" diff --git a/install/setup.sh b/install/setup.sh new file mode 100644 index 0000000..7c87dd7 --- /dev/null +++ b/install/setup.sh @@ -0,0 +1,53 @@ +# generated from colcon_core/shell/template/prefix_chain.sh.em + +# This script extends the environment with the environment of other prefix +# paths which were sourced when this file was generated as well as all packages +# contained in this prefix path. + +# since a plain shell script can't determine its own path when being sourced +# either use the provided COLCON_CURRENT_PREFIX +# or fall back to the build time prefix (if it exists) +_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX=/home/ps16214/tb3-ros2-template/install +if [ ! -z "$COLCON_CURRENT_PREFIX" ]; then + _colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX="$COLCON_CURRENT_PREFIX" +elif [ ! -d "$_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX" ]; then + echo "The build time path \"$_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX\" doesn't exist. Either source a script for a different shell or set the environment variable \"COLCON_CURRENT_PREFIX\" explicitly." 1>&2 + unset _colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX + return 1 +fi + +# function to source another script with conditional trace output +# first argument: the path of the script +_colcon_prefix_chain_sh_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo "# . \"$1\"" + fi + . "$1" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# source chained prefixes +# setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script +COLCON_CURRENT_PREFIX="/opt/ros/galactic" +_colcon_prefix_chain_sh_source_script "$COLCON_CURRENT_PREFIX/local_setup.sh" + +# setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script +COLCON_CURRENT_PREFIX="/opt/ros/galactic-turtlebot3-quickstart" +_colcon_prefix_chain_sh_source_script "$COLCON_CURRENT_PREFIX/local_setup.sh" + +# setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script +COLCON_CURRENT_PREFIX="/home/ps16214/py_pubsub/install" +_colcon_prefix_chain_sh_source_script "$COLCON_CURRENT_PREFIX/local_setup.sh" + + +# source this prefix +# setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script +COLCON_CURRENT_PREFIX="$_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX" +_colcon_prefix_chain_sh_source_script "$COLCON_CURRENT_PREFIX/local_setup.sh" + +unset _colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX +unset _colcon_prefix_chain_sh_source_script +unset COLCON_CURRENT_PREFIX diff --git a/install/setup.zsh b/install/setup.zsh new file mode 100644 index 0000000..b4216f3 --- /dev/null +++ b/install/setup.zsh @@ -0,0 +1,37 @@ +# generated from colcon_zsh/shell/template/prefix_chain.zsh.em + +# This script extends the environment with the environment of other prefix +# paths which were sourced when this file was generated as well as all packages +# contained in this prefix path. + +# function to source another script with conditional trace output +# first argument: the path of the script +_colcon_prefix_chain_zsh_source_script() { + if [ -f "$1" ]; then + if [ -n "$COLCON_TRACE" ]; then + echo ". \"$1\"" + fi + . "$1" + else + echo "not found: \"$1\"" 1>&2 + fi +} + +# source chained prefixes +# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script +COLCON_CURRENT_PREFIX="/opt/ros/galactic" +_colcon_prefix_chain_zsh_source_script "$COLCON_CURRENT_PREFIX/local_setup.zsh" +# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script +COLCON_CURRENT_PREFIX="/opt/ros/galactic-turtlebot3-quickstart" +_colcon_prefix_chain_zsh_source_script "$COLCON_CURRENT_PREFIX/local_setup.zsh" +# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script +COLCON_CURRENT_PREFIX="/home/ps16214/py_pubsub/install" +_colcon_prefix_chain_zsh_source_script "$COLCON_CURRENT_PREFIX/local_setup.zsh" + +# source this prefix +# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script +COLCON_CURRENT_PREFIX="$(builtin cd -q "`dirname "${(%):-%N}"`" > /dev/null && pwd)" +_colcon_prefix_chain_zsh_source_script "$COLCON_CURRENT_PREFIX/local_setup.zsh" + +unset COLCON_CURRENT_PREFIX +unset _colcon_prefix_chain_zsh_source_script diff --git a/load_workspace.sh b/load_workspace.sh new file mode 100644 index 0000000..e894e1d --- /dev/null +++ b/load_workspace.sh @@ -0,0 +1,5 @@ +if [ -n "$ZSH_VERSION" ]; then + . ./install/local_setup.zsh +elif [ -n "$BASH_VERSION" ]; then + . ./install/local_setup.bash +fi diff --git a/log/COLCON_IGNORE b/log/COLCON_IGNORE new file mode 100644 index 0000000..e69de29 diff --git a/log/build_2022-03-01_11-42-39/events.log b/log/build_2022-03-01_11-42-39/events.log new file mode 100644 index 0000000..c748b91 --- /dev/null +++ b/log/build_2022-03-01_11-42-39/events.log @@ -0,0 +1,92 @@ +[0.000000] (-) TimerEvent: {} +[0.000478] (my_pkg) JobQueued: {'identifier': 'my_pkg', 'dependencies': OrderedDict()} +[0.000593] (my_pkg) JobStarted: {'identifier': 'my_pkg'} +[0.097407] (-) TimerEvent: {} +[0.197978] (-) TimerEvent: {} +[0.298573] (-) TimerEvent: {} +[0.399787] (-) TimerEvent: {} +[0.500459] (-) TimerEvent: {} +[0.601069] (-) TimerEvent: {} +[0.702718] (-) TimerEvent: {} +[0.803798] (-) TimerEvent: {} +[0.904381] (-) TimerEvent: {} +[1.005026] (-) TimerEvent: {} +[1.105590] (-) TimerEvent: {} +[1.206562] (-) TimerEvent: {} +[1.312195] (-) TimerEvent: {} +[1.413006] (-) TimerEvent: {} +[1.513639] (-) TimerEvent: {} +[1.614285] (-) TimerEvent: {} +[1.714888] (-) TimerEvent: {} +[1.815450] (-) TimerEvent: {} +[1.916015] (-) TimerEvent: {} +[2.016564] (-) TimerEvent: {} +[2.117099] (-) TimerEvent: {} +[2.217651] (-) TimerEvent: {} +[2.318069] (-) TimerEvent: {} +[2.418545] (-) TimerEvent: {} +[2.519047] (-) TimerEvent: {} +[2.619548] (-) TimerEvent: {} +[2.720025] (-) TimerEvent: {} +[2.820499] (-) TimerEvent: {} +[2.920962] (-) TimerEvent: {} +[3.021517] (-) TimerEvent: {} +[3.122439] (-) TimerEvent: {} +[3.166961] (my_pkg) Command: {'cmd': ['/usr/bin/python', 'setup.py', 'develop', '--prefix', '/home/ps16214/tb3-ros2-template/install/my_pkg', '--editable', '--build-directory', '/home/ps16214/tb3-ros2-template/build/my_pkg/build', '--no-deps', 'install_data', '--install-dir', '/home/ps16214/tb3-ros2-template/install/my_pkg'], 'cwd': '/home/ps16214/tb3-ros2-template/build/my_pkg', 'env': {'SHELL': '/bin/bash', 'ROS_VERSION': '2', 'GAZEBO_MASTER_URI': 'http://localhost:11345', 'CONDA_EXE': '/usr/bin/conda', 'PKG_CONFIG_PATH': '/opt/ros/galactic-turtlebot3-quickstart/lib/pkgconfig:/opt/ros/galactic/lib/pkgconfig', 'ROS_PYTHON_VERSION': '3', 'MAKE_TERMOUT': '/dev/pts/21', 'PWD': '/home/ps16214/tb3-ros2-template/build/my_pkg', 'LOGNAME': 'ps16214', 'XDG_SESSION_TYPE': 'tty', 'ROS_DOMAIN_ID': '55', 'MOTD_SHOWN': 'pam', 'HOME': '/home/ps16214', 'GAZEBO_PLUGIN_PATH': '/usr/lib/gazebo-11/plugins:/opt/ros/galactic/../galactic-turtlebot3-quickstart/lib:', 'LANG': 'en_US.UTF-8', 'GAZEBO_MODEL_DATABASE_URI': 'http://models.gazebosim.org', 'AMENT_PREFIX_PATH': '/home/ps16214/py_pubsub/install/py_pubsub:/opt/ros/galactic-turtlebot3-quickstart:/opt/ros/galactic', 'CMAKE_PREFIX_PATH': '/opt/ros/galactic-turtlebot3-quickstart:/opt/ros/galactic', 'GAZEBO_RESOURCE_PATH': '/usr/share/gazebo-11:/opt/ros/galactic/../galactic-turtlebot3-quickstart/share/turtlebot3_gazebo/worlds:', 'COLCON_PREFIX_PATH': '/home/ps16214/py_pubsub/install:/opt/ros/galactic-turtlebot3-quickstart:/opt/ros/galactic', 'SSH_CONNECTION': '10.1.65.86 34906 195.37.232.77 22', 'MFLAGS': '', 'XDG_SESSION_CLASS': 'user', 'MAKEFLAGS': '', 'PYTHONPATH': '/home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages:/home/ps16214/py_pubsub/install/py_pubsub/lib/python3.10/site-packages:/opt/ros/galactic-turtlebot3-quickstart/lib/python3.10/site-packages:/opt/ros/galactic/lib/python3.10/site-packages', 'COLCON': '1', 'TERM': 'xterm-256color', 'USER': 'ps16214', 'MAKE_TERMERR': '/dev/pts/21', 'CUDA_PATH': '/opt/cuda', 'CONDA_SHLVL': '0', 'DISPLAY': 'localhost:25.0', 'SHLVL': '1', 'MAKELEVEL': '1', 'TURTLEBOT3_MODEL': 'waffle_pi', 'XDG_SESSION_ID': '182', 'LD_LIBRARY_PATH': '/usr/lib/gazebo-11/plugins:/opt/ros/galactic-turtlebot3-quickstart/lib:/opt/ros/galactic/opt/yaml_cpp_vendor/lib:/opt/ros/galactic/opt/rviz_ogre_vendor/lib:/opt/ros/galactic/lib:/usr/lib/gazebo-11/plugins:', 'XDG_RUNTIME_DIR': '/run/user/36945', 'ROS_LOCALHOST_ONLY': '0', 'SSH_CLIENT': '10.1.65.86 34906 22', 'MKLROOT': '/opt/intel/mkl', 'GAZEBO_MODEL_PATH': '/usr/share/gazebo-11/models:/opt/ros/galactic/../galactic-turtlebot3-quickstart/share/turtlebot3_gazebo/models:', 'PATH': '/opt/ros/galactic-turtlebot3-quickstart/bin:/opt/ros/galactic/bin:/usr/condabin:/usr/local/sbin:/usr/local/bin:/usr/bin:/opt/cuda/bin:/opt/cuda/nsight_compute:/opt/cuda/nsight_systems/bin:/usr/lib/jvm/default/bin:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/home/share/', 'CYCLONEDDS_URI': '/share/cyclonedds-profile.xml', 'DBUS_SESSION_BUS_ADDRESS': 'unix:path=/run/user/36945/bus', 'HG': '/usr/bin/hg', 'MAIL': '/var/spool/mail/ps16214', 'SSH_TTY': '/dev/pts/21', 'ROS_DISTRO': 'galactic', 'OGRE_RESOURCE_PATH': '/usr/lib/OGRE', 'OLDPWD': '/home/ps16214', '_': '/usr/bin/env'}, 'shell': False} +[3.222598] (-) TimerEvent: {} +[3.323104] (-) TimerEvent: {} +[3.423591] (-) TimerEvent: {} +[3.524349] (-) TimerEvent: {} +[3.624933] (-) TimerEvent: {} +[3.725510] (-) TimerEvent: {} +[3.825990] (-) TimerEvent: {} +[3.926871] (-) TimerEvent: {} +[4.027436] (-) TimerEvent: {} +[4.127987] (-) TimerEvent: {} +[4.228528] (-) TimerEvent: {} +[4.329109] (-) TimerEvent: {} +[4.429682] (-) TimerEvent: {} +[4.437928] (my_pkg) StdoutLine: {'line': b'running develop\n'} +[4.438804] (my_pkg) StderrLine: {'line': b'/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools.\n'} +[4.439132] (my_pkg) StderrLine: {'line': b' warnings.warn(\n'} +[4.442848] (my_pkg) StderrLine: {'line': b'/usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.\n'} +[4.443202] (my_pkg) StderrLine: {'line': b' warnings.warn(\n'} +[4.529802] (-) TimerEvent: {} +[4.630748] (-) TimerEvent: {} +[4.731213] (-) TimerEvent: {} +[4.831734] (-) TimerEvent: {} +[4.932246] (-) TimerEvent: {} +[5.032752] (-) TimerEvent: {} +[5.133256] (-) TimerEvent: {} +[5.236615] (-) TimerEvent: {} +[5.338340] (-) TimerEvent: {} +[5.438885] (-) TimerEvent: {} +[5.539395] (-) TimerEvent: {} +[5.639906] (-) TimerEvent: {} +[5.740402] (-) TimerEvent: {} +[5.753246] (my_pkg) StdoutLine: {'line': b'running egg_info\n'} +[5.753910] (my_pkg) StdoutLine: {'line': b'creating my_pkg.egg-info\n'} +[5.754588] (my_pkg) StdoutLine: {'line': b'writing my_pkg.egg-info/PKG-INFO\n'} +[5.755777] (my_pkg) StdoutLine: {'line': b'writing dependency_links to my_pkg.egg-info/dependency_links.txt\n'} +[5.756351] (my_pkg) StdoutLine: {'line': b'writing entry points to my_pkg.egg-info/entry_points.txt\n'} +[5.756795] (my_pkg) StdoutLine: {'line': b'writing requirements to my_pkg.egg-info/requires.txt\n'} +[5.757231] (my_pkg) StdoutLine: {'line': b'writing top-level names to my_pkg.egg-info/top_level.txt\n'} +[5.763707] (my_pkg) StdoutLine: {'line': b"writing manifest file 'my_pkg.egg-info/SOURCES.txt'\n"} +[5.771019] (my_pkg) StdoutLine: {'line': b"reading manifest file 'my_pkg.egg-info/SOURCES.txt'\n"} +[5.771721] (my_pkg) StdoutLine: {'line': b"writing manifest file 'my_pkg.egg-info/SOURCES.txt'\n"} +[5.776634] (my_pkg) StdoutLine: {'line': b'running build_ext\n'} +[5.777249] (my_pkg) StdoutLine: {'line': b'Creating /home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages/my-pkg.egg-link (link to .)\n'} +[5.779611] (my_pkg) StdoutLine: {'line': b'Installing tb3 script to /home/ps16214/tb3-ros2-template/install/my_pkg/lib/my_pkg\n'} +[5.780294] (my_pkg) StdoutLine: {'line': b'\n'} +[5.780586] (my_pkg) StdoutLine: {'line': b'Installed /home/ps16214/tb3-ros2-template/build/my_pkg\n'} +[5.781080] (my_pkg) StdoutLine: {'line': b'running install_data\n'} +[5.781392] (my_pkg) StdoutLine: {'line': b'creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index\n'} +[5.781682] (my_pkg) StdoutLine: {'line': b'creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index\n'} +[5.781969] (my_pkg) StdoutLine: {'line': b'creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index/packages\n'} +[5.782448] (my_pkg) StdoutLine: {'line': b'copying resource/my_pkg -> /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index/packages\n'} +[5.782917] (my_pkg) StdoutLine: {'line': b'copying package.xml -> /home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg\n'} +[5.840559] (-) TimerEvent: {} +[5.890283] (my_pkg) CommandEnded: {'returncode': 0} +[5.945783] (-) TimerEvent: {} +[5.993361] (my_pkg) JobEnded: {'identifier': 'my_pkg', 'rc': 0} +[5.995193] (-) EventReactorShutdown: {} diff --git a/log/build_2022-03-01_11-42-39/logger_all.log b/log/build_2022-03-01_11-42-39/logger_all.log new file mode 100644 index 0000000..b02d920 --- /dev/null +++ b/log/build_2022-03-01_11-42-39/logger_all.log @@ -0,0 +1,140 @@ +[2.127s] DEBUG:colcon:Command line arguments: ['/usr/bin/colcon', 'build', '--symlink-install'] +[2.127s] DEBUG:colcon:Parsed command line arguments: Namespace(log_base=None, log_level=None, verb_name='build', build_base='build', install_base='install', merge_install=False, symlink_install=True, test_result_base=None, continue_on_error=False, allow_overriding=[], executor='parallel', parallel_workers=24, event_handlers=None, ignore_user_meta=False, metas=['./colcon.meta'], base_paths=['.'], packages_ignore=None, packages_ignore_regex=None, paths=None, packages_up_to=None, packages_up_to_regex=None, packages_above=None, packages_above_and_dependencies=None, packages_above_depth=None, packages_select_by_dep=None, packages_skip_by_dep=None, packages_skip_up_to=None, packages_select_build_failed=False, packages_skip_build_finished=False, packages_select_test_failures=False, packages_skip_test_passed=False, packages_select=None, packages_skip=None, packages_select_regex=None, packages_skip_regex=None, packages_start=None, packages_end=None, cmake_args=None, cmake_target=None, cmake_target_skip_unavailable=False, cmake_clean_cache=False, cmake_clean_first=False, cmake_force_configure=False, ament_cmake_args=None, catkin_cmake_args=None, catkin_skip_building_tests=False, verb_parser=<colcon_defaults.argument_parser.defaults.DefaultArgumentsDecorator object at 0x7fafcd1c7b50>, verb_extension=<colcon_core.verb.build.BuildVerb object at 0x7fafcd2cf0a0>, main=<bound method BuildVerb.main of <colcon_core.verb.build.BuildVerb object at 0x7fafcd2cf0a0>>) +[2.185s] Level 1:colcon.colcon_core.package_discovery:discover_packages(colcon_meta) check parameters +[2.186s] Level 1:colcon.colcon_core.package_discovery:discover_packages(recursive) check parameters +[2.186s] Level 1:colcon.colcon_core.package_discovery:discover_packages(ignore) check parameters +[2.186s] Level 1:colcon.colcon_core.package_discovery:discover_packages(path) check parameters +[2.186s] Level 1:colcon.colcon_core.package_discovery:discover_packages(colcon_meta) discover +[2.186s] Level 1:colcon.colcon_core.package_discovery:discover_packages(recursive) discover +[2.186s] INFO:colcon.colcon_core.package_discovery:Crawling recursively for packages in '/home/ps16214/tb3-ros2-template' +[2.187s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extensions ['ignore', 'ignore_ament_install'] +[2.187s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extension 'ignore' +[2.187s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extension 'ignore_ament_install' +[2.188s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extensions ['colcon_pkg'] +[2.188s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extension 'colcon_pkg' +[2.188s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extensions ['colcon_meta'] +[2.188s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extension 'colcon_meta' +[2.188s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extensions ['ros'] +[2.188s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extension 'ros' +[2.196s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extensions ['cmake', 'python'] +[2.196s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extension 'cmake' +[2.196s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extension 'python' +[2.196s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extensions ['python_setup_py'] +[2.196s] Level 1:colcon.colcon_core.package_identification:_identify(.) by extension 'python_setup_py' +[2.197s] Level 1:colcon.colcon_core.package_identification:_identify(build) by extensions ['ignore', 'ignore_ament_install'] +[2.197s] Level 1:colcon.colcon_core.package_identification:_identify(build) by extension 'ignore' +[2.197s] Level 1:colcon.colcon_core.package_identification:_identify(build) ignored +[2.197s] Level 1:colcon.colcon_core.package_identification:_identify(install) by extensions ['ignore', 'ignore_ament_install'] +[2.198s] Level 1:colcon.colcon_core.package_identification:_identify(install) by extension 'ignore' +[2.198s] Level 1:colcon.colcon_core.package_identification:_identify(install) ignored +[2.198s] Level 1:colcon.colcon_core.package_identification:_identify(log) by extensions ['ignore', 'ignore_ament_install'] +[2.198s] Level 1:colcon.colcon_core.package_identification:_identify(log) by extension 'ignore' +[2.198s] Level 1:colcon.colcon_core.package_identification:_identify(log) ignored +[2.199s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extensions ['ignore', 'ignore_ament_install'] +[2.199s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extension 'ignore' +[2.199s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extension 'ignore_ament_install' +[2.199s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extensions ['colcon_pkg'] +[2.199s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extension 'colcon_pkg' +[2.199s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extensions ['colcon_meta'] +[2.200s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extension 'colcon_meta' +[2.200s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extensions ['ros'] +[2.200s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extension 'ros' +[2.200s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extensions ['cmake', 'python'] +[2.200s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extension 'cmake' +[2.200s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extension 'python' +[2.200s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extensions ['python_setup_py'] +[2.201s] Level 1:colcon.colcon_core.package_identification:_identify(src) by extension 'python_setup_py' +[2.201s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extensions ['ignore', 'ignore_ament_install'] +[2.201s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extension 'ignore' +[2.201s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extension 'ignore_ament_install' +[2.202s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extensions ['colcon_pkg'] +[2.202s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extension 'colcon_pkg' +[2.202s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extensions ['colcon_meta'] +[2.202s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extension 'colcon_meta' +[2.202s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extensions ['ros'] +[2.202s] Level 1:colcon.colcon_core.package_identification:_identify(src/my_pkg) by extension 'ros' +[2.208s] DEBUG:colcon.colcon_core.package_identification:Package 'src/my_pkg' with type 'ros.ament_python' and name 'my_pkg' +[2.209s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extensions ['ignore', 'ignore_ament_install'] +[2.209s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extension 'ignore' +[2.209s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extension 'ignore_ament_install' +[2.209s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extensions ['colcon_pkg'] +[2.209s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extension 'colcon_pkg' +[2.210s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extensions ['colcon_meta'] +[2.210s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extension 'colcon_meta' +[2.210s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extensions ['ros'] +[2.210s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extension 'ros' +[2.210s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extensions ['cmake', 'python'] +[2.210s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extension 'cmake' +[2.210s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extension 'python' +[2.211s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extensions ['python_setup_py'] +[2.211s] Level 1:colcon.colcon_core.package_identification:_identify(tools) by extension 'python_setup_py' +[2.211s] Level 1:colcon.colcon_core.package_discovery:discover_packages(recursive) using defaults +[2.211s] Level 1:colcon.colcon_core.package_discovery:discover_packages(ignore) discover +[2.211s] Level 1:colcon.colcon_core.package_discovery:discover_packages(ignore) using defaults +[2.211s] Level 1:colcon.colcon_core.package_discovery:discover_packages(path) discover +[2.211s] Level 1:colcon.colcon_core.package_discovery:discover_packages(path) using defaults +[2.364s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'cmake_args' from command line to 'None' +[2.365s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'cmake_target' from command line to 'None' +[2.365s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'cmake_target_skip_unavailable' from command line to 'False' +[2.365s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'cmake_clean_cache' from command line to 'False' +[2.365s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'cmake_clean_first' from command line to 'False' +[2.365s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'cmake_force_configure' from command line to 'False' +[2.365s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'ament_cmake_args' from command line to 'None' +[2.365s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'catkin_cmake_args' from command line to 'None' +[2.365s] Level 5:colcon.colcon_core.verb:set package 'my_pkg' build argument 'catkin_skip_building_tests' from command line to 'False' +[2.365s] DEBUG:colcon.colcon_core.verb:Building package 'my_pkg' with the following arguments: {'ament_cmake_args': None, 'build_base': '/home/ps16214/tb3-ros2-template/build/my_pkg', 'catkin_cmake_args': None, 'catkin_skip_building_tests': False, 'cmake_args': None, 'cmake_clean_cache': False, 'cmake_clean_first': False, 'cmake_force_configure': False, 'cmake_target': None, 'cmake_target_skip_unavailable': False, 'install_base': '/home/ps16214/tb3-ros2-template/install/my_pkg', 'merge_install': False, 'path': '/home/ps16214/tb3-ros2-template/src/my_pkg', 'symlink_install': True, 'test_result_base': None} +[2.439s] INFO:colcon.colcon_core.executor:Executing jobs using 'parallel' executor +[2.490s] DEBUG:colcon.colcon_parallel_executor.executor.parallel:run_until_complete +[2.490s] INFO:colcon.colcon_ros.task.ament_python.build:Building ROS package in '/home/ps16214/tb3-ros2-template/src/my_pkg' with build type 'ament_python' +[2.491s] Level 1:colcon.colcon_core.shell:create_environment_hook('my_pkg', 'ament_prefix_path') +[2.524s] INFO:colcon.colcon_core.plugin_system:Skipping extension 'colcon_core.shell.bat': Not used on non-Windows systems +[2.525s] INFO:colcon.colcon_core.shell:Creating environment hook '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/hook/ament_prefix_path.ps1' +[2.527s] INFO:colcon.colcon_core.shell:Creating environment descriptor '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/hook/ament_prefix_path.dsv' +[2.528s] INFO:colcon.colcon_core.shell:Creating environment hook '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/hook/ament_prefix_path.sh' +[2.551s] INFO:colcon.colcon_core.shell:Skip shell extension 'powershell' for command environment: Not usable outside of PowerShell +[2.551s] DEBUG:colcon.colcon_core.shell:Skip shell extension 'dsv' for command environment +[3.802s] INFO:colcon.colcon_core.task.python.build:Building Python package in '/home/ps16214/tb3-ros2-template/src/my_pkg' +[3.826s] INFO:colcon.colcon_core.shell:Skip shell extension 'powershell' for command environment: Not usable outside of PowerShell +[3.827s] DEBUG:colcon.colcon_core.shell:Skip shell extension 'dsv' for command environment +[5.668s] DEBUG:colcon.colcon_core.event_handler.log_command:Invoking command in '/home/ps16214/tb3-ros2-template/build/my_pkg': PYTHONPATH=/home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages:${PYTHONPATH} _=/usr/bin/env /usr/bin/python setup.py develop --prefix /home/ps16214/tb3-ros2-template/install/my_pkg --editable --build-directory /home/ps16214/tb3-ros2-template/build/my_pkg/build --no-deps install_data --install-dir /home/ps16214/tb3-ros2-template/install/my_pkg +[8.378s] Level 1:colcon.colcon_core.shell:create_environment_hook('my_pkg', 'pythonpath_develop') +[8.390s] DEBUG:colcon.colcon_core.event_handler.log_command:Invoked command in '/home/ps16214/tb3-ros2-template/build/my_pkg' returned '0': PYTHONPATH=/home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages:${PYTHONPATH} _=/usr/bin/env /usr/bin/python setup.py develop --prefix /home/ps16214/tb3-ros2-template/install/my_pkg --editable --build-directory /home/ps16214/tb3-ros2-template/build/my_pkg/build --no-deps install_data --install-dir /home/ps16214/tb3-ros2-template/install/my_pkg +[8.402s] INFO:colcon.colcon_core.shell:Creating environment hook '/home/ps16214/tb3-ros2-template/build/my_pkg/share/my_pkg/hook/pythonpath_develop.ps1' +[8.403s] INFO:colcon.colcon_core.shell:Creating environment descriptor '/home/ps16214/tb3-ros2-template/build/my_pkg/share/my_pkg/hook/pythonpath_develop.dsv' +[8.403s] INFO:colcon.colcon_core.shell:Creating environment hook '/home/ps16214/tb3-ros2-template/build/my_pkg/share/my_pkg/hook/pythonpath_develop.sh' +[8.433s] Level 1:colcon.colcon_core.environment:checking '/home/ps16214/tb3-ros2-template/install/my_pkg' for CMake module files +[8.434s] Level 1:colcon.colcon_core.environment:checking '/home/ps16214/tb3-ros2-template/install/my_pkg' for CMake config files +[8.435s] Level 1:colcon.colcon_core.environment:checking '/home/ps16214/tb3-ros2-template/install/my_pkg/lib' +[8.436s] Level 1:colcon.colcon_core.environment:checking '/home/ps16214/tb3-ros2-template/install/my_pkg/bin' +[8.436s] Level 1:colcon.colcon_core.environment:checking '/home/ps16214/tb3-ros2-template/install/my_pkg/lib/pkgconfig/my_pkg.pc' +[8.436s] Level 1:colcon.colcon_core.environment:checking '/home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages' +[8.436s] Level 1:colcon.colcon_core.shell:create_environment_hook('my_pkg', 'pythonpath') +[8.458s] INFO:colcon.colcon_core.shell:Creating environment hook '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/hook/pythonpath.ps1' +[8.459s] INFO:colcon.colcon_core.shell:Creating environment descriptor '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/hook/pythonpath.dsv' +[8.459s] INFO:colcon.colcon_core.shell:Creating environment hook '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/hook/pythonpath.sh' +[8.460s] Level 1:colcon.colcon_core.environment:create_environment_scripts_only(my_pkg) +[8.482s] INFO:colcon.colcon_core.shell:Creating package script '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/package.ps1' +[8.484s] INFO:colcon.colcon_core.shell:Creating package descriptor '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/package.dsv' +[8.486s] INFO:colcon.colcon_core.shell:Creating package script '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/package.sh' +[8.488s] INFO:colcon.colcon_core.shell:Creating package script '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/package.bash' +[8.490s] INFO:colcon.colcon_core.shell:Creating package script '/home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg/package.zsh' +[8.492s] Level 1:colcon.colcon_core.environment:create_file_with_runtime_dependencies(/home/ps16214/tb3-ros2-template/install/my_pkg/share/colcon-core/packages/my_pkg) +[8.494s] DEBUG:colcon.colcon_parallel_executor.executor.parallel:closing loop +[8.494s] DEBUG:colcon.colcon_parallel_executor.executor.parallel:loop closed +[8.494s] DEBUG:colcon.colcon_parallel_executor.executor.parallel:run_until_complete finished with '0' +[8.494s] DEBUG:colcon.colcon_core.event_reactor:joining thread +[8.526s] INFO:colcon.colcon_core.plugin_system:Skipping extension 'colcon_notification.desktop_notification.terminal_notifier': Not used on non-Darwin systems +[8.526s] INFO:colcon.colcon_core.plugin_system:Skipping extension 'colcon_notification.desktop_notification.win32': Not used on non-Windows systems +[8.527s] INFO:colcon.colcon_notification.desktop_notification:Sending desktop notification using 'notify2' +[8.530s] DEBUG:colcon.colcon_notification.desktop_notification.notify2:Failed to initialize notify2: org.freedesktop.DBus.Error.ServiceUnknown: The name org.freedesktop.Notifications was not provided by any .service files +[8.530s] DEBUG:colcon.colcon_core.event_reactor:joined thread +[8.554s] INFO:colcon.colcon_core.shell:Creating prefix script '/home/ps16214/tb3-ros2-template/install/local_setup.ps1' +[8.556s] INFO:colcon.colcon_core.shell:Creating prefix util module '/home/ps16214/tb3-ros2-template/install/_local_setup_util_ps1.py' +[8.560s] INFO:colcon.colcon_core.shell:Creating prefix chain script '/home/ps16214/tb3-ros2-template/install/setup.ps1' +[8.579s] INFO:colcon.colcon_core.shell:Creating prefix script '/home/ps16214/tb3-ros2-template/install/local_setup.sh' +[8.580s] INFO:colcon.colcon_core.shell:Creating prefix util module '/home/ps16214/tb3-ros2-template/install/_local_setup_util_sh.py' +[8.582s] INFO:colcon.colcon_core.shell:Creating prefix chain script '/home/ps16214/tb3-ros2-template/install/setup.sh' +[8.601s] INFO:colcon.colcon_core.shell:Creating prefix script '/home/ps16214/tb3-ros2-template/install/local_setup.bash' +[8.602s] INFO:colcon.colcon_core.shell:Creating prefix chain script '/home/ps16214/tb3-ros2-template/install/setup.bash' +[8.620s] INFO:colcon.colcon_core.shell:Creating prefix script '/home/ps16214/tb3-ros2-template/install/local_setup.zsh' +[8.621s] INFO:colcon.colcon_core.shell:Creating prefix chain script '/home/ps16214/tb3-ros2-template/install/setup.zsh' diff --git a/log/build_2022-03-01_11-42-39/my_pkg/command.log b/log/build_2022-03-01_11-42-39/my_pkg/command.log new file mode 100644 index 0000000..4502f79 --- /dev/null +++ b/log/build_2022-03-01_11-42-39/my_pkg/command.log @@ -0,0 +1,2 @@ +Invoking command in '/home/ps16214/tb3-ros2-template/build/my_pkg': PYTHONPATH=/home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages:${PYTHONPATH} _=/usr/bin/env /usr/bin/python setup.py develop --prefix /home/ps16214/tb3-ros2-template/install/my_pkg --editable --build-directory /home/ps16214/tb3-ros2-template/build/my_pkg/build --no-deps install_data --install-dir /home/ps16214/tb3-ros2-template/install/my_pkg +Invoked command in '/home/ps16214/tb3-ros2-template/build/my_pkg' returned '0': PYTHONPATH=/home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages:${PYTHONPATH} _=/usr/bin/env /usr/bin/python setup.py develop --prefix /home/ps16214/tb3-ros2-template/install/my_pkg --editable --build-directory /home/ps16214/tb3-ros2-template/build/my_pkg/build --no-deps install_data --install-dir /home/ps16214/tb3-ros2-template/install/my_pkg diff --git a/log/build_2022-03-01_11-42-39/my_pkg/stderr.log b/log/build_2022-03-01_11-42-39/my_pkg/stderr.log new file mode 100644 index 0000000..18e5ed5 --- /dev/null +++ b/log/build_2022-03-01_11-42-39/my_pkg/stderr.log @@ -0,0 +1,4 @@ +/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. + warnings.warn( +/usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. + warnings.warn( diff --git a/log/build_2022-03-01_11-42-39/my_pkg/stdout.log b/log/build_2022-03-01_11-42-39/my_pkg/stdout.log new file mode 100644 index 0000000..19406dd --- /dev/null +++ b/log/build_2022-03-01_11-42-39/my_pkg/stdout.log @@ -0,0 +1,22 @@ +running develop +running egg_info +creating my_pkg.egg-info +writing my_pkg.egg-info/PKG-INFO +writing dependency_links to my_pkg.egg-info/dependency_links.txt +writing entry points to my_pkg.egg-info/entry_points.txt +writing requirements to my_pkg.egg-info/requires.txt +writing top-level names to my_pkg.egg-info/top_level.txt +writing manifest file 'my_pkg.egg-info/SOURCES.txt' +reading manifest file 'my_pkg.egg-info/SOURCES.txt' +writing manifest file 'my_pkg.egg-info/SOURCES.txt' +running build_ext +Creating /home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages/my-pkg.egg-link (link to .) +Installing tb3 script to /home/ps16214/tb3-ros2-template/install/my_pkg/lib/my_pkg + +Installed /home/ps16214/tb3-ros2-template/build/my_pkg +running install_data +creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index +creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index +creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index/packages +copying resource/my_pkg -> /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index/packages +copying package.xml -> /home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg diff --git a/log/build_2022-03-01_11-42-39/my_pkg/stdout_stderr.log b/log/build_2022-03-01_11-42-39/my_pkg/stdout_stderr.log new file mode 100644 index 0000000..05eeee2 --- /dev/null +++ b/log/build_2022-03-01_11-42-39/my_pkg/stdout_stderr.log @@ -0,0 +1,26 @@ +running develop +/usr/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. + warnings.warn( +/usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. + warnings.warn( +running egg_info +creating my_pkg.egg-info +writing my_pkg.egg-info/PKG-INFO +writing dependency_links to my_pkg.egg-info/dependency_links.txt +writing entry points to my_pkg.egg-info/entry_points.txt +writing requirements to my_pkg.egg-info/requires.txt +writing top-level names to my_pkg.egg-info/top_level.txt +writing manifest file 'my_pkg.egg-info/SOURCES.txt' +reading manifest file 'my_pkg.egg-info/SOURCES.txt' +writing manifest file 'my_pkg.egg-info/SOURCES.txt' +running build_ext +Creating /home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages/my-pkg.egg-link (link to .) +Installing tb3 script to /home/ps16214/tb3-ros2-template/install/my_pkg/lib/my_pkg + +Installed /home/ps16214/tb3-ros2-template/build/my_pkg +running install_data +creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index +creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index +creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index/packages +copying resource/my_pkg -> /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index/packages +copying package.xml -> /home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg diff --git a/log/build_2022-03-01_11-42-39/my_pkg/streams.log b/log/build_2022-03-01_11-42-39/my_pkg/streams.log new file mode 100644 index 0000000..9f6bef0 --- /dev/null +++ b/log/build_2022-03-01_11-42-39/my_pkg/streams.log @@ -0,0 +1,28 @@ +[3.168s] Invoking command in '/home/ps16214/tb3-ros2-template/build/my_pkg': PYTHONPATH=/home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages:${PYTHONPATH} _=/usr/bin/env /usr/bin/python setup.py develop --prefix /home/ps16214/tb3-ros2-template/install/my_pkg --editable --build-directory /home/ps16214/tb3-ros2-template/build/my_pkg/build --no-deps install_data --install-dir /home/ps16214/tb3-ros2-template/install/my_pkg +[4.438s] running develop +[4.438s] /usr/lib/python3.10/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. Use build and pip and other standards-based tools. +[4.439s] warnings.warn( +[4.442s] /usr/lib/python3.10/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools. +[4.443s] warnings.warn( +[5.753s] running egg_info +[5.754s] creating my_pkg.egg-info +[5.754s] writing my_pkg.egg-info/PKG-INFO +[5.755s] writing dependency_links to my_pkg.egg-info/dependency_links.txt +[5.756s] writing entry points to my_pkg.egg-info/entry_points.txt +[5.756s] writing requirements to my_pkg.egg-info/requires.txt +[5.757s] writing top-level names to my_pkg.egg-info/top_level.txt +[5.763s] writing manifest file 'my_pkg.egg-info/SOURCES.txt' +[5.771s] reading manifest file 'my_pkg.egg-info/SOURCES.txt' +[5.771s] writing manifest file 'my_pkg.egg-info/SOURCES.txt' +[5.776s] running build_ext +[5.777s] Creating /home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages/my-pkg.egg-link (link to .) +[5.779s] Installing tb3 script to /home/ps16214/tb3-ros2-template/install/my_pkg/lib/my_pkg +[5.780s] +[5.780s] Installed /home/ps16214/tb3-ros2-template/build/my_pkg +[5.781s] running install_data +[5.781s] creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index +[5.781s] creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index +[5.782s] creating /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index/packages +[5.782s] copying resource/my_pkg -> /home/ps16214/tb3-ros2-template/install/my_pkg/share/ament_index/resource_index/packages +[5.783s] copying package.xml -> /home/ps16214/tb3-ros2-template/install/my_pkg/share/my_pkg +[5.890s] Invoked command in '/home/ps16214/tb3-ros2-template/build/my_pkg' returned '0': PYTHONPATH=/home/ps16214/tb3-ros2-template/install/my_pkg/lib/python3.10/site-packages:${PYTHONPATH} _=/usr/bin/env /usr/bin/python setup.py develop --prefix /home/ps16214/tb3-ros2-template/install/my_pkg --editable --build-directory /home/ps16214/tb3-ros2-template/build/my_pkg/build --no-deps install_data --install-dir /home/ps16214/tb3-ros2-template/install/my_pkg diff --git a/log/latest b/log/latest new file mode 120000 index 0000000..b57d247 --- /dev/null +++ b/log/latest @@ -0,0 +1 @@ +latest_build \ No newline at end of file diff --git a/log/latest_build b/log/latest_build new file mode 120000 index 0000000..1dacdd7 --- /dev/null +++ b/log/latest_build @@ -0,0 +1 @@ +build_2022-03-01_11-42-39 \ No newline at end of file diff --git a/ros.sh b/ros.sh new file mode 100644 index 0000000..8087e89 --- /dev/null +++ b/ros.sh @@ -0,0 +1,23 @@ +if [ -n "$ZSH_VERSION" ]; then + alias rosenv=" + export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/opt/gazebo-ros-pkgs/gazebo_plugins + export TURTLEBOT3_MODEL=waffle_pi + export GAZEBO_MODEL_PATH=/opt/turtlebot3/turtlebot3_gazebo/share/turtlebot3_gazebo/models + export GAZEBO_RESOURCE_PATH=/opt/turtlebot3/turtlebot3_gazebo/share/turtlebot3_gazebo/worlds + . /opt/ros/setup.zsh + . /opt/gazebo-ros-pkgs/local_setup.zsh + . /opt/turtlebot3/local_setup.zsh + . /usr/share/gazebo/setup.sh + " +elif [ -n "$BASH_VERSION" ]; then + alias rosenv=" + export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:/opt/gazebo-ros-pkgs/gazebo_plugins + export TURTLEBOT3_MODEL=waffle_pi + export GAZEBO_MODEL_PATH=/opt/turtlebot3/turtlebot3_gazebo/share/turtlebot3_gazebo/models + export GAZEBO_RESOURCE_PATH=/opt/turtlebot3/turtlebot3_gazebo/share/turtlebot3_gazebo/worlds + . /opt/ros/setup.bash + . /opt/gazebo-ros-pkgs/local_setup.bash + . /opt/turtlebot3/local_setup.bash + . /usr/share/gazebo/setup.sh + " +fi diff --git a/run.sh b/run.sh new file mode 100755 index 0000000..d9d6b6c --- /dev/null +++ b/run.sh @@ -0,0 +1 @@ +ros2 run my_pkg tb3 diff --git a/set_my_ros_domain_id.sh b/set_my_ros_domain_id.sh new file mode 100644 index 0000000..73edbe2 --- /dev/null +++ b/set_my_ros_domain_id.sh @@ -0,0 +1 @@ +export ROS_DOMAIN_ID=29 diff --git a/src/my_pkg/my_pkg/__init__.py b/src/my_pkg/my_pkg/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/src/my_pkg/my_pkg/__pycache__/__init__.cpython-310.pyc b/src/my_pkg/my_pkg/__pycache__/__init__.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..a316afc2a5a8d172688370b576941e4da805ecf9 GIT binary patch literal 156 zcmd1j<>g`kg1J9rlR)%i5P=LBfgA@QE@lA|DGb33nv8xc8Hzx{2;!H$enx(7s(wMS zp_!4PiGE3vv2Ia*v5{^`YHmSJVo9ogQfX#Rihgcod_i_PjEaxX%*!l^kJl@xyv1RY To1apelWGStxR?n@urL4s)Sn}U literal 0 HcmV?d00001 diff --git a/src/my_pkg/my_pkg/__pycache__/tb3.cpython-310.pyc b/src/my_pkg/my_pkg/__pycache__/tb3.cpython-310.pyc new file mode 100644 index 0000000000000000000000000000000000000000..71e26e84ce9dc90c1b04c09be90a9eff769278cf GIT binary patch literal 3194 zcma)8&2J<}74Pb<{+ON*+q;{r0wS5^Lt=>5W<LTUTH=JjMp+gMv=)R0RBBI^$8GoY z%vSZR<I(uE8wDZw1K?x}gcKpfg##S8apA@V0ewP(i^Y)}Br?BOJ>%HnLbv+Wd#|cq zRlkp4)u`Q$9Xx;gQ+Mlk%Z~GR63#yy!Yla9_d%p1S?(m%x;Y!ViOY!ha&O2JZh4;j z!ypMP@8{t#N+Qd%ypc38Hpt^)oWxcaf^Q~G=DhC6NH(50vZ36^Uec0n8O!Dqmb6tz zw)R~8CDnfHU=Dj=zh37AyKy#ptl}FZsnA}1I5J|aN84Ghgi(bVX(7`xMOWi~YLtG^ zPYVeC=6+^MFcErHnGI=jgIcNbGVPPy^N%+d%*$YulQ8Kd?mNyllT5l#qQsLe$)%6I zav8|*iIe#Cza)YE2PX;Nak!I251d}R@;0|__1QW5#0U6j8S^Gc={$ChVEmXdXXYHa zr6*nK9eXoJaL9fcNVL0Q86Be)4e5i%mNsPoz9mD@wxu1bUy=?Mk2Wf=+`5&7{h<_( zRDMEBSKPoYn%KcleoW6_*YEb0E8k4UN>`B(S&@}OB+GrR;4d+rY~`8RQCj;ny*W2V z`sDI_jG1hizRt#FHYzmbPt~SXL_f{*t+c<V>1UJ3>M*uiN{a#QNMOmnD#~gp&x#9* zwn?{@kO*8_^i|a=C%O=@HriJbzfg|GbqLWv93!6GsC@ff#8rrXo*E;>yUxE~TH6^7 z)!NwH_}tAKx7Xl{>w08vUN6;foa5itwkBCF*M<jTyf;`h7_~Y+&~5B^37`2SNQ-gT zW%LH`bDvsH{ChzVu=<VJw1r5oF5G7w++U;;Oq|91H8Oe+M6yFf`jAun5B-@pV^>gE zA9ZH_E)(vI&)hTFqfFTKkAj(Rv&2Qb!x;mOBuAwE>7DK(PNoZAs#JH=LgE`ta`5o= zsGpUYGTp4`&b=OY=g;70<1fa4{^=jr2hY9z&u{$Z+4t8^BsRFwYuK14L2a>OZzbW} zV#TJqgE2`sUsnT49K8b43-r?q-fENP*Is>7+<#+3eDf>!YvI+6*K1*sO+z!#&(JJO zJ_4@tuxWC>A<LX|7P!l7nYG-2!P_Bu8zcHIdKXU%3}vbH@fLD?#&+T7XPiUVaxOUd z89EOfw;TuOTh5ok+cYAu5|g2o!dWm2uR4d3)kf%VSgrvsMpT&j1*mJ}Ec&wZz2^^` zvnFJ3kDJ$KO&J5q?xBjgY@)&eo)2HdY@haIVeUJ&kE)-5wT+0fhcC(wTDJ_2f@2_p z2r&mM=wBj7_@1MGIG?jbbHHO~$4vjAY{=!uz!1!f<;omQI6&(I+b-b(eRB(!E?D># zEL{G7Ei5ecu58#`KS|*Clb@fSo}T=gxO?#a$qtccN&GZO_80UHz}V;H>u46zD|a`u z-=lZh*+ijd#h|OR!A^N?4pF~dKe>a^)Aph_SKH;aUb6}`@=+Om1-<$*kxN8q$)uST zB~AsK^%W<)*H1xTUFz?s{+=jDf?z}tvQ++9V>Cc8S8CjA*#xdUBxT}n>k)c5tyuYX zR|y9)>Z(C1k%F&ctDp0Bg5{ITcF6ut1{_^rS#qTwd{K+TX^wRtE(2fc?2)>Kom<q1 zk^J;_@J5ykP!JKjL>jLJE^u4;BGy7Lji8pl*9y)_|KJ@SPa9N1*7}7aS{zQch~C1w z^Kx))In;&ZNp2-?=FU762cK~y|EK1KgyNF^9@n3@GXqHBnS=tGOE|`M8R<(`HYn{- z0PzE&%{obYtquKgtgk;ogib6?crdtSpMS0E=SZp#u|KTqE~Gj`x)j*4lGirx_B>6g zSEt4E;1=j~owT1Na)ZcCBIM)`xnF+<y6@sMlvuUXBX*nI3@7vdOrItv{%=NI@F+o) zhtGPHP!r_`uTqK9{if$mU+8A0t0zTwe@7MSkpg;m&+af?<e}|XeT7tzXSj{qkiHFb zJ-0?&`%f29RMQzoRc2@t9X?&5{a!enVT63!YtZ3eq(db{6$>#O$q6o2qG}28aFXVA zk3AP{ec6?*d+Zujdw%lvRh|oR&W%@LToa<}h_-;w5Kc!pRpY0krKq>uv^^JYNwixU zZe2!5Q6gDpaMzCr;ar@UjP6O4Hq)>KzSi#imQysiQ~C!VqjX}<x1ECR!_|bOnCBdY z)Y{vTXYZ1!9+>IX{S+tx(Agg8?ob(%0#jC3S9=jEzMqc|Do&RoyGu<;lyEc7ifZMn z>R@Y>YWW6`M(fGA#6?z_QjZQqflF!?nVm@~NBadL^aae*4I&pKRPkY&6%%wALb1Ab zUAKdS4wsD62sN$gCQ8wvkwWy?MsG>K1YHu_?XA*cnp~DNY6Y&w^_^>JelbQ0nN>Pu zIgMHwC|rz6eIU;CbZqJ#5vqS35}^Rtwe<_ceXwuK*+V+IQ|HOcltPA76j!_ep~xk= M?8Sp<84z^(Uwd)$ssI20 literal 0 HcmV?d00001 diff --git a/src/my_pkg/my_pkg/tb3.py b/src/my_pkg/my_pkg/tb3.py new file mode 120000 index 0000000..c656656 --- /dev/null +++ b/src/my_pkg/my_pkg/tb3.py @@ -0,0 +1 @@ +../../../tb3.py \ No newline at end of file diff --git a/src/my_pkg/package.xml b/src/my_pkg/package.xml new file mode 100644 index 0000000..3799194 --- /dev/null +++ b/src/my_pkg/package.xml @@ -0,0 +1,18 @@ +<?xml version="1.0"?> +<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?> +<package format="3"> + <name>my_pkg</name> + <version>0.0.0</version> + <description>TODO: Package description</description> + <maintainer email="ps16214@todo.todo">ps16214</maintainer> + <license>TODO: License declaration</license> + + <test_depend>ament_copyright</test_depend> + <test_depend>ament_flake8</test_depend> + <test_depend>ament_pep257</test_depend> + <test_depend>python3-pytest</test_depend> + + <export> + <build_type>ament_python</build_type> + </export> +</package> diff --git a/src/my_pkg/resource/my_pkg b/src/my_pkg/resource/my_pkg new file mode 100644 index 0000000..e69de29 diff --git a/src/my_pkg/setup.cfg b/src/my_pkg/setup.cfg new file mode 100644 index 0000000..8a47cdf --- /dev/null +++ b/src/my_pkg/setup.cfg @@ -0,0 +1,4 @@ +[develop] +script_dir=$base/lib/my_pkg +[install] +install_scripts=$base/lib/my_pkg diff --git a/src/my_pkg/setup.py b/src/my_pkg/setup.py new file mode 100644 index 0000000..84ea5d0 --- /dev/null +++ b/src/my_pkg/setup.py @@ -0,0 +1,26 @@ +from setuptools import setup + +package_name = 'my_pkg' + +setup( + name=package_name, + version='0.0.0', + packages=[package_name], + data_files=[ + ('share/ament_index/resource_index/packages', + ['resource/' + package_name]), + ('share/' + package_name, ['package.xml']), + ], + install_requires=['setuptools'], + zip_safe=True, + maintainer='ps16214', + maintainer_email='ps16214@todo.todo', + description='TODO: Package description', + license='TODO: License declaration', + tests_require=['pytest'], + entry_points={ + 'console_scripts': [ + 'tb3 = my_pkg.tb3:main' + ], + }, +) diff --git a/src/my_pkg/test/test_copyright.py b/src/my_pkg/test/test_copyright.py new file mode 100644 index 0000000..cc8ff03 --- /dev/null +++ b/src/my_pkg/test/test_copyright.py @@ -0,0 +1,23 @@ +# Copyright 2015 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_copyright.main import main +import pytest + + +@pytest.mark.copyright +@pytest.mark.linter +def test_copyright(): + rc = main(argv=['.', 'test']) + assert rc == 0, 'Found errors' diff --git a/src/my_pkg/test/test_flake8.py b/src/my_pkg/test/test_flake8.py new file mode 100644 index 0000000..27ee107 --- /dev/null +++ b/src/my_pkg/test/test_flake8.py @@ -0,0 +1,25 @@ +# Copyright 2017 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_flake8.main import main_with_errors +import pytest + + +@pytest.mark.flake8 +@pytest.mark.linter +def test_flake8(): + rc, errors = main_with_errors(argv=[]) + assert rc == 0, \ + 'Found %d code style errors / warnings:\n' % len(errors) + \ + '\n'.join(errors) diff --git a/src/my_pkg/test/test_pep257.py b/src/my_pkg/test/test_pep257.py new file mode 100644 index 0000000..b234a38 --- /dev/null +++ b/src/my_pkg/test/test_pep257.py @@ -0,0 +1,23 @@ +# Copyright 2015 Open Source Robotics Foundation, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +from ament_pep257.main import main +import pytest + + +@pytest.mark.linter +@pytest.mark.pep257 +def test_pep257(): + rc = main(argv=['.', 'test']) + assert rc == 0, 'Found code style errors / warnings' diff --git a/tb3.py b/tb3.py new file mode 100644 index 0000000..15c0cfb --- /dev/null +++ b/tb3.py @@ -0,0 +1,134 @@ +import rclpy # ROS client library +from rclpy.node import Node +from rclpy.qos import qos_profile_sensor_data + +from sensor_msgs.msg import LaserScan +from geometry_msgs.msg import Twist + +import time + +from datetime import datetime +from datetime import timedelta + + +class Tb3(Node): + def __init__(self): + super().__init__('tb3') + + self.cmd_vel_pub = self.create_publisher( + Twist, # message type + 'cmd_vel', # topic name + 1) # history depth + + self.scan_sub = self.create_subscription( + LaserScan, + 'scan', + self.scan_callback, # function to run upon message arrival + qos_profile_sensor_data) # allows packet loss + + self.ang_vel_percent = 0 + self.lin_vel_percent = 0 + self.safe_distance = 0.4 + self.turn_allowed = False + self.stop = False + self.timestamp = 0 + + def vel(self, lin_vel_percent, ang_vel_percent=0): + """ publishes linear and angular velocities in percent + """ + # for TB3 Waffle + MAX_LIN_VEL = 0.26 # m/s + MAX_ANG_VEL = 1.82 # rad/s + + cmd_vel_msg = Twist() + cmd_vel_msg.linear.x = MAX_LIN_VEL * lin_vel_percent / 100 + cmd_vel_msg.angular.z = MAX_ANG_VEL * ang_vel_percent / 100 + + self.cmd_vel_pub.publish(cmd_vel_msg) + self.ang_vel_percent = ang_vel_percent + self.lin_vel_percent = lin_vel_percent + + def drive(self, msg): + front = msg.ranges[0] + left = msg.ranges[90] + right = msg.ranges[-90] + rear = msg.ranges[180] + left_area = msg.ranges[330:360] + right_area = msg.ranges[0:30] + front_area = left_area + right_area + left_white_distance = msg.ranges[40] + right_white_distance = msg.ranges[-40] + + if not self.stop: + if not self.turn_allowed: + for distance in front_area: + if distance > self.safe_distance or distance == 0.0: + self.vel(80, 0) + else: + # stop at red color + if msg.intensities[0] == 2.0: + self.vel(0, 0) + self.stop = False + else: + self.turn_allowed = True + self.timestamp = time.time() + + if self.turn_allowed: + if left < right: + self.vel(0, -60) + if self.check_to_stop_turn(msg): + print("Turning right!") + time.sleep(0.1) + self.vel(0, 0) + self.turn_allowed = False + else: + self.vel(0, 60) + if self.check_to_stop_turn(msg): + print("Turning left!") + time.sleep(0.1) + self.vel(0, 0) + self.turn_allowed = False + + def check_to_stop_turn(self, msg): + left_area = msg.ranges[330:360] + right_area = msg.ranges[0:30] + front_area = left_area + right_area + for distance in front_area: + if msg.ranges[0] > 1.2 and msg.ranges[90] > 0.2 and msg.ranges[-90] > 0.2 and distance > self.safe_distance: + print("Turn stopped!") + return True + else: + return False + + def scan_callback(self, msg): + """ is run whenever a LaserScan msg is received + """ + + self.drive(msg) + # self.detect_left_right(msg) + +# print('Distances:') +# print('â¬†ï¸ :', msg.ranges[0], msg.intensities[0]) +# print('â¬‡ï¸ :', msg.ranges[180], msg.intensities[180]) +# print('â¬…ï¸ :', msg.ranges[90], msg.intensities[90]) +# print('âž¡ï¸ :', msg.ranges[-90], msg.intensities[-90]) + + +def main(args=None): + rclpy.init(args=args) + + tb3 = Tb3() + print('waiting for messages...') + + try: + rclpy.spin(tb3) # Execute tb3 node + # Blocks until the executor (spin) cannot work + except KeyboardInterrupt: + pass + + tb3.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/tb3_challenge4.py b/tb3_challenge4.py new file mode 100644 index 0000000..beabfcf --- /dev/null +++ b/tb3_challenge4.py @@ -0,0 +1,98 @@ +import rclpy # ROS client library +from rclpy.node import Node +from rclpy.qos import qos_profile_sensor_data + +from sensor_msgs.msg import LaserScan +from geometry_msgs.msg import Twist + +import time + +from datetime import datetime +from datetime import timedelta + + +class Tb3(Node): + def __init__(self): + super().__init__('tb3') + + self.cmd_vel_pub = self.create_publisher( + Twist, # message type + 'cmd_vel', # topic name + 1) # history depth + + self.scan_sub = self.create_subscription( + LaserScan, + 'scan', + self.scan_callback, # function to run upon message arrival + qos_profile_sensor_data) # allows packet loss + + self.ang_vel_percent = 0 + self.lin_vel_percent = 0 + self.safe_distance = 0.4 + self.turn_allowed = False + self.stop = False + self.timestamp = 0 + + def vel(self, lin_vel_percent, ang_vel_percent=0): + """ publishes linear and angular velocities in percent + """ + # for TB3 Waffle + MAX_LIN_VEL = 0.26 # m/s + MAX_ANG_VEL = 1.82 # rad/s + + cmd_vel_msg = Twist() + cmd_vel_msg.linear.x = MAX_LIN_VEL * lin_vel_percent / 100 + cmd_vel_msg.angular.z = MAX_ANG_VEL * ang_vel_percent / 100 + + self.cmd_vel_pub.publish(cmd_vel_msg) + self.ang_vel_percent = ang_vel_percent + self.lin_vel_percent = lin_vel_percent + + def drive(self, msg): + if not self.stop: + if not self.turn_allowed: + if msg.ranges[0] > self.safe_distance or msg.ranges[0] == 0.0: + print(msg.intensities[0]) + self.vel(50, 0) + else: + self.turn_allowed = True + self.timestamp = time.time() + + if (time.time() - self.timestamp) <= 1 and self.turn_allowed: + self.vel(0, 45) + if (time.time() - self.timestamp) > 2 and self.turn_allowed: + self.vel(0, 0) + self.turn_allowed = False + + def scan_callback(self, msg): + """ is run whenever a LaserScan msg is received + """ + + self.drive(msg) + # self.detect_left_right(msg) + + print('Distances:') + print('â¬†ï¸ :', msg.ranges[0], msg.intensities[0]) + print('â¬‡ï¸ :', msg.ranges[180], msg.intensities[180]) + print('â¬…ï¸ :', msg.ranges[90], msg.intensities[90]) + print('âž¡ï¸ :', msg.ranges[-90], msg.intensities[-90]) + + +def main(args=None): + rclpy.init(args=args) + + tb3 = Tb3() + print('waiting for messages...') + + try: + rclpy.spin(tb3) # Execute tb3 node + # Blocks until the executor (spin) cannot work + except KeyboardInterrupt: + pass + + tb3.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/tb3_challenge5_old.py b/tb3_challenge5_old.py new file mode 100644 index 0000000..d92dd45 --- /dev/null +++ b/tb3_challenge5_old.py @@ -0,0 +1,125 @@ +import rclpy # ROS client library +from rclpy.node import Node +from rclpy.qos import qos_profile_sensor_data + +from sensor_msgs.msg import LaserScan +from geometry_msgs.msg import Twist + +import time + +from datetime import datetime +from datetime import timedelta + + +class Tb3(Node): + def __init__(self): + super().__init__('tb3') + + self.cmd_vel_pub = self.create_publisher( + Twist, # message type + 'cmd_vel', # topic name + 1) # history depth + + self.scan_sub = self.create_subscription( + LaserScan, + 'scan', + self.scan_callback, # function to run upon message arrival + qos_profile_sensor_data) # allows packet loss + + self.ang_vel_percent = 0 + self.lin_vel_percent = 0 + self.safe_distance = 0.4 + self.turn_allowed = False + self.stop = False + self.timestamp = 0 + + def vel(self, lin_vel_percent, ang_vel_percent=0): + """ publishes linear and angular velocities in percent + """ + # for TB3 Waffle + MAX_LIN_VEL = 0.26 # m/s + MAX_ANG_VEL = 1.82 # rad/s + + cmd_vel_msg = Twist() + cmd_vel_msg.linear.x = MAX_LIN_VEL * lin_vel_percent / 100 + cmd_vel_msg.angular.z = MAX_ANG_VEL * ang_vel_percent / 100 + + self.cmd_vel_pub.publish(cmd_vel_msg) + self.ang_vel_percent = ang_vel_percent + self.lin_vel_percent = lin_vel_percent + + def drive(self, msg): + front = msg.ranges[0] + left = msg.ranges[90] + right = msg.ranges[-90] + rear = msg.ranges[180] + front_area = msg.ranges[-40:40] + left_white_distance = msg.ranges[40] + right_white_distance = msg.ranges[-40] + + if not self.stop: + if not self.turn_allowed: + if (front > self.safe_distance or front == 0.0) \ + and (left_white_distance > self.safe_distance or left_white_distance == 0.0) \ + and (right_white_distance > self.safe_distance or right_white_distance == 0.0): + self.vel(80, 0) + else: + # white + if msg.intensities[0] == 2.0: + self.vel(0, 0) + self.stop = False + else: + self.turn_allowed = True + self.timestamp = time.time() + + if self.turn_allowed: + if left < right: + self.vel(0, -80) + if self.check_to_stop_turn(msg): + self.vel(0, 0) + self.turn_allowed = False + else: + self.vel(0, 80) + if self.check_to_stop_turn(msg): + self.vel(0, 0) + self.turn_allowed = False + + def check_to_stop_turn(self, msg): + if msg.ranges[0] > 1.2 and msg.ranges[90] > 0.2 and msg.ranges[-90] > 0.2 \ + and msg.ranges[40] > self.safe_distance and msg.ranges[-40] > self.safe_distance: + return True + else: + return False + + def scan_callback(self, msg): + """ is run whenever a LaserScan msg is received + """ + + self.drive(msg) + # self.detect_left_right(msg) + + print('Distances:') + print('â¬†ï¸ :', msg.ranges[0], msg.intensities[0]) + print('â¬‡ï¸ :', msg.ranges[180], msg.intensities[180]) + print('â¬…ï¸ :', msg.ranges[90], msg.intensities[90]) + print('âž¡ï¸ :', msg.ranges[-90], msg.intensities[-90]) + + +def main(args=None): + rclpy.init(args=args) + + tb3 = Tb3() + print('waiting for messages...') + + try: + rclpy.spin(tb3) # Execute tb3 node + # Blocks until the executor (spin) cannot work + except KeyboardInterrupt: + pass + + tb3.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/tb3_right_hand.py b/tb3_right_hand.py new file mode 100644 index 0000000..e6bd458 --- /dev/null +++ b/tb3_right_hand.py @@ -0,0 +1,141 @@ +import rclpy # ROS client library +from rclpy.node import Node +from rclpy.qos import qos_profile_sensor_data + +from sensor_msgs.msg import LaserScan +from geometry_msgs.msg import Twist + +import time + +from datetime import datetime +from datetime import timedelta + + +class Tb3(Node): + def __init__(self): + super().__init__('tb3') + + self.cmd_vel_pub = self.create_publisher( + Twist, # message type + 'cmd_vel', # topic name + 1) # history depth + + self.scan_sub = self.create_subscription( + LaserScan, + 'scan', + self.scan_callback, # function to run upon message arrival + qos_profile_sensor_data) # allows packet loss + + self.ang_vel_percent = 0 + self.lin_vel_percent = 0 + self.safe_distance = 0.4 + self.stop = False + self.start = True + + def vel(self, lin_vel_percent, ang_vel_percent=0): + """ publishes linear and angular velocities in percent + """ + # for TB3 Waffle + MAX_LIN_VEL = 0.26 # m/s + MAX_ANG_VEL = 1.82 # rad/s + + cmd_vel_msg = Twist() + cmd_vel_msg.linear.x = MAX_LIN_VEL * lin_vel_percent / 100 + cmd_vel_msg.angular.z = MAX_ANG_VEL * ang_vel_percent / 100 + + self.cmd_vel_pub.publish(cmd_vel_msg) + self.ang_vel_percent = ang_vel_percent + self.lin_vel_percent = lin_vel_percent + + def drive (self, msg): + if not self.stop: + if(self.start == True): + if(msg.ranges[0]> 0.4): + self.vel(90,0) + else: + if self.check_red_wall(msg): + self.vel(0,0) + self.stop = True + self.start = False + else: + if(msg.ranges[0] < 0.4 or msg.ranges[-40]< 0.45): + self.turn_left(msg) + print('lefty') + elif(msg.ranges[-60] > 0.45): + self.turn_right(msg) + print('right') + elif(msg.ranges[-90] < 0.20): + self.turn_left(msg) + print('left') + else: + self.vel(50,0) + + def turn_right(self, msg): + self.vel(0, 0) + self.vel(0, -90) + self.vel(0, 0) + + def turn_left(self, msg): + self.vel(0, 0) + self.vel(0, 90) + self.vel(0, 0) + + def check_red_wall(self, msg): + if msg.ranges[0] <= 0.4: + if msg.intensities[0] == 2.0: + return True + if msg.ranges[90] <= 0.4: + if msg.intensities[90] == 2.0: + return True + if msg.ranges[-90] <= 0.4: + if msg.intensities[-90] == 2.0: + return True + if msg.ranges[180] <= 0.4: + if msg.intensities[180] == 2.0: + return True + else: + return False + + def check_to_stop_turn(self, msg): + left_area = msg.ranges[330:360] + right_area = msg.ranges[0:30] + front_area = left_area + right_area + for distance in front_area: + if msg.ranges[0] > 1.2 and msg.ranges[90] > 0.2 and msg.ranges[-90] > 0.2 and distance > self.safe_distance: + print("Turn stopped!") + return True + else: + return False + + def scan_callback(self, msg): + """ is run whenever a LaserScan msg is received + """ + + self.drive(msg) + # self.detect_left_right(msg) + +# print('Distances:') +# print('â¬†ï¸ :', msg.ranges[0], msg.intensities[0]) +# print('â¬‡ï¸ :', msg.ranges[180], msg.intensities[180]) +# print('â¬…ï¸ :', msg.ranges[90], msg.intensities[90]) +# print('âž¡ï¸ :', msg.ranges[-90], msg.intensities[-90]) + + +def main(args=None): + rclpy.init(args=args) + + tb3 = Tb3() + print('waiting for messages...') + + try: + rclpy.spin(tb3) # Execute tb3 node + # Blocks until the executor (spin) cannot work + except KeyboardInterrupt: + pass + + tb3.destroy_node() + rclpy.shutdown() + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/tools/stop-tb3.sh b/tools/stop-tb3.sh new file mode 100755 index 0000000..290f406 --- /dev/null +++ b/tools/stop-tb3.sh @@ -0,0 +1 @@ +ros2 topic pub --once /cmd_vel geometry_msgs/msg/Twist "{linear: {x: 0, y: 0, z: 0}, angular: {x: 0, y: 0, z: 0}}" diff --git a/tools/tb3_teleop.sh b/tools/tb3_teleop.sh new file mode 100755 index 0000000..6c72b8e --- /dev/null +++ b/tools/tb3_teleop.sh @@ -0,0 +1 @@ +ros2 run turtlebot3_teleop teleop_keyboard -- GitLab