Skip to content

Commit

Permalink
Fix unused parameter ‘sensor_configuration’ warning for Velodyne
Browse files Browse the repository at this point in the history
  • Loading branch information
mojomex committed Dec 5, 2023
1 parent 16f2817 commit b42fa30
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@
#if (BOOST_VERSION / 100 == 1074) // Boost 1.74
#define BOOST_ALLOW_DEPRECATED_HEADERS
#endif
#include "boost_tcp_driver/http_client_driver.hpp"
#include "boost_udp_driver/udp_driver.hpp"
#include "nebula_common/velodyne/velodyne_common.hpp"
#include "nebula_common/velodyne/velodyne_status.hpp"
#include "nebula_hw_interfaces/nebula_hw_interfaces_common/nebula_hw_interface_base.hpp"
#include "boost_tcp_driver/http_client_driver.hpp"
#include "boost_udp_driver/udp_driver.hpp"

#include <rclcpp/rclcpp.hpp>

Expand Down Expand Up @@ -243,7 +243,8 @@ class VelodyneHwInterface : NebulaHwInterfaceBase
VelodyneStatus GetSnapshotAsync();
/// @brief Checking the current settings and changing the difference point
/// @return Resulting status
VelodyneStatus CheckAndSetConfigBySnapshotAsync();
VelodyneStatus CheckAndSetConfigBySnapshotAsync(
std::shared_ptr<VelodyneSensorConfiguration> sensor_configuration);
/// @brief Setting Motor RPM (async)
/// @param rpm the RPM of the motor
/// @return Resulting status
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ Status VelodyneHwInterface::InitializeSensorConfiguration(
Status VelodyneHwInterface::SetSensorConfiguration(
std::shared_ptr<SensorConfigurationBase> sensor_configuration)
{
VelodyneStatus status = CheckAndSetConfigBySnapshotAsync();
auto velodyne_sensor_configuration =
std::static_pointer_cast<VelodyneSensorConfiguration>(sensor_configuration);
VelodyneStatus status = CheckAndSetConfigBySnapshotAsync(velodyne_sensor_configuration);
Status rt = status;
return rt;
}
Expand Down Expand Up @@ -99,7 +101,10 @@ void VelodyneHwInterface::ReceiveCloudPacketCallback(const std::vector<uint8_t>
}
prev_packet_first_azm_phased_ = packet_first_azm_phased_;
}
Status VelodyneHwInterface::CloudInterfaceStop() { return Status::ERROR_1; }
Status VelodyneHwInterface::CloudInterfaceStop()
{
return Status::ERROR_1;
}

Status VelodyneHwInterface::GetSensorConfiguration(SensorConfigurationBase & sensor_configuration)
{
Expand Down Expand Up @@ -222,8 +227,7 @@ VelodyneStatus VelodyneHwInterface::CheckAndSetConfig(
SetFovStartAsync(setting_cloud_min_angle);
std::cout << "VelodyneHwInterface::parse_json(" << target_key
<< "): " << current_cloud_min_angle << std::endl;
std::cout << "sensor_configuration->cloud_min_angle: " << setting_cloud_min_angle
<< std::endl;
std::cout << "sensor_configuration->cloud_min_angle: " << setting_cloud_min_angle << std::endl;
}

target_key = "config.fov.end";
Expand All @@ -237,8 +241,7 @@ VelodyneStatus VelodyneHwInterface::CheckAndSetConfig(
SetFovEndAsync(setting_cloud_max_angle);
std::cout << "VelodyneHwInterface::parse_json(" << target_key
<< "): " << current_cloud_max_angle << std::endl;
std::cout << "sensor_configuration->cloud_max_angle: " << setting_cloud_max_angle
<< std::endl;
std::cout << "sensor_configuration->cloud_max_angle: " << setting_cloud_max_angle << std::endl;
}

target_key = "config.host.addr";
Expand Down Expand Up @@ -521,8 +524,11 @@ VelodyneStatus VelodyneHwInterface::GetSnapshotAsync()
return GetSnapshotAsync([this](const std::string & str) { ParseJson(str); });
}

VelodyneStatus VelodyneHwInterface::CheckAndSetConfigBySnapshotAsync()
VelodyneStatus VelodyneHwInterface::CheckAndSetConfigBySnapshotAsync(
std::shared_ptr<VelodyneSensorConfiguration> sensor_configuration)
{
sensor_configuration_ = sensor_configuration;

return GetSnapshotAsync([this](const std::string & str) {
auto tree = ParseJson(str);
std::cout << "ParseJson OK\n";
Expand Down

0 comments on commit b42fa30

Please sign in to comment.