Skip to content

Commit

Permalink
- clang format check in GitHub action activated
Browse files Browse the repository at this point in the history
- make code conform for clang format check
  • Loading branch information
JnsHndr committed Nov 4, 2024
1 parent 8dd19c0 commit 4a84370
Show file tree
Hide file tree
Showing 7 changed files with 36 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
env:
- {ROS_DISTRO: foxy, ROS_REPO: testing}
- {ROS_DISTRO: foxy, CATKIN_LINT: true}
# - {ROS_DISTRO: foxy, CLANG_FORMAT_CHECK: file}
- {ROS_DISTRO: foxy, CLANG_FORMAT_CHECK: file}
- {ROS_DISTRO: galactic}
- {ROS_DISTRO: humble}
- {ROS_DISTRO: iron}
Expand Down
2 changes: 1 addition & 1 deletion src/pf_driver/include/pf_driver/queue/atomicops.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
#if defined(AE_VCPP) || defined(AE_ICC)
#define AE_FORCEINLINE __forceinline
#elif defined(AE_GCC)
//#define AE_FORCEINLINE __attribute__((always_inline))
// #define AE_FORCEINLINE __attribute__((always_inline))
#define AE_FORCEINLINE inline
#else
#define AE_FORCEINLINE inline
Expand Down
8 changes: 3 additions & 5 deletions src/pf_driver/include/pf_driver/ros/pf_services.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,10 @@
#include "pf_interfaces/srv/pfsdp_get_iq_parameter.hpp"
#include "pf_interfaces/srv/pfsdp_set_iq_parameter.hpp"


class PFServices
{
public:
PFServices(PFInterface *pf) : pf_(pf)
PFServices(PFInterface* pf) : pf_(pf)
{
}

Expand All @@ -40,7 +39,7 @@ class PFServices

void pfsdp_reset_parameter(const std::shared_ptr<pf_interfaces::srv::PfsdpResetParameter::Request> request,
std::shared_ptr<pf_interfaces::srv::PfsdpResetParameter::Response> response);

void pfsdp_list_iq_parameters(const std::shared_ptr<pf_interfaces::srv::PfsdpListIqParameters::Request> request,
std::shared_ptr<pf_interfaces::srv::PfsdpListIqParameters::Response> response);

Expand All @@ -51,6 +50,5 @@ class PFServices
std::shared_ptr<pf_interfaces::srv::PfsdpSetIqParameter::Response> response);

private:
PFInterface *pf_ = nullptr;
PFInterface* pf_ = nullptr;
};

32 changes: 21 additions & 11 deletions src/pf_driver/src/pf/pf_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,49 +284,59 @@ void PFInterface::add_pf_services(void)
std::string basename = std::string(node_->get_namespace()) + std::string(node_->get_name()) + std::string("/pfsdp_");
std::string svcname;

std::shared_ptr<PFServices>pf_services = std::make_shared<PFServices>(this);
std::shared_ptr<PFServices> pf_services = std::make_shared<PFServices>(this);

svcname = basename + "get_protocol_info";
info_service_ = node_->create_service<pf_interfaces::srv::PfsdpGetProtocolInfo>(
svcname.c_str(), std::bind(&PFServices::pfsdp_get_protocol_info, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_get_protocol_info, pf_services, std::placeholders::_1, std::placeholders::_2));

svcname = basename + "reboot_device";
reboot_service_ = node_->create_service<pf_interfaces::srv::PfsdpRebootDevice>(
svcname.c_str(), std::bind(&PFServices::pfsdp_reboot_device, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_reboot_device, pf_services, std::placeholders::_1, std::placeholders::_2));

svcname = basename + "factory_reset";
factory_service_ = node_->create_service<pf_interfaces::srv::PfsdpFactoryReset>(
svcname.c_str(), std::bind(&PFServices::pfsdp_factory_reset, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_factory_reset, pf_services, std::placeholders::_1, std::placeholders::_2));

svcname = basename + "list_parameters";
listparams_service_ = node_->create_service<pf_interfaces::srv::PfsdpListParameters>(
svcname.c_str(), std::bind(&PFServices::pfsdp_list_parameters, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_list_parameters, pf_services, std::placeholders::_1, std::placeholders::_2));

