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

Fix linting issues #20

Merged
merged 2 commits into from
Jul 25, 2024
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
10 changes: 4 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,9 @@ jobs:
with:
target-ros2-distro: humble
package-name: |
clearpath_diagnostics
clearpath_generator_robot
clearpath_socketcan_interface
puma_motor_driver
clearpath_sensors
puma_motor_msgs
puma_motor_driver_src_ci:
name: Humble Clearpath Source
runs-on: ubuntu-22.04
Expand All @@ -56,8 +55,7 @@ jobs:
with:
target-ros2-distro: humble
package-name: |
clearpath_diagnostics
clearpath_generator_robot
clearpath_socketcan_interface
puma_motor_driver
clearpath_sensors
puma_motor_msgs
vcs-repo-file-url: dependencies.repos
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,14 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__ASIO_BASE_HPP_
#define SOCKETCAN_INTERFACE__ASIO_BASE_HPP_
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__ASIO_BASE_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__ASIO_BASE_HPP_

#include <functional>

#include <boost/asio.hpp>
#include <boost/thread/mutex.hpp>
#include <boost/thread/thread.hpp>
#include <functional>

#include "clearpath_socketcan_interface/dispatcher.hpp"
#include "clearpath_socketcan_interface/interface.hpp"
Expand Down Expand Up @@ -168,4 +169,4 @@ class AsioDriver : public DriverInterface

} // namespace can

#endif // SOCKETCAN_INTERFACE__ASIO_BASE_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__ASIO_BASE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__BCM_HPP_
#define SOCKETCAN_INTERFACE__BCM_HPP_
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__BCM_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__BCM_HPP_

#include <sys/types.h>
#include <sys/socket.h>
Expand All @@ -25,9 +25,10 @@
#include <linux/can/bcm.h>
#include <linux/can/error.h>

#include <boost/chrono.hpp>
#include <string>

#include <boost/chrono.hpp>

#include "clearpath_socketcan_interface/interface.hpp"

namespace can
Expand Down Expand Up @@ -161,4 +162,4 @@ class BCMsocket

} // namespace can

#endif // SOCKETCAN_INTERFACE__BCM_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__BCM_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__DISPATCHER_HPP_
#define SOCKETCAN_INTERFACE__DISPATCHER_HPP_

#include <boost/thread/mutex.hpp>
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__DISPATCHER_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__DISPATCHER_HPP_

#include <functional>
#include <memory>
#include <list>
#include <unordered_map>

#include <boost/thread/mutex.hpp>

#include "clearpath_socketcan_interface/interface.hpp"

namespace can
Expand Down Expand Up @@ -172,4 +172,4 @@ class FilteredDispatcher

} // namespace can

#endif // SOCKETCAN_INTERFACE__DISPATCHER_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__DISPATCHER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,16 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__DUMMY_HPP_
#define SOCKETCAN_INTERFACE__DUMMY_HPP_

#include <boost/algorithm/string.hpp>
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__DUMMY_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__DUMMY_HPP_

#include <unordered_map>
#include <string>
#include <utility>
#include <memory>

#include <boost/algorithm/string.hpp>

#include "clearpath_socketcan_interface/interface.hpp"
#include "clearpath_socketcan_interface/dispatcher.hpp"
#include "clearpath_socketcan_interface/string.hpp"
Expand Down Expand Up @@ -153,4 +153,4 @@ using DummyInterfaceSharedPtr = std::shared_ptr<DummyInterface>;

} // namespace can

#endif // SOCKETCAN_INTERFACE__DUMMY_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__DUMMY_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__FILTER_HPP_
#define SOCKETCAN_INTERFACE__FILTER_HPP_
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__FILTER_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__FILTER_HPP_

#include <vector>
#include <memory>
Expand Down Expand Up @@ -111,4 +111,4 @@ class FilteredFrameListener : public CommInterface::FrameListener

} // namespace can

#endif // SOCKETCAN_INTERFACE__FILTER_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__FILTER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__INTERFACE_HPP_
#define SOCKETCAN_INTERFACE__INTERFACE_HPP_

#include <boost/system/error_code.hpp>
#include <boost/thread/mutex.hpp>
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__INTERFACE_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__INTERFACE_HPP_

#include <iostream>
#include <string>
#include <array>
#include <memory>
#include <functional>

#include <boost/system/error_code.hpp>
#include <boost/thread/mutex.hpp>

#include "clearpath_socketcan_interface/logging.hpp"

namespace can
Expand Down Expand Up @@ -294,4 +294,4 @@ using DriverInterfaceSharedPtr = std::shared_ptr<DriverInterface>;

} // namespace can

#endif // SOCKETCAN_INTERFACE__INTERFACE_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__INTERFACE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__LOGGING_HPP_
#define SOCKETCAN_INTERFACE__LOGGING_HPP_
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__LOGGING_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__LOGGING_HPP_

#include <console_bridge/console.h>

Expand All @@ -25,7 +25,6 @@
{ \
std::stringstream sstr; \
sstr << name << ": " << args; \
// console_bridge::getOutputHandler()->log(sstr.str(), level, file, line); \
}

