From 89956a992af782ca140239723b37381c8638a3ad Mon Sep 17 00:00:00 2001 From: CoprDistGit Date: Sat, 8 Mar 2025 13:23:52 +0000 Subject: automatic import of ros-humble-microstrain-inertial-driver --- .gitignore | 1 + ...train-inertial-driver-fix_error_no_define.patch | 67 ++++++++++ microstrain-inertial-driver.spec | 135 +++++++++++++++++++++ sources | 1 + 4 files changed, 204 insertions(+) create mode 100644 microstrain-inertial-driver-fix_error_no_define.patch create mode 100644 microstrain-inertial-driver.spec create mode 100644 sources diff --git a/.gitignore b/.gitignore index e69de29..ace294b 100644 --- a/.gitignore +++ b/.gitignore @@ -0,0 +1 @@ +/ros-humble-microstrain-inertial-driver_3.0.1.orig.tar.gz diff --git a/microstrain-inertial-driver-fix_error_no_define.patch b/microstrain-inertial-driver-fix_error_no_define.patch new file mode 100644 index 0000000..72729ab --- /dev/null +++ b/microstrain-inertial-driver-fix_error_no_define.patch @@ -0,0 +1,67 @@ +diff -Naur ros-humble-microstrain-inertial-driver-3.0.1_org/microstrain_inertial_driver_common/include/microstrain_inertial_driver_common/services.h ros-humble-microstrain-inertial-driver-3.0.1/microstrain_inertial_driver_common/include/microstrain_inertial_driver_common/services.h +--- ros-humble-microstrain-inertial-driver-3.0.1_org/microstrain_inertial_driver_common/include/microstrain_inertial_driver_common/services.h 2023-02-11 05:19:58.000000000 +0800 ++++ ros-humble-microstrain-inertial-driver-3.0.1/microstrain_inertial_driver_common/include/microstrain_inertial_driver_common/services.h 2023-10-21 17:04:27.000000000 +0800 +@@ -172,7 +172,12 @@ + * \return Pointer to an initialized service + */ + template +- typename RosServiceType::SharedPtr configureService(const std::string& name, bool (Services::*callback)(typename ServiceType::Request&, typename ServiceType::Response&)); ++ typename RosServiceType::SharedPtr configureService(const std::string& name, bool (Services::*callback)(typename ServiceType::Request&, typename ServiceType::Response&)) ++{ ++ MICROSTRAIN_DEBUG(node_, "Configuring service %s", name.c_str()); ++ return createService(node_, name, callback, this); ++} ++ + + /** + * \brief Configures a MIP command dependent service. This service will only be configured if the device supports the command +@@ -184,7 +189,19 @@ + * \return Pointer to an initialized service, or nullptr if the device does not support the MipType + */ + template +- typename RosServiceType::SharedPtr configureService(const std::string& name, bool (Services::*callback)(typename ServiceType::Request&, typename ServiceType::Response&)); ++ typename RosServiceType::SharedPtr configureService(const std::string& name, bool (Services::*callback)(typename ServiceType::Request&, typename ServiceType::Response&)) ++{ ++ if (config_->mip_device_->supportsDescriptor(DescriptorSet, MipType::FIELD_DESCRIPTOR)) ++ { ++ MICROSTRAIN_DEBUG(node_, "Configuring service %s to execute MIP command 0x%02x%02x", name.c_str(), DescriptorSet, MipType::FIELD_DESCRIPTOR); ++ return createService(node_, name, callback, this); ++ } ++ else ++ { ++ MICROSTRAIN_DEBUG(node_, "Device does not support the %s service because the device does not support descriptor 0x%02x%02x", name.c_str(), DescriptorSet, MipType::FIELD_DESCRIPTOR); ++ return nullptr; ++ } ++} + + // Handles to the ROS node and the config + RosNodeType* node_; +@@ -253,27 +270,8 @@ + RosServiceType::SharedPtr set_filter_speed_lever_arm_service_; + }; + +-template +-typename RosServiceType::SharedPtr Services::configureService(const std::string& name, bool (Services::*callback)(typename ServiceType::Request&, typename ServiceType::Response&)) +-{ +- MICROSTRAIN_DEBUG(node_, "Configuring service %s", name.c_str()); +- return createService(node_, name, callback, this); +-} + +-template +-typename RosServiceType::SharedPtr Services::configureService(const std::string& name, bool (Services::*callback)(typename ServiceType::Request&, typename ServiceType::Response&)) +-{ +- if (config_->mip_device_->supportsDescriptor(DescriptorSet, MipType::FIELD_DESCRIPTOR)) +- { +- MICROSTRAIN_DEBUG(node_, "Configuring service %s to execute MIP command 0x%02x%02x", name.c_str(), DescriptorSet, MipType::FIELD_DESCRIPTOR); +- return createService(node_, name, callback, this); +- } +- else +- { +- MICROSTRAIN_DEBUG(node_, "Device does not support the %s service because the device does not support descriptor 0x%02x%02x", name.c_str(), DescriptorSet, MipType::FIELD_DESCRIPTOR); +- return nullptr; +- } +-} ++ + + } // namespace microstrain + diff --git a/microstrain-inertial-driver.spec b/microstrain-inertial-driver.spec new file mode 100644 index 0000000..9f097a1 --- /dev/null +++ b/microstrain-inertial-driver.spec @@ -0,0 +1,135 @@ +%bcond_without tests +%bcond_without weak_deps + +%global __os_install_post %(echo '%{__os_install_post}' | sed -e 's!/usr/lib[^[:space:]]*/brp-python-bytecompile[[:space:]].*$!!g') +%global __provides_exclude_from ^/opt/ros/%{ros_distro}/.*$ +%global __requires_exclude_from ^/opt/ros/%{ros_distro}/.*$ + +%define RosPkgName microstrain-inertial-driver +%define ros_distro humble + +Name: ros-%{ros_distro}-%{RosPkgName} +Version: 3.0.1 +Release: 2%{?dist}%{?release_suffix} +Summary: The ros_mscl package provides a driver for the LORD/Microstrain inertial products. + +Url: https://github.com/LORD-MicroStrain/microstrain_inertial +License: MIT +Source0: %{name}_%{version}.orig.tar.gz +Patch0: microstrain-inertial-driver-fix_error_no_define.patch + +Requires: ros-%{ros_distro}-diagnostic-updater +Requires: ros-%{ros_distro}-tf2 +Requires: ros-%{ros_distro}-tf2-ros +Requires: ros-%{ros_distro}-std-msgs +Requires: ros-%{ros_distro}-std-srvs +Requires: ros-%{ros_distro}-geometry-msgs +Requires: ros-%{ros_distro}-sensor-msgs +Requires: ros-%{ros_distro}-nav-msgs +Requires: ros-%{ros_distro}-nmea-msgs +Requires: ros-%{ros_distro}-mavros-msgs +Requires: ros-%{ros_distro}-microstrain-inertial-msgs +Requires: ros-%{ros_distro}-tf2-geometry-msgs +Requires: ros-%{ros_distro}-lifecycle-msgs +Requires: ros-%{ros_distro}-rosidl-default-runtime +Requires: ros-%{ros_distro}-rclcpp-lifecycle +Requires: ros-%{ros_distro}-diagnostic-aggregator +Requires: ros-%{ros_distro}-ros-workspace + +BuildRequires: ros-%{ros_distro}-diagnostic-updater +BuildRequires: ros-%{ros_distro}-tf2 +BuildRequires: ros-%{ros_distro}-tf2-ros +BuildRequires: ros-%{ros_distro}-std-msgs +BuildRequires: ros-%{ros_distro}-std-srvs +BuildRequires: ros-%{ros_distro}-geometry-msgs +BuildRequires: ros-%{ros_distro}-sensor-msgs +BuildRequires: ros-%{ros_distro}-nav-msgs +BuildRequires: ros-%{ros_distro}-nmea-msgs +BuildRequires: ros-%{ros_distro}-mavros-msgs +BuildRequires: ros-%{ros_distro}-microstrain-inertial-msgs +BuildRequires: ros-%{ros_distro}-tf2-geometry-msgs +BuildRequires: ros-%{ros_distro}-lifecycle-msgs +BuildRequires: ros-%{ros_distro}-ros-environment +BuildRequires: ros-%{ros_distro}-rclcpp-lifecycle +BuildRequires: jq +BuildRequires: curl +BuildRequires: git +BuildRequires: ros-%{ros_distro}-rosidl-default-generators +BuildRequires: ros-%{ros_distro}-ros-workspace + +%if 0%{?with_tests} +BuildRequires: ros-%{ros_distro}-ament-cpplint +BuildRequires: ros-%{ros_distro}-ament-cmake-gtest +%endif + +Provides: %{name}-devel = %{version}-%{release} +Provides: %{name}-doc = %{version}-%{release} +Provides: %{name}-runtime = %{version}-%{release} + +%description +The ros_mscl package provides a driver for the LORD/Microstrain inertial products. + +%prep +%autosetup -p1 + +%build +# Needed to bootstrap since the ros_workspace package does not yet exist. +export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages + +# In case we're installing to a non-standard location, look for a setup.sh +# in the install tree and source it. It will set things like +# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. +if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi +mkdir -p .obj-%{_target_platform} && cd .obj-%{_target_platform} +%cmake3 \ + -UINCLUDE_INSTALL_DIR \ + -ULIB_INSTALL_DIR \ + -USYSCONF_INSTALL_DIR \ + -USHARE_INSTALL_PREFIX \ + -ULIB_SUFFIX \ + -DCMAKE_INSTALL_PREFIX="/opt/ros/%{ros_distro}" \ + -DAMENT_PREFIX_PATH="/opt/ros/%{ros_distro}" \ + -DCMAKE_PREFIX_PATH="/opt/ros/%{ros_distro}" \ + -DSETUPTOOLS_DEB_LAYOUT=OFF \ +%if !0%{?with_tests} + -DBUILD_TESTING=OFF \ +%endif + .. + +%make_build + +%install +# Needed to bootstrap since the ros_workspace package does not yet exist. +export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages + +# In case we're installing to a non-standard location, look for a setup.sh +# in the install tree and source it. It will set things like +# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. +if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi +%make_install -C .obj-%{_target_platform} + +%if 0%{?with_tests} +%check +# Needed to bootstrap since the ros_workspace package does not yet exist. +export PYTHONPATH=/opt/ros/%{ros_distro}/lib/python%{python3_version}/site-packages + +# Look for a Makefile target with a name indicating that it runs tests +TEST_TARGET=$(%__make -qp -C .obj-%{_target_platform} | sed "s/^\(test\|check\):.*/\\1/;t f;d;:f;q0") +if [ -n "$TEST_TARGET" ]; then +# In case we're installing to a non-standard location, look for a setup.sh +# in the install tree and source it. It will set things like +# CMAKE_PREFIX_PATH, PKG_CONFIG_PATH, and PYTHONPATH. +if [ -f "/opt/ros/%{ros_distro}/setup.sh" ]; then . "/opt/ros/%{ros_distro}/setup.sh"; fi +CTEST_OUTPUT_ON_FAILURE=1 \ + %make_build -C .obj-%{_target_platform} $TEST_TARGET || echo "RPM TESTS FAILED" +else echo "RPM TESTS SKIPPED"; fi +%endif + +%files +/opt/ros/%{ros_distro} + +%changelog +* Thu Oct 30 2023 619409713@qq.com - 3.0.1-2 +- fix error not define by davidhan008 +* Thu May 04 2023 Rob Fisher rob.fisher@parker.com - 3.0.1-1 +- Autogenerated by ros-porting-tools diff --git a/sources b/sources new file mode 100644 index 0000000..d0e03e8 --- /dev/null +++ b/sources @@ -0,0 +1 @@ +0a1a72798922b23182ad723260fe956a ros-humble-microstrain-inertial-driver_3.0.1.orig.tar.gz -- cgit v1.2.3