Skip to content

Commit

Permalink
Reaname all the pkgs and most of the files
Browse files Browse the repository at this point in the history
  • Loading branch information
rafal-gorecki committed Sep 24, 2024
1 parent 2965cf0 commit bf3c289
Show file tree
Hide file tree
Showing 339 changed files with 2,069 additions and 1,989 deletions.
4 changes: 0 additions & 4 deletions .docs/panther_ros2_api.drawio.svg

This file was deleted.

4 changes: 4 additions & 0 deletions .docs/ros2_system_design.drawio.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion .github/workflows/release-project.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Release Panther project
name: Release project

on:
workflow_dispatch:
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/run-unit-tests.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
name: Run panther unit tests
name: Run unit tests

on:
workflow_dispatch:
Expand Down Expand Up @@ -28,12 +28,12 @@ jobs:
uses: actions/checkout@v3
with:
ref: ${{ github.ref }}
path: ros2_ws/src/panther_ros
path: ros2_ws/src/husarion_ugv

- name: Resolve dependencies
working-directory: ros2_ws
run: |
vcs import < src/panther_ros/panther/panther_hardware.repos src
vcs import < src/husarion_ugv/husarion_ugv/hardware_deps.repos src
sudo apt update
rosdep update --rosdistro $ROS_DISTRO
rosdep install -i --from-path src --rosdistro $ROS_DISTRO -y
Expand All @@ -43,15 +43,15 @@ jobs:
run: |
source /opt/ros/$ROS_DISTRO/setup.bash
if [ -f install/setup.bash ]; then source install/setup.bash; fi
colcon build --symlink-install --parallel-workers $(nproc) --packages-up-to panther --cmake-args -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage'
colcon build --symlink-install --parallel-workers $(nproc) --packages-up-to husarion_ugv --cmake-args -DCMAKE_CXX_FLAGS='-fprofile-arcs -ftest-coverage'
- name: Test
working-directory: ros2_ws
run: |
source install/setup.bash
colcon test --packages-up-to panther --retest-until-pass 10 --event-handlers console_cohesion+ --return-code-on-test-failure
colcon test --packages-up-to husarion_ugv --retest-until-pass 10 --event-handlers console_cohesion+ --return-code-on-test-failure
echo "result=$?" >> ${{ runner.temp }}/${{ env.TEST_RESULT_FILENAME }}
colcon lcov-result --packages-up-to panther --verbose >> ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }}
colcon lcov-result --packages-up-to husarion_ugv --verbose >> ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }}
lines_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'lines' | head -1)
functions_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'functions' | head -1)
branches_cov=$(cat ${{ runner.temp }}/${{ env.COVERAGE_RESULT_FILENAME }} | grep -E 'branches' | head -1)
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ repos:
entry: codespell
args:
[
"--exclude-file=panther_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds",
"--exclude-file=husarion_ugv_hardware_interfaces/config/roboteq_motor_controllers_v80_21a.eds",
"--ignore-words-list",
"ned" # north, east, down (NED)
]
Expand Down
38 changes: 19 additions & 19 deletions README.md

Large diffs are not rendered by default.

34 changes: 17 additions & 17 deletions ROS_API.md

Large diffs are not rendered by default.

File renamed without changes.
2 changes: 1 addition & 1 deletion panther/CMakeLists.txt → husarion_ugv/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.10.2)
project(panther)
project(husarion_ugv)

find_package(ament_cmake REQUIRED)

Expand Down
3 changes: 3 additions & 0 deletions husarion_ugv/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# husarion_ugv

ROS 2 Metapackage composing basic functionalities of the Husarion UGV robot with VCS Tool yaml files directing to external robot dependencies.
File renamed without changes.
8 changes: 4 additions & 4 deletions panther/package.xml → husarion_ugv/package.xml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>panther</name>
<name>husarion_ugv</name>
<version>2.1.1</version>
<description>Meta package that contains all packages of Panther</description>
<description>Meta package that contains all packages of Husarion UGV (Unmanned Ground Vehicle)</description>
<maintainer email="[email protected]">Husarion</maintainer>
<license>Apache License 2.0</license>

Expand All @@ -15,8 +15,8 @@

<buildtool_depend>ament_cmake</buildtool_depend>

