Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -227,8 +227,6 @@ void RMDHardwareInterface::on_can_message(const CANLib::CanFrame& frame) {
std::string result;

std::vector<int> data(8, 0x00);
double raw_motor_velocity = 0.0;
double raw_motor_position = 0.0;

for(int i = 0; i < num_joints; i++){
if(can_rx_frame_.id == joint_node_read_ids[i] &&
Expand Down Expand Up @@ -333,7 +331,7 @@ hardware_interface::return_type RMDHardwareInterface::read(


hardware_interface::return_type rmd_ros2_control::RMDHardwareInterface::write(
const rclcpp::Time & time, const rclcpp::Duration & period)
const rclcpp::Time & /*time*/, const rclcpp::Duration & period)
{
elapsed_update_time+=period.seconds();
double update_period = 1.0/update_rate;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ struct Estop_msg_t final {
}
#endif

void encode_buf(uint8_t* buf) const {
void encode_buf(uint8_t* /*buf*/) const {
}

void decode_buf(const uint8_t* buf) {
void decode_buf(const uint8_t* /*buf*/) {
}

static const uint8_t cmd_id = 0x002;
Expand Down Expand Up @@ -869,10 +869,10 @@ struct Enter_DFU_Mode_msg_t final {
}
#endif

void encode_buf(uint8_t* buf) const {
void encode_buf(uint8_t* /*buf*/) const {
}

void decode_buf(const uint8_t* buf) {
void decode_buf(const uint8_t* /*buf*/) {
}

static const uint8_t cmd_id = 0x01F;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ODriveCanNode::ODriveCanNode(const std::string& node_name) : rclcpp::Node(node_n

void ODriveCanNode::deinit() {
if (axis_idle_on_shutdown_) {
struct can_frame frame;
struct can_frame frame = {};
frame.can_id = node_id_ << 5 | CmdId::kSetAxisState;
write_le<uint32_t>(ODriveAxisState::AXIS_STATE_IDLE, frame.data);
frame.can_dlc = 4;
Expand Down Expand Up @@ -199,7 +199,7 @@ void ODriveCanNode::service_callback(const std::shared_ptr<AxisState::Request> r
response->procedure_result = ctrl_stat_.procedure_result;
}

void ODriveCanNode::service_clear_errors_callback(const std::shared_ptr<Empty::Request> request, std::shared_ptr<Empty::Response> response) {
void ODriveCanNode::service_clear_errors_callback(const std::shared_ptr<Empty::Request> /*request*/, std::shared_ptr<Empty::Response> /*response*/) {
RCLCPP_INFO(rclcpp::Node::get_logger(), "clearing errors");
srv_clear_errors_evt_.set();
}
Expand All @@ -211,7 +211,7 @@ void ODriveCanNode::request_state_callback() {
axis_state = axis_state_;
}

struct can_frame frame;
struct can_frame frame = {};

if (axis_state != 0) {
// Clear errors if requested state is not IDLE
Expand All @@ -229,7 +229,7 @@ void ODriveCanNode::request_state_callback() {
}

void ODriveCanNode::request_clear_errors_callback() {
struct can_frame frame;
struct can_frame frame = {};
frame.can_id = node_id_ << 5 | CmdId::kClearErrors;
write_le<uint8_t>(0, frame.data);
frame.can_dlc = 1;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ void SMCHardwareInterface::on_can_message(const CANLib::CanFrame& frame) {
int data[8] = {0x00};

for(int i = 0; i < num_joints; i++){
if(can_rx_frame_.id == joint_node_ids[i] &&
if(can_rx_frame_.id == static_cast<uint32_t>(joint_node_ids[i]) &&
(can_rx_frame_.data[0] == SPEED_CONTROL_CMD ||
can_rx_frame_.data[0] == ABSOLUTE_POS_CONTROL_CMD ||
can_rx_frame_.data[0] == MOTOR_STATUS_2_CMD) &&
Expand Down Expand Up @@ -245,7 +245,7 @@ void SMCHardwareInterface::on_can_message(const CANLib::CanFrame& frame) {
// TORQUE CURRENT (16-bit signed, 0.01A per LSB)
motor_torque_current_[i] = static_cast<double>(static_cast<int16_t>((data[3] << 8) | data[2])) * 0.01;
}
else if(can_rx_frame_.id == joint_node_ids[i] && can_rx_frame_.data[0] == 0x92){
else if(can_rx_frame_.id == static_cast<uint32_t>(joint_node_ids[i]) && can_rx_frame_.data[0] == 0x92){
data[0] = 0x92;
data[1] = can_rx_frame_.data[1]; // Multi-turn low byte
data[2] = can_rx_frame_.data[2];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -429,7 +429,7 @@ hardware_interface::return_type stepper_ros2_control::STEPPERHardwareInterface::
joint_velocity = joint_orientation[i]*calculate_motor_velocity_from_desired_joint_velocity(joint_command_velocity_[i], joint_gear_ratios[i]);

if(DEBUG_MODE == 1) {
RCLCPP_INFO(rclcpp::get_logger("STEPPERHardwareInterface"), "Writing velocities for: %s Joint velocity of motor (0.01 dps): %d Joint command velocity: %f Orientation: %f CAN ID: %d",
RCLCPP_INFO(rclcpp::get_logger("STEPPERHardwareInterface"), "Writing velocities for: %s Joint velocity of motor (0.01 dps): %d Joint command velocity: %f Orientation: %d",
info_.joints[i].name.c_str(),
joint_velocity,
joint_command_velocity_[i],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct PigeonIMU_StickyFaults {
*
* @param bits bit field of faults to update with
*/
void Update(uint64_t bits) {
void Update(uint64_t /*bits*/) {
}
/**
* Creates fault list with specified bit field of faults
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,6 @@ hardware_interface::return_type talon_ros2_control::TALONHardwareInterface::writ
{
elapsed_update_time+=period.seconds();
double update_period = 1.0/update_rate;

elapsed_time+=period.seconds();

// Logger update
Expand Down
6 changes: 3 additions & 3 deletions src/infrastructure/umdloop_can_library/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.8)
project(umdloop_can_library VERSION 1.0.0)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
add_compile_options(-Wall -Wextra)
endif()

# find dependencies
Expand All @@ -25,9 +25,9 @@ add_custom_target(umdloop_can_library_build_serialcan
# First generate Version.h and build_no.h
COMMAND bash ./build_no.sh
# Then build the libraries with proper CFLAGS
COMMAND ${CMAKE_COMMAND} -E env "CFLAGS=-fPIC" "CXXFLAGS=-fPIC"
COMMAND ${CMAKE_COMMAND} -E env "CFLAGS=-fPIC" "CXXFLAGS=-fPIC" "MAKEFLAGS="
${CMAKE_MAKE_PROGRAM} -C Libraries/SerialCAN all
COMMAND ${CMAKE_COMMAND} -E env "CFLAGS=-fPIC" "CXXFLAGS=-fPIC"
COMMAND ${CMAKE_COMMAND} -E env "CFLAGS=-fPIC" "CXXFLAGS=-fPIC" "MAKEFLAGS="
${CMAKE_MAKE_PROGRAM} -C Libraries/CANAPI all
WORKING_DIRECTORY ${serialcan_SOURCE_DIR}
COMMENT "Building SerialCAN libraries with -fPIC"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#include <vector>

#include "controller_interface/controller_interface.hpp"
#include "manual_arm_cylindrical_controller_parameters.hpp"
#include <arm_controllers/manual_arm_cylindrical_controller_parameters.hpp>
#include "athena_arm_controllers/visibility_control.h"
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
#include "rclcpp_lifecycle/state.hpp"
#include "realtime_tools/realtime_buffer.h"
#include "realtime_tools/realtime_publisher.h"
#include "realtime_tools/realtime_buffer.hpp"
#include "realtime_tools/realtime_publisher.hpp"
#include "std_srvs/srv/set_bool.hpp"

// TODO(anyone): Replace with controller specific messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
#include <vector>

#include "controller_interface/controller_interface.hpp"
#include "manual_arm_joint_by_joint_controller_parameters.hpp"
#include <arm_controllers/manual_arm_joint_by_joint_controller_parameters.hpp>
#include "athena_arm_controllers/visibility_control.h"
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
#include "rclcpp_lifecycle/state.hpp"
#include "realtime_tools/realtime_buffer.h"
#include "realtime_tools/realtime_publisher.h"
#include "realtime_tools/realtime_buffer.hpp"
#include "realtime_tools/realtime_publisher.hpp"
#include "std_srvs/srv/set_bool.hpp"

// TODO(anyone): Replace with controller specific messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@
#include <string>

#include "parameter_traits/parameter_traits.hpp"
#include "tl_expected/expected.hpp"

namespace parameter_traits
{
inline Result forbidden_interface_name_prefix(rclcpp::Parameter const & parameter)
inline tl::expected<void, std::string> forbidden_interface_name_prefix(rclcpp::Parameter const & parameter)
{
auto const & interface_name = parameter.as_string();

if (interface_name.rfind("blup_", 0) == 0)
{
return ERROR("'interface_name' parameter can not start with 'blup_'");
return tl::unexpected(std::string("'interface_name' parameter can not start with 'blup_'"));
}

return OK;
return {};
}

} // namespace parameter_traits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ controller_interface::return_type ManualArmJointByJointController::update(
}

// Once actuator reaches original position, stop movement
if (actuator_active_ = true && joint_velocities_[6] == 0.0 && actuator_iterator < 0){
if (actuator_active_ == true && joint_velocities_[6] == 0.0 && actuator_iterator < 0){
actuator_active_ = false;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#include <vector>

#include "controller_interface/controller_interface.hpp"
#include "crab_steering_controller_parameters.hpp"
#include <drive_controllers/crab_steering_controller_parameters.hpp>
#include "athena_drive_controllers/visibility_control.h"
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
#include "rclcpp_lifecycle/state.hpp"
#include "realtime_tools/realtime_buffer.h"
#include "realtime_tools/realtime_publisher.h"
#include "realtime_tools/realtime_buffer.hpp"
#include "realtime_tools/realtime_publisher.hpp"
#include "std_srvs/srv/set_bool.hpp"

// TODO(anyone): Replace with controller specific messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#include <vector>

#include "controller_interface/controller_interface.hpp"
#include "double_ackermann_controller_parameters.hpp"
#include <drive_controllers/double_ackermann_controller_parameters.hpp>
#include "athena_drive_controllers/visibility_control.h"
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
#include "rclcpp_lifecycle/state.hpp"
#include "realtime_tools/realtime_buffer.h"
#include "realtime_tools/realtime_publisher.h"
#include "realtime_tools/realtime_buffer.hpp"
#include "realtime_tools/realtime_publisher.hpp"
#include "std_srvs/srv/set_bool.hpp"

// TODO(anyone): Replace with controller specific messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,11 @@
#include <deque>

#include "controller_interface/controller_interface.hpp"
#include "single_ackermann_controller_parameters.hpp"
#include <drive_controllers/single_ackermann_controller_parameters.hpp>
#include "athena_drive_controllers/visibility_control.h"
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
#include "rclcpp_lifecycle/state.hpp"
#include "realtime_tools/realtime_buffer.h"
#include "realtime_tools/realtime_buffer.hpp"
#include "geometry_msgs/msg/twist.hpp"
#include "geometry_msgs/msg/twist_stamped.hpp"
#include "geometry_msgs/msg/transform_stamped.hpp"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@
#include <vector>

#include "controller_interface/controller_interface.hpp"
#include "swerve_drive_controller_parameters.hpp"
#include <drive_controllers/swerve_drive_controller_parameters.hpp>
#include "athena_drive_controllers/visibility_control.h"
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
#include "rclcpp_lifecycle/state.hpp"
#include "realtime_tools/realtime_buffer.h"
#include "realtime_tools/realtime_publisher.h"
#include "realtime_tools/realtime_buffer.hpp"
#include "realtime_tools/realtime_publisher.hpp"
#include "std_srvs/srv/set_bool.hpp"

// TODO(anyone): Replace with controller specific messages
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,19 +24,20 @@
#include <string>

#include "parameter_traits/parameter_traits.hpp"
#include "tl_expected/expected.hpp"

namespace parameter_traits
{
inline Result forbidden_interface_name_prefix(rclcpp::Parameter const & parameter)
inline tl::expected<void, std::string> forbidden_interface_name_prefix(rclcpp::Parameter const & parameter)
{
auto const & interface_name = parameter.as_string();

if (interface_name.rfind("blup_", 0) == 0)
{
return ERROR("'interface_name' parameter can not start with 'blup_'");
return tl::unexpected(std::string("'interface_name' parameter can not start with 'blup_'"));
}

return OK;
return {};
}

} // namespace parameter_traits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ controller_interface::CallbackReturn DoubleAckermannController::on_configure(
return controller_interface::CallbackReturn::SUCCESS;
}

void DoubleAckermannController::reference_callback(const std::shared_ptr<ControllerReferenceMsg> msg)
void DoubleAckermannController::reference_callback(const std::shared_ptr<ControllerReferenceMsg> /*msg*/)
{
// if (msg->joint_names.size() == joints.size())
// {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,6 @@ controller_interface::return_type SwerveDriveController::update(
double linear_y = (*current_ref)->linear.y;
double angular_z = (*current_ref)->angular.z;
double track_width = params_.track_width;
double wheelbase = params_.wheelbase;
double wheel_radius = params_.wheel_radius;

// Calculations credit: https://github.com/RoboEagles4828/ros2-swerve-controller/tree/main
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
#include "controller_interface/controller_interface.hpp"
#include "diagnostic_msgs/msg/diagnostic_array.hpp"
#include "general_controllers/visibility_control.h"
#include "motor_status_broadcaster_parameters.hpp"
#include <general_controllers/motor_status_broadcaster_parameters.hpp>
#include "rclcpp_lifecycle/node_interfaces/lifecycle_node_interface.hpp"
#include "rclcpp_lifecycle/state.hpp"

Expand Down
2 changes: 2 additions & 0 deletions src/subsystems/navigation/obstacle_detection/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.8)
project(obstacle_detection)

cmake_policy(SET CMP0074 NEW)

if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
add_compile_options(-Wall -Wextra -Wpedantic)
endif()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,21 +16,22 @@

#include <string>
#include "parameter_traits/parameter_traits.hpp"
#include "tl_expected/expected.hpp"

#include "rclcpp/rclcpp.hpp"

namespace parameter_traits
{
inline parameter_traits::Result forbidden_interface_name_prefix(rclcpp::Parameter const & parameter)
inline tl::expected<void, std::string> forbidden_interface_name_prefix(rclcpp::Parameter const & parameter)
{
auto const & interface_name = parameter.as_string();

if (interface_name.rfind("blup_", 0) == 0)
{
return parameter_traits::ERROR("'interface_name' parameter can not start with 'blup_'");
return tl::unexpected(std::string("'interface_name' parameter can not start with 'blup_'"));
}

return parameter_traits::OK;
return {};
}

} // namespace parameter_traits
Expand Down