#define ROSCANOPEN_ERROR(name, args) ROSCANOPEN_LOG( \
Expand Down Expand Up @@ -54,4 +53,4 @@ void roscanopen_log_deprecated(const std::string s, const char * f, int l)
roscanopen_log_deprecated(sstr.str(), __FILE__, __LINE__); \
}

#endif // SOCKETCAN_INTERFACE__LOGGING_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__LOGGING_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__MAKE_SHARED_HPP_
#define SOCKETCAN_INTERFACE__MAKE_SHARED_HPP_
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__MAKE_SHARED_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__MAKE_SHARED_HPP_

#include <memory>
#define ROSCANOPEN_MAKE_SHARED std::make_shared

#endif // SOCKETCAN_INTERFACE__MAKE_SHARED_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__MAKE_SHARED_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,17 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__READER_HPP_
#define SOCKETCAN_INTERFACE__READER_HPP_
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__READER_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__READER_HPP_

#include <deque>

#include <boost/thread/mutex.hpp>
#include <boost/thread/condition_variable.hpp>
#include <boost/chrono.hpp>

#include <clearpath_socketcan_interface/interface.hpp>

#include <deque>

namespace can
{

Expand Down Expand Up @@ -161,4 +161,4 @@ class BufferedReader

} // namespace can

#endif // SOCKETCAN_INTERFACE__READER_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__READER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__SOCKETCAN_HPP_
#define SOCKETCAN_INTERFACE__SOCKETCAN_HPP_

#include <boost/bind.hpp>
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__SOCKETCAN_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__SOCKETCAN_HPP_

#include <sys/types.h>
#include <sys/socket.h>
Expand All @@ -30,6 +28,8 @@
#include <string>
#include <memory>

#include <boost/bind.hpp>

#include "clearpath_socketcan_interface/asio_base.hpp"
#include "clearpath_socketcan_interface/dispatcher.hpp"

Expand Down Expand Up @@ -262,7 +262,7 @@ class SocketCANInterface
input_.id = frame_.can_id & CAN_EFF_MASK;
input_.is_error = 1;

//ROSCANOPEN_ERROR("socketcan_interface", "error: " << input_.id);
// ROSCANOPEN_ERROR("socketcan_interface", "error: " << input_.id);
setInternalError(input_.id);
setNotReady();
} else {
Expand Down Expand Up @@ -291,4 +291,4 @@ using ThreadedSocketCANInterfaceSharedPtr = std::shared_ptr<ThreadedSocketCANInt

} // namespace can

#endif // SOCKETCAN_INTERFACE__SOCKETCAN_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__SOCKETCAN_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__STRING_HPP_
#define SOCKETCAN_INTERFACE__STRING_HPP_
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__STRING_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__STRING_HPP_

#include <sstream>
#include <string>
Expand Down Expand Up @@ -66,4 +66,4 @@ std::ostream & operator<<(std::ostream & stream, const can::Header & h);
std::ostream & operator<<(std::ostream & stream, const can::Frame & f);
} // namespace can

#endif // SOCKETCAN_INTERFACE__STRING_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__STRING_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#ifndef SOCKETCAN_INTERFACE__THREADING_HPP_
#define SOCKETCAN_INTERFACE__THREADING_HPP_

#include <boost/thread/thread.hpp>
#ifndef CLEARPATH_SOCKETCAN_INTERFACE__THREADING_HPP_
#define CLEARPATH_SOCKETCAN_INTERFACE__THREADING_HPP_

#include <memory>
#include <string>

#include <boost/thread/thread.hpp>

#include "clearpath_socketcan_interface/interface.hpp"

namespace can
Expand Down Expand Up @@ -119,4 +119,4 @@ class ThreadedInterface

} // namespace can

#endif // SOCKETCAN_INTERFACE__THREADING_HPP_
#endif // CLEARPATH_SOCKETCAN_INTERFACE__THREADING_HPP_
6 changes: 3 additions & 3 deletions clearpath_socketcan_interface/src/candump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see <https://www.gnu.org/licenses/>.

#include <boost/exception/diagnostic_information.hpp>
#include <pluginlib/class_loader.hpp>

#include <iostream>
#include <memory>
#include <unordered_set>
#include <string>

#include <boost/exception/diagnostic_information.hpp>
#include <pluginlib/class_loader.hpp>

#include "clearpath_socketcan_interface/socketcan.hpp"

void print_error(const can::State & s);
Expand Down
4 changes: 2 additions & 2 deletions clearpath_socketcan_interface/test/test_dispatcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@

#include <gtest/gtest.h>

#include <clearpath_socketcan_interface/dispatcher.hpp>

#include <vector>

#include <clearpath_socketcan_interface/dispatcher.hpp>

class Counter
{
public:
Expand Down
5 changes: 5 additions & 0 deletions dependencies.repos
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
repositories:
puma_motor_driver:
type: git
url: https://github.com/clearpathrobotics/puma_motor_driver
version: foxy-devel
Loading