Skip to content

Commit

Permalink
Merge pull request #259 from gazebosim/Crola1702/7_to_main_23-05-2024
Browse files Browse the repository at this point in the history
Merge gz-launch7 ➡️ main
  • Loading branch information
azeey authored May 29, 2024
2 parents 59335c9 + 6683744 commit 12b6bd8
Show file tree
Hide file tree
Showing 29 changed files with 356 additions and 104 deletions.
1 change: 0 additions & 1 deletion .github/ci/packages.apt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,5 @@ libwebsockets-dev
libxi-dev
libxmu-dev
libyaml-dev
python3-yaml
uuid-dev
xvfb
10 changes: 8 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
name: Ubuntu CI

on: [push, pull_request]
on:
pull_request:
push:
branches:
- 'ign-launch[0-9]'
- 'gz-launch[0-9]?'
- 'main'

jobs:
jammy-ci:
runs-on: ubuntu-latest
name: Ubuntu Jammy CI
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Compile and test
id: ci
uses: gazebo-tooling/action-gz-ci@jammy
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/package_xml.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
name: Validate package.xml

on:
pull_request:

jobs:
package-xml:
runs-on: ubuntu-latest
name: Validate package.xml
steps:
- uses: gazebo-tooling/action-gz-ci/validate_package_xml@jammy
1 change: 0 additions & 1 deletion .github/workflows/triage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ jobs:
with:
project-url: https://github.com/orgs/gazebosim/projects/7
github-token: ${{ secrets.TRIAGE_TOKEN }}

3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ gz_configure_project(VERSION_SUFFIX)
# Set project-specific options
#============================================================================

