Skip to content

Commit

Permalink
Spellchecking and update ros2_control generators. (StoglRobotics#16)
Browse files Browse the repository at this point in the history
* Add changes to ros2-scipts and spellchecks.

* Small changes in generations scripts after testing.
  • Loading branch information
destogl authored Aug 16, 2021
1 parent cd83934 commit d57ae8d
Show file tree
Hide file tree
Showing 40 changed files with 1,023 additions and 422 deletions.
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ information to effectively respond to your bug report or contribution.
## Reporting Bugs/Feature Requests
We welcome you to use the GitHub issue tracker to report bugs or suggest features.

When filing an issue, please check [existing open][issues], or [recently closed][closed-issues], issues to make sure
When filing an issue, please check [existing open][issues], or [recently closed][closed-issues], issues to make sure
somebody else hasn't already reported the issue.
Please try to include as much information as you can. Details like these are incredibly useful:

Expand Down Expand Up @@ -45,7 +45,7 @@ GitHub provides additional documentation on [forking a repository](https://help.
## Finding contributions to work on
Looking at the existing issues is a great way to find something to contribute on.
As this project, by default, uses the default GitHub issue labels
(enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'][help-wanted] issues
(enhancement/bug/duplicate/help wanted/invalid/question/wontfix), looking at any ['help wanted'][help-wanted] issues
is a great place to start.


Expand Down
2 changes: 1 addition & 1 deletion docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ help:
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
76 changes: 40 additions & 36 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
Expand All @@ -21,14 +20,14 @@

# -- Project information -----------------------------------------------------

project = 'ROS Team Workspace'
copyright = '2021, Denis Stogl'
author = 'Denis Stogl'
project = "ROS Team Workspace"
copyright = "2021, Stogl Robotics Consulting UG (haftungsbeschränkt)"
author = "Denis Stogl"

# The short X.Y version
version = ''
version = ""
# The full version, including alpha/beta/rc tags
release = 'Jan 2021'
release = "Jan 2021"


# -- General configuration ---------------------------------------------------
Expand All @@ -41,26 +40,26 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.doctest',
'sphinx.ext.intersphinx',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.githubpages',
'sphinx_rtd_theme',
"sphinx.ext.autodoc",
"sphinx.ext.doctest",
"sphinx.ext.intersphinx",
"sphinx.ext.todo",
"sphinx.ext.coverage",
"sphinx.ext.githubpages",
"sphinx_rtd_theme",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
templates_path = ["_templates"]

# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
source_suffix = ".rst"

# The master toctree document.
master_doc = 'index'
master_doc = "index"

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand All @@ -72,7 +71,7 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = None
Expand All @@ -83,8 +82,8 @@
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme_path = ['_themes']
html_theme = 'sphinx_rtd_theme'
html_theme_path = ["_themes"]
html_theme = "sphinx_rtd_theme"

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
Expand All @@ -95,7 +94,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = ["_static"]

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand All @@ -114,15 +113,15 @@
"github_version": "rolling",
"conf_py_path": "/docs/",
"source_suffix": source_suffix,
"css_files": ['_static/override.css'],
"css_files": ["_static/override.css"],
}

github_url = "https://github.com/StoglRobotics/ros_team_workspace"

# -- Options for HTMLHelp output ---------------------------------------------

# Output file base name for HTML help builder.
htmlhelp_basename = 'ROSTeamWorkspacedoc'
htmlhelp_basename = "ROSTeamWorkspacedoc"


# -- Options for LaTeX output ------------------------------------------------
Expand All @@ -131,15 +130,12 @@
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',

# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',

# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',

# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
Expand All @@ -149,19 +145,21 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'ROSTeamWorkspace.tex', 'ROS Team Workspace Documentation',
'Denis Stogl', 'manual'),
(
master_doc,
"ROSTeamWorkspace.tex",
"ROS Team Workspace Documentation",
"Denis Stogl",
"manual",
),
]


# -- Options for manual page output ------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'rosteamworkspace', 'ROS Team Workspace Documentation',
[author], 1)
]
man_pages = [(master_doc, "rosteamworkspace", "ROS Team Workspace Documentation", [author], 1)]