svcname = basename + "get_parameter";
getparam_service_ = node_->create_service<pf_interfaces::srv::PfsdpGetParameter>(
svcname.c_str(), std::bind(&PFServices::pfsdp_get_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_get_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));

svcname = basename + "set_parameter";
setparam_service_ = node_->create_service<pf_interfaces::srv::PfsdpSetParameter>(
svcname.c_str(), std::bind(&PFServices::pfsdp_set_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_set_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));

svcname = basename + "reset_parameter";
resetparam_service_ = node_->create_service<pf_interfaces::srv::PfsdpResetParameter>(
svcname.c_str(), std::bind(&PFServices::pfsdp_reset_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_reset_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));

if (has_iq_parameters_)
{
svcname = basename + "list_iq_parameters";
listiqparams_service_ = node_->create_service<pf_interfaces::srv::PfsdpListIqParameters>(
svcname.c_str(), std::bind(&PFServices::pfsdp_list_iq_parameters, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_list_iq_parameters, pf_services, std::placeholders::_1, std::placeholders::_2));

svcname = basename + "get_iq_parameter";
getiqparam_service_ = node_->create_service<pf_interfaces::srv::PfsdpGetIqParameter>(
svcname.c_str(), std::bind(&PFServices::pfsdp_get_iq_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_get_iq_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));

svcname = basename + "set_iq_parameter";
setiqparam_service_ = node_->create_service<pf_interfaces::srv::PfsdpSetIqParameter>(
svcname.c_str(), std::bind(&PFServices::pfsdp_set_iq_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));
svcname.c_str(),
std::bind(&PFServices::pfsdp_set_iq_parameter, pf_services, std::placeholders::_1, std::placeholders::_2));
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/pf_driver/src/pf/pf_packet/pf_packet.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//#include <algorithm>
// #include <algorithm>
#include <iostream>

#include "pf_driver/pf/pf_packet/pf_packet.h"
Expand Down
6 changes: 3 additions & 3 deletions src/pf_driver/src/ros/pf_data_publisher.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//#include <exception>
//#include <limits>
//#include <utility>
// #include <exception>
// #include <limits>
// #include <utility>
#include <rclcpp/duration.hpp>
#include "pf_driver/ros/pf_data_publisher.h"
#include "pf_driver/pf/pf_packet/pf_r2000_packet_a.h"
Expand Down
11 changes: 6 additions & 5 deletions src/pf_driver/src/ros/pf_services.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

#include "pf_driver/ros/pf_services.h"


void PFServices::pfsdp_get_protocol_info(const std::shared_ptr<pf_interfaces::srv::PfsdpGetProtocolInfo::Request> request,
std::shared_ptr<pf_interfaces::srv::PfsdpGetProtocolInfo::Response> response)
void PFServices::pfsdp_get_protocol_info(
const std::shared_ptr<pf_interfaces::srv::PfsdpGetProtocolInfo::Request> request,
std::shared_ptr<pf_interfaces::srv::PfsdpGetProtocolInfo::Response> response)
{
pf_->pfsdp_info(response->protocol_name, response->version_major, response->version_minor, response->commands,
response->error_code, response->error_text);
Expand Down Expand Up @@ -48,8 +48,9 @@ void PFServices::pfsdp_reset_parameter(const std::shared_ptr<pf_interfaces::srv:
pf_->pfsdp_reset("reset_parameter", request->name, response->error_code, response->error_text);
}

void PFServices::pfsdp_list_iq_parameters(const std::shared_ptr<pf_interfaces::srv::PfsdpListIqParameters::Request> request,
std::shared_ptr<pf_interfaces::srv::PfsdpListIqParameters::Response> response)
void PFServices::pfsdp_list_iq_parameters(
const std::shared_ptr<pf_interfaces::srv::PfsdpListIqParameters::Request> request,
std::shared_ptr<pf_interfaces::srv::PfsdpListIqParameters::Response> response)
{
pf_->pfsdp_list("list_iq_parameters", "iq_parameters", response->iq_parameters, response->error_code,
response->error_text);
Expand Down

0 comments on commit 4a84370

Please sign in to comment.