Skip to content

Commit

Permalink
Merge branch 'master' into fix_setup_script
Browse files Browse the repository at this point in the history
  • Loading branch information
destogl authored Feb 19, 2024
2 parents 57c0343 + 71ac3e7 commit 5f545ba
Show file tree
Hide file tree
Showing 6 changed files with 37 additions and 18 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,6 @@ jobs:
with:
python-version: '3.10'
cache: 'pip'
- uses: pre-commit/[email protected].0
- uses: pre-commit/[email protected].1
with:
extra_args: --all-files --hook-stage manual
17 changes: 17 additions & 0 deletions scripts/create-new-package.bash
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,23 @@ if [[ $ros_version == 1 ]]; then
elif [[ $ros_version == 2 ]]; then
ros2 pkg create --package-format 3 --description "$PKG_DESCRIPTION" --license "$LICENSE" --build-type "$BUILD_TYPE" --maintainer-email "$MAINTAINER_EMAIL" --maintainer-name "$MAINTAINER_NAME" $PKG_NAME

if [[ "$BUILD_TYPE" == "ament_cmake" || "$BUILD_TYPE" == "cmake" ]]; then
cd $PKG_NAME || print_and_exit "create-new-package internal error. cannot change dir to src/$PKG_NAME."
# set compile options - add more compilation flags to escalate warnings
sed -i -E 's/^[[:blank:]]*if\(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang"\)$/if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)")/' CMakeLists.txt
sed -i -E 's/^[[:blank:]]*add_compile_options\(-Wall -Wextra -Wpedantic\)$/ add_compile_options(-Wall -Wextra -Werror=conversion -Werror=unused-but-set-variable -Werror=return-type -Werror=shadow)/' CMakeLists.txt
# Remove auto lint stuff:
# 1) remove all the lint dependencies in package.xml
sed -i '/<test_depend>ament_lint_auto<\/test_depend>/d; /<test_depend>ament_lint_common<\/test_depend>/d' package.xml
# remove multiple newlines
awk '!NF { if (!blank++) print; next } { blank=0; print }' package.xml >tmp_file && mv tmp_file package.xml
# 2) remove all in between the if(BUILD_TESTING) and endif() block
# this usually contains linting stuff which we don't want for the tests
sed -i '/if(BUILD_TESTING)/,/endif()/ { /if(BUILD_TESTING)/b; /endif()/b; d; }' CMakeLists.txt
awk '!NF { if (!blank++) print; next } { blank=0; print }' CMakeLists.txt >tmp_file && mv tmp_file CMakeLists.txt
cd "-" || exit
fi

## Until it is corrected upstream
if [[ "$PKG_TYPE" == "$package_type_metapackage_option" ]]; then
cd $PKG_NAME
Expand Down
3 changes: 2 additions & 1 deletion templates/.ros_team_ws_rc
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ TEAM_PRIVATE_CONFIG_PATH=""
# set this to the location of RosTeamWorkspace
source <PATH TO ros_team_workspace>/setup.bash

# User specific setup / variables
# User specific setup/variables

#export CYCLONEDDS_URI='<CycloneDDS><Domain><General><NetworkInterfaceAddress>ADD_HERE_INTERFACE_NAME</NetworkInterfaceAddress></General></Domain></CycloneDDS>'

export ROS_AUTOMATIC_DISCOVERY_RANGE="LOCALHOST" # Doc: https://docs.ros.org/en/rolling/Tutorials/Advanced/Improved-Dynamic-Discovery.html
export ROS_DOMAIN_ID=0 # Set your Domain ID if you are in a network with multiple computers