# -- Options for Texinfo output ----------------------------------------------
Expand All @@ -170,9 +168,15 @@
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'ROSTeamWorkspace', 'ROS Team Workspace Documentation',
author, 'ROSTeamWorkspace', 'One line description of project.',
'Miscellaneous'),
(
master_doc,
"ROSTeamWorkspace",
"ROS Team Workspace Documentation",
author,
"ROSTeamWorkspace",
"One line description of project.",
"Miscellaneous",
),
]


Expand All @@ -191,15 +195,15 @@
# epub_uid = ''

# A list of files that should not be packed into the epub file.
epub_exclude_files = ['search.html']
epub_exclude_files = ["search.html"]


# -- Extension configuration -------------------------------------------------

# -- Options for intersphinx extension ---------------------------------------

# Example configuration for intersphinx: refer to the Python standard library.
intersphinx_mapping = {'https://docs.python.org/': None}
intersphinx_mapping = {"https://docs.python.org/": None}

# -- Options for todo extension ----------------------------------------------

Expand Down
7 changes: 5 additions & 2 deletions docs/use-cases/ros2_control/setup_controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ This use-case describes how to set up a controller for the ros2_control framewor
The scripts uses template files from ``templates/ros2_control/controller`` folder.
The script creates a complete skeleton of a controller with plugin description and tests for loading controller and checking its basic functionality.

**Note**: it is recomended to setup your package using :ref:`setup-new-package <uc-new-package>` scritpt.
**Note**: it is recommended to setup your package using :ref:`setup-new-package <uc-new-package>` script.

**IMPORTANT**: The script has to be executed from the folder where files should be generated.


Usage
------

Expand All @@ -33,4 +34,6 @@ Parameters:
If not set, it is guessed from the current path using the folder's name.


The script will ask you for some additional input.
The script will ask for some additional input.