<depend>panther_bringup</depend>
<depend condition="$HUSARION_ROS_BUILD_TYPE == simulation">panther_gazebo</depend>
<depend>husarion_ugv_bringup</depend>
<depend condition="$HUSARION_ROS_BUILD_TYPE == simulation">husarion_ugv_gazebo</depend>

<export>
<build_type>ament_cmake</build_type>
Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
cmake_minimum_required(VERSION 3.10.2)
project(panther_battery)
project(husarion_ugv_battery)

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

set(PACKAGE_DEPENDENCIES ament_cmake diagnostic_updater panther_msgs
panther_utils rclcpp sensor_msgs)
husarion_ugv_utils rclcpp sensor_msgs)

foreach(PACKAGE IN ITEMS ${PACKAGE_DEPENDENCIES})
find_package(${PACKAGE} REQUIRED)
endforeach()

include_directories(include ${panther_utils_INCLUDE_DIRS})
include_directories(include ${husarion_ugv_utils_INCLUDE_DIRS})

add_executable(
battery_driver_node
Expand Down
18 changes: 9 additions & 9 deletions panther_battery/README.md → husarion_ugv_battery/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# panther_battery
# husarion_ugv_battery

The package containing nodes monitoring and publishing the internal battery state of the Husarion Panther robot.
The package containing nodes monitoring and publishing the internal battery state of the Husarion UGV robots.

## Launch Files

Expand All @@ -12,13 +12,13 @@ This package contains:

### battery_driver_node

Publishes battery state read from ADC unit for Panther version 1.2 and above, or based on Roboteq motor controllers' data for earlier.versions of the robot.
Publishes battery state read from ADC unit.

#### Publishes

- `_battery/battery_1_status_raw` [*sensor_msgs/BatteryState*]: First battery raw state.
- `_battery/battery_2_status_raw` [*sensor_msgs/BatteryState*]: Second battery raw state. Published if second battery detected.
- `battery/battery_status` [*sensor_msgs/BatteryState*]: Mean values of both batteries if Panther has two batteries. Otherwise, the state of the single battery will be published.
- `battery/battery_status` [*sensor_msgs/BatteryState*]: Mean values of both batteries if robot has two batteries. Otherwise, the state of the single battery will be published.
- `battery/charging_status` [*panther_msgs/ChargingStatus*]: Battery charging status.
- `diagnostics` [*diagnostic_msgs/DiagnosticArray*]: Battery diagnostic messages.

Expand All @@ -29,11 +29,11 @@ Publishes battery state read from ADC unit for Panther version 1.2 and above, or

#### Parameters

- `~/adc/device0` [*string*, default: **/sys/bus/iio/devices/iio:device0**]: ADC nr 0 IIO device. Used with Panther version 1.2 and above.
- `~/adc/device1` [*string*, default: **/sys/bus/iio/devices/iio:device1**]: ADC nr 1 IIO device. Used with Panther version 1.2 and above.
- `~/adc/ma_window_len/charge` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery charge readings. Used with Panther version 1.2 and above.
- `~/adc/ma_window_len/temp` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery temperature readings. Used with Panther version 1.2 and above.
- `~/adc/device0` [*string*, default: **/sys/bus/iio/devices/iio:device0**]: ADC number 0 IIO device.
- `~/adc/device1` [*string*, default: **/sys/bus/iio/devices/iio:device1**]: ADC number 1 IIO device.
- `~/adc/ma_window_len/charge` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery charge readings.
- `~/adc/ma_window_len/temp` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery temperature readings.
- `~/battery_timeout` [*float*, default: **1.0**]: Specifies the timeout in seconds. If the node fails to read battery data exceeding this duration, the node will publish an unknown battery state.
- `~/ma_window_len/voltage` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery voltage readings.
- `~/ma_window_len/current` [*int*, default: **10**]: Window length of a moving average, used to smooth out battery current readings.
- `~/roboteq/driver_state_timeout` [*float*, default: **0.2**]: Specifies timeout in seconds after which driver state messages will be considered old. Used with Panther version 1.06 and earlier.
- `~/roboteq/driver_state_timeout` [*float*, default: **0.2**]: Specifies timeout in seconds after which driver state messages will be considered old (deprecated).
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,15 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PANTHER_BATTERY_ADC_DATA_READER_HPP_
#define PANTHER_BATTERY_ADC_DATA_READER_HPP_
#ifndef HUSARION_UGV_BATTERY_ADC_DATA_READER_HPP_
#define HUSARION_UGV_BATTERY_ADC_DATA_READER_HPP_

#include <filesystem>
#include <fstream>
#include <stdexcept>
#include <string>

namespace panther_battery
namespace husarion_ugv_battery
{

class ADCDataReader
Expand Down Expand Up @@ -75,6 +75,6 @@ class ADCDataReader
const std::filesystem::path device_path_;
};

} // namespace panther_battery
} // namespace husarion_ugv_battery