# needed to execute cppcheck version 2.7 used in pre-commit
Expand Down
1 change: 1 addition & 0 deletions templates/licenses/proprietary_company_header.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Copyright (c) $YEAR$, $NAME_ON_LICENSE$
4 changes: 2 additions & 2 deletions templates/robot_description/robot_macro.ros2_control.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<plugin>gazebo_ros2_control/GazeboSystem</plugin>
</xacro:if>
<xacro:if value="${sim_gazebo}">
<plugin>ign_ros2_control/IgnitionSystem</plugin>
<plugin>gz_ros2_control/GazeboSimSystem</plugin>
</xacro:if>
<xacro:unless value="${use_mock_hardware or sim_gazebo_classic or sim_gazebo}">
<plugin>robot_hardware_inteface/RobotHardwareInteface</plugin>
Expand Down Expand Up @@ -132,7 +132,7 @@
<gazebo reference="world">
</gazebo>
<gazebo>
<plugin filename="libign_ros2_control-system.so" name="ign_ros2_control::IgnitionROS2ControlPlugin">
<plugin filename="gz_ros2_control-system" name="gz_ros2_control::GazeboSimROS2ControlPlugin">
<parameters>${simulation_controllers}</parameters>
<controller_manager_node_name>${prefix}controller_manager</controller_manager_node_name>
</plugin>
Expand Down
28 changes: 14 additions & 14 deletions templates/robot_description/robot_macro.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
<!-- LINKS -->
<!-- base link -->
<link name="${prefix}base_link">
<!-- Default inertial for Gazebo/Ingnition - copy and edit block from 'common.xacro'
to get more realistic behaviour-->
<!-- Default inertial for Gazebo - copy and edit block from 'common.xacro'
to get more realistic behavior -->
<xacro:default_inertial/>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
Expand All @@ -27,8 +27,8 @@
</link>
<!-- link 1 -->
<link name="${prefix}link1">
<!-- Default inertial for Gazebo/Ingnition - copy and edit block from 'common.xacro'
to get more realistic behaviour-->
<!-- Default inertial for Gazebo - copy and edit block from 'common.xacro'
to get more realistic behavior -->
<xacro:default_inertial/>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
Expand All @@ -47,8 +47,8 @@
</link>
<!-- link 2 -->
<link name="${prefix}link2">
<!-- Default inertial for Gazebo/Ingnition - copy and edit block from 'common.xacro'
to get more realistic behaviour-->
<!-- Default inertial for Gazebo - copy and edit block from 'common.xacro'
to get more realistic behavior-->
<xacro:default_inertial/>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
Expand All @@ -67,8 +67,8 @@
</link>
<!-- link 3 -->
<link name="${prefix}link3">
<!-- Default inertial for Gazebo/Ingnition - copy and edit block from 'common.xacro'
to get more realistic behaviour-->
<!-- Default inertial for Gazebo - copy and edit block from 'common.xacro'
to get more realistic behavior-->
<xacro:default_inertial/>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
Expand All @@ -87,8 +87,8 @@
</link>
<!-- link 4 -->
<link name="${prefix}link4">
<!-- Default inertial for Gazebo/Ingnition - copy and edit block from 'common.xacro'
to get more realistic behaviour-->
<!-- Default inertial for Gazebo - copy and edit block from 'common.xacro'
to get more realistic behavior-->
<xacro:default_inertial/>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
Expand All @@ -107,8 +107,8 @@
</link>
<!-- link 5 -->
<link name="${prefix}link5">
<!-- Default inertial for Gazebo/Ingnition - copy and edit block from 'common.xacro'
to get more realistic behaviour-->
<!-- Default inertial for Gazebo - copy and edit block from 'common.xacro'
to get more realistic behavior-->
<xacro:default_inertial/>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
Expand All @@ -127,8 +127,8 @@
</link>
<!-- link 6 -->
<link name="${prefix}link6">
<!-- Default inertial for Gazebo/Ingnition - copy and edit block from 'common.xacro'
to get more realistic behaviour-->
<!-- Default inertial for Gazebo - copy and edit block from 'common.xacro'
to get more realistic behavior-->
<xacro:default_inertial/>
<visual>
<origin xyz="0 0 0" rpy="0 0 0" />
Expand Down

0 comments on commit 5f545ba

Please sign in to comment.