After all files are copied and placeholders set, changes are automatically staged in git.
3 changes: 1 addition & 2 deletions package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<name>ros_team_workspace</name>
<version>0.1.0</version>
<description>
RosTeamWS is a framework for boosting collaboration in teams when developing software for robots using `Robot Operating System (ROS) <https://www.ros.org/>`_.
RosTeamWS is a framework for boosting collaboration in teams when developing software for robots using `Robot Operating System (ROS) - https://www.ros.org/.
Its main goal is to optimize workflow of development teams and focus more on programming robots.
</description>
<maintainer email="[email protected]">Denis Štogl</maintainer>
Expand All @@ -20,4 +20,3 @@
<build_type>ament_cmake</build_type>
</export>
</package>

28 changes: 17 additions & 11 deletions scripts/_RosTeamWs_Defines.bash
Original file line number Diff line number Diff line change
Expand Up @@ -129,9 +129,9 @@ function colcon_test_up_to {
function colcon_test_results {
cd $ROS_WS
if [ -z "$1" ]; then
colcon test-result
colcon test-result --all
else
colcon test-result | grep "$*"
colcon test-result --all | grep "$*"
fi
cd -
}
Expand Down Expand Up @@ -206,6 +206,10 @@ function check_ros_distro {
ros_version=$DEFAULT_ROS_VERSION
if [[ $ros_distro == "foxy" ]]; then
ros_version=2
elif [[ $ros_distro == "galactic" ]]; then
ros_version=2
elif [[ $ros_distro == "rolling" ]]; then
ros_version=2
elif [[ $ros_distro == "noetic" ]]; then
ros_version=1
fi
Expand All @@ -223,26 +227,28 @@ function compile_and_source_package {
if [ -z "$2" ]; then
test="no"
fi
bn=`basename "$PWD"`
path=$bn

if [[ -v $ROS_WS ]]; then
cd $ROS_WS
else
echo "ROS_WS not found, searching manually for main workspace folder."
bn=`basename "$PWD"`
while [[ "$bn" != "src" ]]; do
cd ..
bn=`basename "$PWD"`
path="$bn/$path"
cd ..
bn=`basename "$PWD"`
done
cd ..
echo "Using base workspace path: `pwd`"
fi
echo "Trying to compile a newly created package. If you get an error try to do this manually."

echo "Compiling packages up to '$1'. If you get an error try to compile it manually."
# TODO: Why can not use functions from this script? (colcon_test_up_to)
colcon build --symlink-install --packages-up-to $pkg_name
source install/setup.bash
if [[ "$test" == "yes" ]]; then
colcon test --packages-select $pkg_name
colcon test-result | grep $pkg_name
colcon test --packages-select $pkg_name # Replace colcon_test_up_to
colcon test-result --all | grep $pkg_name # replace colcon_test_result
fi
cd $path
}

# END: Framework functions
Expand Down
33 changes: 19 additions & 14 deletions scripts/create-new-package.bash
Original file line number Diff line number Diff line change
Expand Up @@ -76,19 +76,24 @@ esac
read -p "How do you want to licence your package? ['$TEAM_LICENSE']: " LICENSE
LICENSE=${LICENSE:=$TEAM_LICENSE}

# Build type
read -p "Please choose your package build type (1 - ament_cmake, 2 - ament_python, 3 - cmake) [1]:" choice
if [[ $ros_version == 1 ]]; then
BUILD_TYPE="catkin"

case "$choice" in
"2")
BUILD_TYPE="ament_python"
;;
"3")
BUILD_TYPE="cmake"
;;
*)
BUILD_TYPE="ament_cmake"
esac
elif [[ $ros_version == 2 ]]; then
# Build type
read -p "Please choose your package build type (1 - ament_cmake, 2 - ament_python, 3 - cmake) [1]:" choice

case "$choice" in
"2")
BUILD_TYPE="ament_python"
;;
"3")
BUILD_TYPE="cmake"
;;
*)
BUILD_TYPE="ament_cmake"
esac
fi

echo ""
echo "ATTENTION: Creating package '$PKG_NAME' in '`pwd`' with description '$PKG_DESCRIPTION', licence '$LICENSE', build type '$BUILD_TYPE' and maintainer '$MAINTAINER_NAME <$MAINTAINER_EMAIL>'"
Expand Down Expand Up @@ -116,8 +121,8 @@ elif [[ $ros_version == 2 ]]; then
fi
fi

read -p "Do you want to setup/update repository with the new package configuration? (y/n) [n]: " choice
choice=${choice:="n"}
read -p "Do you want to setup/update repository with the new package configuration? (y/n) [y]: " choice
choice=${choice:="y"}

case "$choice" in
"y")
Expand Down
11 changes: 8 additions & 3 deletions scripts/environment/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ usage='setup.bash "ros_distro" "ros_ws_suffix" "workspace_folder"'
# Load Framework defines
script_own_dir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
source $script_own_dir/../_RosTeamWs_Defines.bash
source $script_own_dir/../_RosTeamWs_Docker_Defines.bash
source $script_own_dir/../_Team_Defines.bash

# ros distribution name will be set in $ros_distro
check_ros_distro $1

ws_suffix=$2
if [[ "$2" == "-" ]]; then
if [[ "$2" == "-" ]]; then
ws_suffix=""
else
ws_suffix="_$2"
Expand Down Expand Up @@ -52,14 +53,18 @@ elif [[ $ros_version == 2 ]]; then
# /opt/rti.com/rti_connext_dds-5.3.1/setenv_ros2rti.bash
# export LANG=de_DE.UTF-8
WS_FOLDER=""
WS_FOLDER_0="$HOME/$ws_folder/$ros_distro$ws_suffix"
WS_FOLDER_1="$HOME/$ws_folder/ros_ws_$ros_distro$ws_suffix"
WS_FOLDER_2="$HOME/$ws_folder/ros2_ws_$ros_distro$ws_suffix"
if [ -d "$WS_FOLDER_1" ]; then

if [ -d "$WS_FOLDER_0" ]; then
WS_FOLDER=$WS_FOLDER_0
elif [ -d "$WS_FOLDER_1" ]; then
WS_FOLDER=$WS_FOLDER_1
elif [ -d "$WS_FOLDER_2" ]; then
WS_FOLDER=$WS_FOLDER_2
else
print_and_exit "Neither '$WS_FOLDER_1' nor '$WS_FOLDER_2' exist. Can not find ROS workspace!"
print_and_exit "Neither '$WS_FOLDER_0', '$WS_FOLDER_1' nor '$WS_FOLDER_2' exist. Can not find ROS workspace!"
fi

export ROS_WS=$WS_FOLDER
Expand Down
Loading

0 comments on commit d57ae8d

Please sign in to comment.