#endif // PANTHER_BATTERY_ADC_DATA_READER_HPP_
#endif // HUSARION_UGV_BATTERY_ADC_DATA_READER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PANTHER_BATTERY_BATTERY_ADC_BATTERY_HPP_
#define PANTHER_BATTERY_BATTERY_ADC_BATTERY_HPP_
#ifndef HUSARION_UGV_BATTERY_BATTERY_ADC_BATTERY_HPP_
#define HUSARION_UGV_BATTERY_BATTERY_ADC_BATTERY_HPP_

#include <cstdint>
#include <functional>
#include <memory>

#include "rclcpp/rclcpp.hpp"

#include "panther_battery/battery/battery.hpp"
#include "panther_utils/moving_average.hpp"
#include "husarion_ugv_battery/battery/battery.hpp"
#include "husarion_ugv_utils/moving_average.hpp"

namespace panther_battery
namespace husarion_ugv_battery
{

using BatteryStateMsg = sensor_msgs::msg::BatteryState;
Expand Down Expand Up @@ -89,12 +89,12 @@ class ADCBattery : public Battery
const std::function<float()> ReadTemp;
const std::function<float()> ReadCharge;

std::unique_ptr<panther_utils::MovingAverage<float>> voltage_ma_;
std::unique_ptr<panther_utils::MovingAverage<float>> current_ma_;
std::unique_ptr<panther_utils::MovingAverage<float>> temp_ma_;
std::unique_ptr<panther_utils::MovingAverage<float>> charge_ma_;
std::unique_ptr<husarion_ugv_utils::MovingAverage<float>> voltage_ma_;
std::unique_ptr<husarion_ugv_utils::MovingAverage<float>> current_ma_;
std::unique_ptr<husarion_ugv_utils::MovingAverage<float>> temp_ma_;
std::unique_ptr<husarion_ugv_utils::MovingAverage<float>> charge_ma_;
};

} // namespace panther_battery
} // namespace husarion_ugv_battery

#endif // PANTHER_BATTERY_BATTERY_ADC_BATTERY_HPP_
#endif // HUSARION_UGV_BATTERY_BATTERY_ADC_BATTERY_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PANTHER_BATTERY_BATTERY_BATTERY_HPP_
#define PANTHER_BATTERY_BATTERY_BATTERY_HPP_
#ifndef HUSARION_UGV_BATTERY_BATTERY_BATTERY_HPP_
#define HUSARION_UGV_BATTERY_BATTERY_BATTERY_HPP_

#include <algorithm>
#include <limits>
Expand All @@ -27,7 +27,7 @@

#include "panther_msgs/msg/charging_status.hpp"

namespace panther_battery
namespace husarion_ugv_battery
{

using BatteryStateMsg = sensor_msgs::msg::BatteryState;
Expand Down Expand Up @@ -127,6 +127,6 @@ class Battery
ChargingStatusMsg charging_status_;
};

} // namespace panther_battery
} // namespace husarion_ugv_battery

#endif // PANTHER_BATTERY_BATTERY_BATTERY_HPP_
#endif // HUSARION_UGV_BATTERY_BATTERY_BATTERY_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PANTHER_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_
#define PANTHER_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_
#ifndef HUSARION_UGV_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_
#define HUSARION_UGV_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_

#include <cstdint>
#include <functional>
Expand All @@ -24,10 +24,10 @@
#include "panther_msgs/msg/driver_state_named.hpp"
#include "panther_msgs/msg/robot_driver_state.hpp"

#include "panther_battery/battery/battery.hpp"
#include "panther_utils/moving_average.hpp"
#include "husarion_ugv_battery/battery/battery.hpp"
#include "husarion_ugv_utils/moving_average.hpp"

