Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge master into develop #754

Merged
merged 2 commits into from
May 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 43 additions & 0 deletions .github/workflows/sync_master_to_develop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: Branch synchronizer

on:
schedule:
- cron: '0 04 * * *'

jobs:
sync-develop-with-master:
runs-on: ubuntu-latest
steps:
- name: Checkout master
uses: actions/checkout@v3
with:
submodules: true
fetch-depth: 0
ref: master
- name: Check for diff
id: check-diff
run: |
git fetch origin develop
git checkout develop
if [ -n "$(git diff develop...master)" ]; then
echo "Develop needs sync with master!";
git checkout master
export BRANCH_NAME=sync-master-$(git rev-parse --short HEAD)
echo "BRANCH_NAME=$BRANCH_NAME" >> $GITHUB_ENV
git checkout -b ${BRANCH_NAME}
git push origin ${BRANCH_NAME}
echo "create_pull_request=1" >> $GITHUB_OUTPUT
else
echo "Develop is already up to date.";
echo "create_pull_request=0" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request if necessary
if: ${{ steps.check-diff.outputs.create_pull_request == 1 }}
uses: repo-sync/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
source_branch: ${{ env.BRANCH_NAME }}
destination_branch: develop
pr_title: Merge master into develop
pr_body: Synchronizes changes of master branch into develop branch.
pr_reviewer: Maintainers
9 changes: 3 additions & 6 deletions .github/workflows/tests_sources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,24 +21,21 @@ jobs:
strategy:
fail-fast: false
matrix:
os: [ubuntu-20.04]
os: [ubuntu-22.04]
python: ['3.10']
include:
- os: ubuntu-20.04
DEPENDENCIES_INSTALLATION: "sudo apt -y install clang-format-10 cppcheck"
- os: ubuntu-22.04
DEPENDENCIES_INSTALLATION: "sudo apt -y install cppcheck"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
if: github.event_name == 'schedule' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
with:
submodules: true
- name: Set up Python 3.10
if: github.event_name == 'schedule' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Test Sources
if: github.event_name == 'schedule' || github.event.pull_request.draft == false || contains(github.event.pull_request.labels.*.name, 'test sources')
run: |
${{ matrix.DEPENDENCIES_INSTALLATION }}
pip install -r tests/sources/requirements.txt
Expand Down
4 changes: 3 additions & 1 deletion webots_ros2_control/src/Ros2Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,9 @@ const double CONTROLLER_MANAGER_ALLOWED_SAMPLE_ERROR_MS = 1.0;

namespace webots_ros2_control {

Ros2Control::Ros2Control() { mNode = NULL; }
Ros2Control::Ros2Control() {
mNode = NULL;
}

void Ros2Control::step() {
const int nowMs = wb_robot_get_time() * 1000.0;
Expand Down
4 changes: 3 additions & 1 deletion webots_ros2_control/src/Ros2ControlSystem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@
#include <webots/robot.h>

namespace webots_ros2_control {
Ros2ControlSystem::Ros2ControlSystem() { mNode = NULL; }
Ros2ControlSystem::Ros2ControlSystem() {
mNode = NULL;
}
void Ros2ControlSystem::init(webots_ros2_driver::WebotsNode *node, const hardware_interface::HardwareInfo &info) {
mNode = node;
for (hardware_interface::ComponentInfo component : info.joints) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,6 @@ namespace webots_ros2_driver {
void axisAngleToQuaternion(const double *axisAngle, geometry_msgs::msg::Quaternion &q);
void quaternionToAxisAngle(const geometry_msgs::msg::Quaternion &q, double *axisAngle);

double interpolateLookupTable(double value, std::vector<double> &table);
double interpolateLookupTable(double value, const std::vector<double> &table);
} // namespace webots_ros2_driver
#endif
8 changes: 6 additions & 2 deletions webots_ros2_driver/src/WebotsNode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ namespace webots_ros2_driver {

bool gShutdownSignalReceived = false;

void handleSigint(int sig) { gShutdownSignalReceived = true; }
void handleSigint(int sig) {
gShutdownSignalReceived = true;
}

WebotsNode::WebotsNode(std::string name) : Node(name), mPluginLoader(gPluginInterfaceName, gPluginInterface) {
mRobotDescriptionParam = this->declare_parameter<std::string>("robot_description", "");
Expand Down Expand Up @@ -276,5 +278,7 @@ namespace webots_ros2_driver {
mClient->async_send_request(request);
}

void WebotsNode::handleSignals() { signal(SIGINT, handleSigint); }
void WebotsNode::handleSignals() {
signal(SIGINT, handleSigint);
}
} // end namespace webots_ros2_driver
7 changes: 5 additions & 2 deletions webots_ros2_driver/src/plugins/static/Ros2LED.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,10 @@ namespace webots_ros2_driver {
topicName, rclcpp::SensorDataQoS().reliable(), std::bind(&Ros2LED::onMessageReceived, this, std::placeholders::_1));
}

void Ros2LED::step() {}
void Ros2LED::step() {
}

void Ros2LED::onMessageReceived(const std_msgs::msg::Int32::SharedPtr message) { wb_led_set(mLED, message->data); }
void Ros2LED::onMessageReceived(const std_msgs::msg::Int32::SharedPtr message) {
wb_led_set(mLED, message->data);
}
} // namespace webots_ros2_driver
2 changes: 1 addition & 1 deletion webots_ros2_driver/src/utils/Math.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ namespace webots_ros2_driver {
return slope * (value - startX) + startY;
}

double interpolateLookupTable(double value, std::vector<double> &table) {
double interpolateLookupTable(double value, const std::vector<double> &table) {
if (!table.size())
return value;
const int size = table.size();
Expand Down