-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
24b6eba
commit 3cb5831
Showing
8 changed files
with
207 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
FROM osrf/ros:humble-desktop-full | ||
|
||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y git make graphviz python3-pip | ||
|
||
RUN cd /tmp \ | ||
&& git clone --recursive https://github.com/ros2/ros2_documentation \ | ||
&& pip install --requirement ros2_documentation/requirements.txt \ | ||
&& rm -rf ros2_documentation | ||
|
||
RUN cd /tmp \ | ||
&& git clone --recursive https://github.com/ros-infrastructure/rosdoc2 \ | ||
&& pip install --upgrade ./rosdoc2 \ | ||
&& rm -rf rosdoc2 | ||
|
||
# Add vscode user with same UID and GID as your host system | ||
# (copied from https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user) | ||
ARG USERNAME=vscode | ||
ARG USER_UID=1000 | ||
ARG USER_GID=$USER_UID | ||
RUN groupadd --gid $USER_GID $USERNAME \ | ||
&& useradd -s /bin/bash --uid $USER_UID --gid $USER_GID -m $USERNAME \ | ||
&& apt-get update \ | ||
&& apt-get install -y sudo \ | ||
&& echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ | ||
&& chmod 0440 /etc/sudoers.d/$USERNAME | ||
# Switch from root to user | ||
USER $USERNAME | ||
|
||
# Add user to video group to allow access to webcam | ||
RUN sudo usermod --append --groups video $USERNAME | ||
|
||
# Update all packages | ||
RUN sudo apt update && sudo apt upgrade -y | ||
|
||
# Install Git | ||
RUN sudo apt install -y git | ||
|
||
# Rosdep update | ||
RUN rosdep update | ||
|
||
# Source the ROS setup file | ||
RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc | ||
|
||
# Remove apt lists | ||
RUN sudo apt-get autoremove -y && sudo apt-get clean -y && rm -rf /var/lib/lists/* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"name": "humble desktop-full", | ||
"dockerFile": "Dockerfile", | ||
"runArgs": [ | ||
"--privileged", | ||
"--network=host" | ||
], | ||
"workspaceMount": "source=${localWorkspaceFolder},target=/${localWorkspaceFolderBasename},type=bind", | ||
"workspaceFolder": "/${localWorkspaceFolderBasename}" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
cmake_minimum_required(VERSION 3.8) | ||
project(example_package) | ||
|
||
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
add_compile_options(-Wall -Wextra -Wpedantic) | ||
endif() | ||
|
||
# find dependencies | ||
find_package(ament_cmake REQUIRED) | ||
find_package(ament_cmake_ros REQUIRED) | ||
# uncomment the following section in order to fill in | ||
# further dependencies manually. | ||
# find_package(<dependency> REQUIRED) | ||
|
||
add_library(example_package src/example_package.cpp) | ||
target_compile_features(example_package PUBLIC c_std_99 cxx_std_17) # Require C99 and C++17 | ||
target_include_directories(example_package PUBLIC | ||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include> | ||
$<INSTALL_INTERFACE:include>) | ||
|
||
# Causes the visibility macros to use dllexport rather than dllimport, | ||
# which is appropriate when building the dll but not consuming it. | ||
target_compile_definitions(example_package PRIVATE "EXAMPLE_PACKAGE_BUILDING_LIBRARY") | ||
|
||
install( | ||
DIRECTORY include/ | ||
DESTINATION include | ||
) | ||
install( | ||
TARGETS example_package | ||
EXPORT export_${PROJECT_NAME} | ||
ARCHIVE DESTINATION lib | ||
LIBRARY DESTINATION lib | ||
RUNTIME DESTINATION bin | ||
) | ||
|
||
if(BUILD_TESTING) | ||
find_package(ament_lint_auto REQUIRED) | ||
# the following line skips the linter which checks for copyrights | ||
# comment the line when a copyright and license is added to all source files | ||
set(ament_cmake_copyright_FOUND TRUE) | ||
# the following line skips cpplint (only works in a git repo) | ||
# comment the line when this package is in a git repo and when | ||
# a copyright and license is added to all source files | ||
set(ament_cmake_cpplint_FOUND TRUE) | ||
ament_lint_auto_find_test_dependencies() | ||
endif() | ||
|
||
ament_export_include_directories( | ||
include | ||
) | ||
ament_export_libraries( | ||
example_package | ||
) | ||
ament_export_targets( | ||
export_${PROJECT_NAME} | ||
) | ||
|
||
ament_package() |
19 changes: 19 additions & 0 deletions
19
src/example_package/include/example_package/example_package.hpp
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#ifndef EXAMPLE_PACKAGE__EXAMPLE_PACKAGE_HPP_ | ||
#define EXAMPLE_PACKAGE__EXAMPLE_PACKAGE_HPP_ | ||
|
||
#include "example_package/visibility_control.h" | ||
|
||
namespace example_package | ||
{ | ||
|
||
class ExamplePackage | ||
{ | ||
public: | ||
ExamplePackage(); | ||
|
||
virtual ~ExamplePackage(); | ||
}; | ||
|
||
} // namespace example_package | ||
|
||
#endif // EXAMPLE_PACKAGE__EXAMPLE_PACKAGE_HPP_ |
35 changes: 35 additions & 0 deletions
35
src/example_package/include/example_package/visibility_control.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
#ifndef EXAMPLE_PACKAGE__VISIBILITY_CONTROL_H_ | ||
#define EXAMPLE_PACKAGE__VISIBILITY_CONTROL_H_ | ||
|
||
// This logic was borrowed (then namespaced) from the examples on the gcc wiki: | ||
// https://gcc.gnu.org/wiki/Visibility | ||
|
||
#if defined _WIN32 || defined __CYGWIN__ | ||
#ifdef __GNUC__ | ||
#define EXAMPLE_PACKAGE_EXPORT __attribute__ ((dllexport)) | ||
#define EXAMPLE_PACKAGE_IMPORT __attribute__ ((dllimport)) | ||
#else | ||
#define EXAMPLE_PACKAGE_EXPORT __declspec(dllexport) | ||
#define EXAMPLE_PACKAGE_IMPORT __declspec(dllimport) | ||
#endif | ||
#ifdef EXAMPLE_PACKAGE_BUILDING_LIBRARY | ||
#define EXAMPLE_PACKAGE_PUBLIC EXAMPLE_PACKAGE_EXPORT | ||
#else | ||
#define EXAMPLE_PACKAGE_PUBLIC EXAMPLE_PACKAGE_IMPORT | ||
#endif | ||
#define EXAMPLE_PACKAGE_PUBLIC_TYPE EXAMPLE_PACKAGE_PUBLIC | ||
#define EXAMPLE_PACKAGE_LOCAL | ||
#else | ||
#define EXAMPLE_PACKAGE_EXPORT __attribute__ ((visibility("default"))) | ||
#define EXAMPLE_PACKAGE_IMPORT | ||
#if __GNUC__ >= 4 | ||
#define EXAMPLE_PACKAGE_PUBLIC __attribute__ ((visibility("default"))) | ||
#define EXAMPLE_PACKAGE_LOCAL __attribute__ ((visibility("hidden"))) | ||
#else | ||
#define EXAMPLE_PACKAGE_PUBLIC | ||
#define EXAMPLE_PACKAGE_LOCAL | ||
#endif | ||
#define EXAMPLE_PACKAGE_PUBLIC_TYPE | ||
#endif | ||
|
||
#endif // EXAMPLE_PACKAGE__VISIBILITY_CONTROL_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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>example_package</name> | ||
<version>0.0.0</version> | ||
<description>TODO: Package description</description> | ||
<maintainer email="[email protected]">vscode</maintainer> | ||
<license>TODO: License declaration</license> | ||
|
||
<buildtool_depend>ament_cmake_ros</buildtool_depend> | ||
|
||
<test_depend>ament_lint_auto</test_depend> | ||
<test_depend>ament_lint_common</test_depend> | ||
|
||
<export> | ||
<build_type>ament_cmake</build_type> | ||
</export> | ||
</package> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#include "example_package/example_package.hpp" | ||
|
||
namespace example_package | ||
{ | ||
|
||
ExamplePackage::ExamplePackage() | ||
{ | ||
} | ||
|
||
ExamplePackage::~ExamplePackage() | ||
{ | ||
} | ||
|
||
} // namespace example_package |