set(GZ_LAUNCH_PLUGIN_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins/")
set(GZ_LAUNCH_PLUGIN_RELATIVE_INSTALL_PATH "${GZ_LIB_INSTALL_DIR}/gz-${GZ_DESIGNATION}-${PROJECT_VERSION_MAJOR}/plugins/")
set(GZ_LAUNCH_PLUGIN_INSTALL_PATH "${CMAKE_INSTALL_PREFIX}/${GZ_LAUNCH_PLUGIN_RELATIVE_INSTALL_PATH}")

#============================================================================
# Search for project-specific dependencies
Expand Down
54 changes: 54 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,27 @@

## Gazebo Launch 7.x

### Gazebo Launch 7.1.0 (2024-04-11)

1. Use relative install paths for plugin shared libraries and gz-tools data
* [Pull request #253](https://github.com/gazebosim/gz-launch/pull/253)

1. Fix bug where address of local variable was returned
* [Pull request #252](https://github.com/gazebosim/gz-launch/pull/252)

1. Add optional binary relocatability
* [Pull request #218](https://github.com/gazebosim/gz-launch/pull/218)

1. Fix windows warnings
* [Pull request #199](https://github.com/gazebosim/gz-launch/pull/199)
* [Pull request #250](https://github.com/gazebosim/gz-launch/pull/250)

1. Update CI badges in README
* [Pull request #239](https://github.com/gazebosim/gz-launch/pull/239)

1. Infrastructure
* [Pull request #238](https://github.com/gazebosim/gz-launch/pull/238)

### Gazebo Launch 7.0.0 (2023-09-29)

1. Documentation fixes
Expand Down Expand Up @@ -84,6 +105,29 @@

## Gazebo Launch 5.x

### Gazebo Launch 5.3.0 (2023-06-14)

1. Forward ports
* [Pull request #214](https://github.com/gazebosim/gz-launch/pull/214)

1. Infrastructure
* [Pull request #213](https://github.com/gazebosim/gz-launch/pull/213)

1. Rename COPYING to LICENSE
* [Pull request #212](https://github.com/gazebosim/gz-launch/pull/212)

1. Small cleanup fixes
* [Pull request #211](https://github.com/gazebosim/gz-launch/pull/211)

1. Add pause and stop to Websocket Server
* [Pull request #187](https://github.com/gazebosim/gz-launch/pull/187)

1. Return a message on asset error
* [Pull request #197](https://github.com/gazebosim/gz-launch/pull/197)

1. Remove redundant namespace references
* [Pull request #190](https://github.com/gazebosim/gz-launch/pull/190)

### Gazebo Launch 5.2.0 (2022-08-16)

1. Add code coverage ignore file
Expand Down Expand Up @@ -235,6 +279,16 @@

## Gazebo Launch 2.x

### Gazebo Launch 2.3.1 (2024-01-05)

1. Small cleanup fixes
* [Pull request #211](https://github.com/gazebosim/gz-launch/pull/211)

1. Infrastructure
* [Pull request #238](https://github.com/gazebosim/gz-launch/pull/238)
* [Pull request #213](https://github.com/gazebosim/gz-launch/pull/213)
* [Pull request #212](https://github.com/gazebosim/gz-launch/pull/212)

### Gazebo Launch 2.3.0 (2022-08-15)

1. Remove redundant namespace references
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

Build | Status
-- | --
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-launch/branch/main/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-launch)
Ubuntu Focal | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_launch-ci-main-focal-amd64)](https://build.osrfoundation.org/job/ignition_launch-ci-main-focal-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=ignition_launch-ci-main-homebrew-amd64)](https://build.osrfoundation.org/job/ignition_launch-ci-main-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/ign_launch-ci-win/badge/icon)](https://build.osrfoundation.org/job/ign_launch-ci-win/)
Test coverage | [![codecov](https://codecov.io/gh/gazebosim/gz-launch/tree/gz-launch7/graph/badge.svg)](https://codecov.io/gh/gazebosim/gz-launch/tree/gz-launch7)
Ubuntu Jammy | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_launch-ci-gz-launch7-jammy-amd64)](https://build.osrfoundation.org/job/gz_launch-ci-gz-launch7-jammy-amd64)
Homebrew | [![Build Status](https://build.osrfoundation.org/buildStatus/icon?job=gz_launch-ci-gz-launch7-homebrew-amd64)](https://build.osrfoundation.org/job/gz_launch-ci-gz-launch7-homebrew-amd64)
Windows | [![Build Status](https://build.osrfoundation.org/job/gz_launch-7-win/badge/icon)](https://build.osrfoundation.org/job/gz_launch-7-win/)

Gazebo Launch, a component of [Gazebo](https://gazebosim.org), provides a command line interface
to run and manager application and plugins.
Expand Down
46 changes: 46 additions & 0 deletions include/gz/launch/InstallationDirectories.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (C) 2023 Open Source Robotics Foundation
*
* 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.
*
*/

#ifndef GZ_LAUNCH_INSTALLATION_DIRECTORIES_HH_
#define GZ_LAUNCH_INSTALLATION_DIRECTORIES_HH_

#include <string>

#include <gz/launch/config.hh>
#include <gz/launch/Export.hh>

namespace gz
{
namespace launch
{
inline namespace GZ_LAUNCH_VERSION_NAMESPACE {

/// \brief getInstallPrefix return the install prefix of the library
/// i.e. CMAKE_INSTALL_PREFIX unless the library has been moved
GZ_LAUNCH_VISIBLE std::string getInstallPrefix();

/// \brief getPluginInstallPath return the plugin install path
GZ_LAUNCH_VISIBLE std::string getPluginInstallPath();

/// \brief getInitialConfigPath return the initial config path
GZ_LAUNCH_VISIBLE std::string getInitialConfigPath();

}
}
}

#endif
4 changes: 2 additions & 2 deletions include/gz/launch/config.hh.in
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@

#define GZ_LAUNCH_VERSION_HEADER "Gazebo Launch, version ${PROJECT_VERSION_FULL}\nCopyright (C) 2019 Open Source Robotics Foundation.\nReleased under the Apache 2.0 License.\n\n"

#define GZ_LAUNCH_INITIAL_CONFIG_PATH "${CMAKE_INSTALL_PREFIX}/${GZ_DATA_INSTALL_DIR}/configs"
#define GZ_LAUNCH_INITIAL_CONFIG_PATH _Pragma ("GCC warning \"'GZ_LAUNCH_INITIAL_CONFIG_PATH' macro is deprecated, use gz::launch::getInitialConfigPath() function instead. \"") "${CMAKE_INSTALL_PREFIX}/${GZ_DATA_INSTALL_DIR}/configs"

#define GZ_LAUNCH_PLUGIN_INSTALL_PATH "${GZ_LAUNCH_PLUGIN_INSTALL_PATH}"
#define GZ_LAUNCH_PLUGIN_INSTALL_PATH _Pragma ("GCC warning \"'GZ_LAUNCH_PLUGIN_INSTALL_PATH' macro is deprecated, use gz::launch::getPluginInstallPath() function instead. \"") "${GZ_LAUNCH_PLUGIN_INSTALL_PATH}"

#endif
42 changes: 42 additions & 0 deletions package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="2">
<name>gz-launch8</name>
<version>8.0.0</version>
<description>Gazebo Launch : Run and manage programs and plugins</description>
<maintainer email="natekoenig@gmail.com">Nate Koenig</maintainer>
<license>Apache License 2.0</license>
<url type="website">https://github.com/gazebosim/gz-launch</url>

<buildtool_depend>cmake</buildtool_depend>

<depend>binutils</depend>
<depend>gz-cmake4</depend>
<depend>gz-common6</depend>
<depend>gz-fuel-tools9</depend>
<depend>gz-gui9</depend>
<depend>gz-math8</depend>
<depend>gz-msgs11</depend>
<depend>gz-physics7</depend>
<depend>gz-plugin3</depend>
<depend>gz-rendering8</depend>
<depend>gz-sensors8</depend>
<depend>gz-sim9</depend>
<depend>gz-tools2</depend>
<depend>gz-transport14</depend>
<depend>libgflags-dev</depend>
<depend>libwebsockets-dev</depend>
<depend>libxi-dev</depend>
<depend>libxmu-dev</depend>
<depend>libyaml-dev</depend>
<depend>sdformat14</depend>
<depend>tinyxml2</depend>
<depend>uuid</depend>

<test_depend>xvfb</test_depend>

<export>
<build_type>cmake</build_type>
</export>
</package>

2 changes: 1 addition & 1 deletion plugins/joy_to_twist/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ target_link_libraries(${plugin}
gz-transport${GZ_TRANSPORT_VER}::core
)

install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH})
install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_RELATIVE_INSTALL_PATH})
48 changes: 36 additions & 12 deletions plugins/joy_to_twist/JoyToTwist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <unistd.h>
#endif

#include <string>

#include <gz/msgs/joy.pb.h>
#include <gz/msgs/twist.pb.h>

Expand Down Expand Up @@ -49,6 +51,22 @@ void setVectorFromString(const std::string &_str,
}
}

//////////////////////////////////////////////////
// String to vector helper function.
void setVectorFromString(const std::string &_str,
gz::math::Vector3i &_v)
{
std::string str = gz::common::trimmed(_str);

std::vector<std::string> parts = gz::common::split(str, " ");
if (parts.size() == 3)
{
_v.X(std::stoi(parts[0]));
_v.Y(std::stoi(parts[1]));
_v.Z(std::stoi(parts[2]));
}
}

/////////////////////////////////////////////////
JoyToTwist::JoyToTwist()
: Plugin()
Expand Down Expand Up @@ -130,18 +148,21 @@ void JoyToTwist::OnJoy(const gz::msgs::Joy &_msg)
if (this->enableTurboButton >= 0 && _msg.buttons(this->enableTurboButton))
{
cmdVelMsg.mutable_linear()->set_x(
_msg.axes(this->axisLinear.X()) * this->scaleLinearTurbo.X());
_msg.axes(this->axisLinear.X()) * this->scaleLinearTurbo.X());
cmdVelMsg.mutable_linear()->set_y(
_msg.axes(this->axisLinear.Y()) * this->scaleLinearTurbo.Y());
_msg.axes(this->axisLinear.Y()) * this->scaleLinearTurbo.Y());
cmdVelMsg.mutable_linear()->set_z(
_msg.axes(this->axisLinear.Z()) * this->scaleLinearTurbo.Z());
_msg.axes(this->axisLinear.Z()) * this->scaleLinearTurbo.Z());

cmdVelMsg.mutable_angular()->set_x(
_msg.axes(this->axisAngular.X()) * this->scaleAngularTurbo.X());
_msg.axes(static_cast<int>(this->axisAngular.X())) *
this->scaleAngularTurbo.X());
cmdVelMsg.mutable_angular()->set_y(
_msg.axes(this->axisAngular.Y()) * this->scaleAngularTurbo.Y());
_msg.axes(static_cast<int>(this->axisAngular.Y())) *
this->scaleAngularTurbo.Y());
cmdVelMsg.mutable_angular()->set_z(
_msg.axes(this->axisAngular.Z()) * this->scaleAngularTurbo.Z());
_msg.axes(static_cast<int>(this->axisAngular.Z())) *
this->scaleAngularTurbo.Z());

this->cmdVelPub.Publish(cmdVelMsg);
this->sentDisableMsg = false;
Expand All @@ -150,18 +171,21 @@ void JoyToTwist::OnJoy(const gz::msgs::Joy &_msg)
else if (_msg.buttons(this->enableButton))
{
cmdVelMsg.mutable_linear()->set_x(
_msg.axes(this->axisLinear.X()) * this->scaleLinear.X());
_msg.axes(this->axisLinear.X()) * this->scaleLinear.X());
cmdVelMsg.mutable_linear()->set_y(
_msg.axes(this->axisLinear.Y()) * this->scaleLinear.Y());
_msg.axes(this->axisLinear.Y()) * this->scaleLinear.Y());
cmdVelMsg.mutable_linear()->set_z(
_msg.axes(this->axisLinear.Z()) * this->scaleLinear.Z());
_msg.axes(this->axisLinear.Z()) * this->scaleLinear.Z());

cmdVelMsg.mutable_angular()->set_x(
_msg.axes(this->axisAngular.X()) * this->scaleAngular.X());
_msg.axes(static_cast<int>(this->axisAngular.X())) *
this->scaleAngular.X());
cmdVelMsg.mutable_angular()->set_y(
_msg.axes(this->axisAngular.Y()) * this->scaleAngular.Y());
_msg.axes(static_cast<int>(this->axisAngular.Y())) *
this->scaleAngular.Y());
cmdVelMsg.mutable_angular()->set_z(
_msg.axes(this->axisAngular.Z()) * this->scaleAngular.Z());
_msg.axes(static_cast<int>(this->axisAngular.Z())) *
this->scaleAngular.Z());

this->cmdVelPub.Publish(cmdVelMsg);
this->sentDisableMsg = false;
Expand Down
2 changes: 1 addition & 1 deletion plugins/joy_to_twist/JoyToTwist.hh
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ namespace gz

private: int enableButton = 0;
private: int enableTurboButton = -1;
private: gz::math::Vector3d axisLinear{1.0, 0.0, 0.0};
private: gz::math::Vector3i axisLinear{1, 0, 0};
private: gz::math::Vector3d scaleLinear{0.5, 0.0, 0.0};
private: gz::math::Vector3d scaleLinearTurbo{0.5, 0.0, 0.0};

Expand Down
2 changes: 1 addition & 1 deletion plugins/joystick/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ target_link_libraries(${plugin}
gz-plugin${GZ_PLUGIN_VER}::core
)

install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH})
install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_RELATIVE_INSTALL_PATH})
2 changes: 1 addition & 1 deletion plugins/sim_factory/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ target_link_libraries(${plugin_lower}
gz-plugin${GZ_PLUGIN_VER}::core
)

install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH})
install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_RELATIVE_INSTALL_PATH})
2 changes: 1 addition & 1 deletion plugins/sim_gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ target_link_libraries(${plugin_lower}
gz-plugin${GZ_PLUGIN_VER}::core
)

install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH})
install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_RELATIVE_INSTALL_PATH})
2 changes: 1 addition & 1 deletion plugins/sim_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@ target_link_libraries(${plugin_lower}
gz-plugin${GZ_PLUGIN_VER}::core
)

install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH})
install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_RELATIVE_INSTALL_PATH})
2 changes: 1 addition & 1 deletion plugins/websocket_server/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,5 @@ if (websockets_FOUND)
gz-transport${GZ_TRANSPORT_VER}::core
)

install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_INSTALL_PATH})
install (TARGETS ${plugin} DESTINATION ${GZ_LAUNCH_PLUGIN_RELATIVE_INSTALL_PATH})
endif()
Loading

0 comments on commit 12b6bd8

Please sign in to comment.