namespace panther_battery
namespace husarion_ugv_battery
{

using RobotDriverStateMsg = panther_msgs::msg::RobotDriverState;
Expand Down Expand Up @@ -73,10 +73,10 @@ class RoboteqBattery : public Battery
float current_raw_;
RobotDriverStateMsg::SharedPtr driver_state_;

std::unique_ptr<panther_utils::MovingAverage<float>> voltage_ma_;
std::unique_ptr<panther_utils::MovingAverage<float>> current_ma_;
std::unique_ptr<husarion_ugv_utils::MovingAverage<float>> voltage_ma_;
std::unique_ptr<husarion_ugv_utils::MovingAverage<float>> current_ma_;
};

} // namespace panther_battery
} // namespace husarion_ugv_battery

#endif // PANTHER_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_
#endif // HUSARION_UGV_BATTERY_BATTERY_ROBOTEQ_BATTERY_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PANTHER_BATTERY_BATTERY_DRIVER_NODE_HPP_
#define PANTHER_BATTERY_BATTERY_DRIVER_NODE_HPP_
#ifndef HUSARION_UGV_BATTERY_BATTERY_DRIVER_NODE_HPP_
#define HUSARION_UGV_BATTERY_BATTERY_DRIVER_NODE_HPP_

#include <memory>
#include <string>
Expand All @@ -23,11 +23,11 @@

#include "panther_msgs/msg/robot_driver_state.hpp"

#include "panther_battery/adc_data_reader.hpp"
#include "panther_battery/battery/battery.hpp"
#include "panther_battery/battery_publisher/battery_publisher.hpp"
#include "husarion_ugv_battery/adc_data_reader.hpp"
#include "husarion_ugv_battery/battery/battery.hpp"
#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp"

namespace panther_battery
namespace husarion_ugv_battery
{

using RobotDriverStateMsg = panther_msgs::msg::RobotDriverState;
Expand Down Expand Up @@ -60,6 +60,6 @@ class BatteryDriverNode : public rclcpp::Node
std::shared_ptr<diagnostic_updater::Updater> diagnostic_updater_;
};

} // namespace panther_battery
} // namespace husarion_ugv_battery

#endif // PANTHER_BATTERY_BATTERY_DRIVER_NODE_HPP_
#endif // HUSARION_UGV_BATTERY_BATTERY_DRIVER_NODE_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PANTHER_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_
#define PANTHER_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_
#ifndef HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_
#define HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_

#include <memory>

Expand All @@ -25,7 +25,7 @@
#include "panther_msgs/msg/charging_status.hpp"
#include "panther_msgs/msg/io_state.hpp"

namespace panther_battery
namespace husarion_ugv_battery
{

using BatteryStateMsg = sensor_msgs::msg::BatteryState;
Expand Down Expand Up @@ -71,6 +71,6 @@ class BatteryPublisher
rclcpp::Subscription<IOStateMsg>::SharedPtr io_state_sub_;
};

} // namespace panther_battery
} // namespace husarion_ugv_battery

#endif // PANTHER_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_
#endif // HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_BATTERY_PUBLISHER_HPP_
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,18 @@
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef PANTHER_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_
#define PANTHER_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_
#ifndef HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_
#define HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_

#include <cstdint>
#include <memory>

#include "rclcpp/rclcpp.hpp"

#include "panther_battery/battery/battery.hpp"
#include "panther_battery/battery_publisher/battery_publisher.hpp"
#include "husarion_ugv_battery/battery/battery.hpp"
#include "husarion_ugv_battery/battery_publisher/battery_publisher.hpp"

namespace panther_battery
namespace husarion_ugv_battery
{

class DualBatteryPublisher : public BatteryPublisher
Expand Down Expand Up @@ -66,6 +66,6 @@ class DualBatteryPublisher : public BatteryPublisher
rclcpp::Publisher<ChargingStatusMsg>::SharedPtr charging_status_pub_;
};

} // namespace panther_battery
} // namespace husarion_ugv_battery

#endif // PANTHER_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_
#endif // HUSARION_UGV_BATTERY_BATTERY_PUBLISHER_DUAL_BATTERY_PUBLISHER_HPP_
Loading

0 comments on commit bf3c289

Please sign in to comment.