diff --git a/README.md b/README.md index 60b86d9..456d4a5 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ output pins with `std_msgs` publishers and subscribers, respectively. [machinekit]: http://machinekit.io [ros2_control]: https://github.com/ros-controls/ros2_control - +[ros2_control_demos]:https://github.com/ros-controls/ros2_control_demos ## The `hal_hw_interface` real-time component The `hal_control_node` HAL component runs a @@ -64,11 +64,12 @@ start netting pins before the HAL components are loaded and ready. - A real-time kernel, either RT_PREEMPT or Xenomai - Required by Machinekit for low-latency control - See the `linux-image-rt-*` packages available in Debian Stretch. -- [`ros_control_boilerplate`][ros_control_boilerplate] +- [`ros2_control`][ros2_control] - Required by the `hal_hw_interface` - This may be installed in package form -- Optional: The `ros2_control_demos` repo +- Optional: The [`ros2_control_demos`][ros2_control_demos] repo - Required to run the `hal_rrbot_control` demo + - This may also be installed in package form - Follow the notes in that project's README to install ----- @@ -84,7 +85,7 @@ Run the simulated hardware interface: ros2 launch hal_rrbot_control rrbot.launch.py # Debugging: append `hal_debug_output:=1 hal_debug_level:=5` # Trajectory controller: append - # `robot_controller:=position_trajectory_controller` + # `robot_controller:=joint_trajectory_position_controller` Run `halscope` to visualize HAL joint commands and feedback; in the GUI, set the "Run Mode" to "Roll" for continuous updating: @@ -95,8 +96,8 @@ The simulated trajectories are launched directly from the `ros2_control_demo_bringup` package: ros2 launch ros2_control_demo_bringup test_forward_position_controller.launch.py - # Or for robot_controller:=position_trajectory_controller: - ros2 launch ros2_control_demo_bringup test_joint_trajectory_controller.launch.py + # Or for robot_controller:=joint_trajectory_position_controller: + ros2 launch ros2_control_demo_bringup test_joint_trajectory_position_controller.launch.py Load and switch to the trajectory controller at run time: @@ -104,19 +105,19 @@ Load and switch to the trajectory controller at run time: ros2 service call \ /controller_manager/load_and_configure_controller \ controller_manager_msgs/srv/LoadConfigureController \ - '{name: "position_trajectory_controller"}' + '{name: "joint_trajectory_position_controller"}' # Switch to the trajectory controller ros2 service call \ /controller_manager/switch_controller \ controller_manager_msgs/srv/SwitchController \ - '{start_controllers: ["position_trajectory_controller"], + '{start_controllers: ["joint_trajectory_position_controller"], stop_controllers: ["forward_position_controller"], strictness: 1, start_asap: true, timeout: {sec: 0, nanosec: 10000000} }' - # Verify the switch: 'position_trajectory_controller' state='active' + # Verify the switch: 'joint_trajectory_position_controller' state='active' ros2 service call \ /controller_manager/list_controllers \ controller_manager_msgs/srv/ListControllers diff --git a/hal_hw_interface/cmake/FindHAL.cmake b/hal_hw_interface/cmake/FindHAL.cmake index 19abcce..05f572c 100644 --- a/hal_hw_interface/cmake/FindHAL.cmake +++ b/hal_hw_interface/cmake/FindHAL.cmake @@ -24,8 +24,8 @@ set(MACHINEKIT_RIP_PATH # HAL_INCLUDE_PATH: Find HAL include directory find_path( - HAL_INCLUDE_PATH hal.h - PATH_SUFFIXES machinekit + HAL_INCLUDE_PATH hal/hal.h + PATH_SUFFIXES machinekit/hal PATHS ${MACHINEKIT_RIP_PATH}/include ) diff --git a/hal_hw_interface/hal_hw_interface/hal_mgr.py b/hal_hw_interface/hal_hw_interface/hal_mgr.py index cd36c8e..fe84895 100644 --- a/hal_hw_interface/hal_hw_interface/hal_mgr.py +++ b/hal_hw_interface/hal_hw_interface/hal_mgr.py @@ -1,6 +1,6 @@ import os import subprocess -from machinekit import config +#from machinekit import config from .ros_hal_component import RosHalComponent # ROS @@ -52,7 +52,7 @@ def start_realtime(self): env = dict( DEBUG=d_lev, SYSLOG_TO_STDERR=d_out, - MACHINEKIT_INI=config.Config().MACHINEKIT_INI, + MACHINEKIT_INI="/etc/machinekit/hal/machinekit.ini", FASTRTPS_DEFAULT_PROFILES_FILE=fastrtps_profiles, **os.environ, ) diff --git a/hal_hw_interface/hal_hw_interface/hal_pin_attrs.py b/hal_hw_interface/hal_hw_interface/hal_pin_attrs.py index b9ab3dd..3a2693c 100644 --- a/hal_hw_interface/hal_hw_interface/hal_pin_attrs.py +++ b/hal_hw_interface/hal_hw_interface/hal_pin_attrs.py @@ -1,4 +1,4 @@ -import hal +import machinekit.hal.pyhal as hal class HalPinAttrBase(int): diff --git a/hal_hw_interface/hal_hw_interface/launch/hal_ordered_action.py b/hal_hw_interface/hal_hw_interface/launch/hal_ordered_action.py index b0b1011..f5053f2 100644 --- a/hal_hw_interface/hal_hw_interface/launch/hal_ordered_action.py +++ b/hal_hw_interface/hal_hw_interface/launch/hal_ordered_action.py @@ -14,7 +14,7 @@ from launch_ros.actions import Node -from machinekit import rtapi +from machinekit.hal.cyruntime import rtapi from .hal_ready import HalReady diff --git a/hal_hw_interface/hal_hw_interface/launch/hal_rt_node.py b/hal_hw_interface/hal_hw_interface/launch/hal_rt_node.py index da64435..dbe62bb 100644 --- a/hal_hw_interface/hal_hw_interface/launch/hal_rt_node.py +++ b/hal_hw_interface/hal_hw_interface/launch/hal_rt_node.py @@ -6,7 +6,8 @@ from launch.substitutions import PathJoinSubstitution from launch_ros.substitutions import FindPackagePrefix -from machinekit import rtapi, hal +from machinekit.hal.cyruntime import rtapi +import machinekit.hal.cyhal as hal from .hal_ordered_action import HalOrderedNode, HalThreadedReadyAction diff --git a/hal_hw_interface/hal_hw_interface/launch/hal_user_node.py b/hal_hw_interface/hal_hw_interface/launch/hal_user_node.py index 8a37b3c..dd39f4b 100644 --- a/hal_hw_interface/hal_hw_interface/launch/hal_user_node.py +++ b/hal_hw_interface/hal_hw_interface/launch/hal_user_node.py @@ -1,5 +1,5 @@ import os -from machinekit import hal +import machinekit.hal.cyhal as hal from launch import logging from .hal_ordered_action import HalOrderedNode, HalAsyncReadyAction diff --git a/hal_hw_interface/hal_hw_interface/loadrt_local.py b/hal_hw_interface/hal_hw_interface/loadrt_local.py index c54b802..cf0fd63 100644 --- a/hal_hw_interface/hal_hw_interface/loadrt_local.py +++ b/hal_hw_interface/hal_hw_interface/loadrt_local.py @@ -1,7 +1,7 @@ import rclpy import os -from machinekit import rtapi, hal - +from machinekit.hal.cyruntime import rtapi +import machinekit.hal.pyhal as hal def loadrt_local(modname): """ diff --git a/hal_hw_interface/hal_hw_interface/ros_hal_component.py b/hal_hw_interface/hal_hw_interface/ros_hal_component.py index 1beb789..6de739c 100644 --- a/hal_hw_interface/hal_hw_interface/ros_hal_component.py +++ b/hal_hw_interface/hal_hw_interface/ros_hal_component.py @@ -5,7 +5,7 @@ """ import abc -import hal +import machinekit.hal.pyhal as hal import rclpy from .hal_obj_base import HalObjBase from .exception import HalHWInterfaceException diff --git a/hal_hw_interface/hal_hw_interface/tests/test_hal_pin_attrs.py b/hal_hw_interface/hal_hw_interface/tests/test_hal_pin_attrs.py index 5e82b3c..48585a8 100644 --- a/hal_hw_interface/hal_hw_interface/tests/test_hal_pin_attrs.py +++ b/hal_hw_interface/hal_hw_interface/tests/test_hal_pin_attrs.py @@ -1,5 +1,5 @@ import pytest -import hal +import machinekit.hal.pyhal as hal from hal_hw_interface.hal_pin_attrs import HalPinDir, HalPinType diff --git a/hal_hw_interface/include/hal_hw_interface/hal_ros_logging.hpp b/hal_hw_interface/include/hal_hw_interface/hal_ros_logging.hpp index f9270de..7127a1d 100644 --- a/hal_hw_interface/include/hal_hw_interface/hal_ros_logging.hpp +++ b/hal_hw_interface/include/hal_hw_interface/hal_ros_logging.hpp @@ -33,7 +33,7 @@ #define HAL_HW_INTERFACE__HAL_ROS_LOGGING_HPP_ // HAL -#include +#include // ROS #include diff --git a/hal_hw_interface/include/hal_hw_interface/hal_system_interface.hpp b/hal_hw_interface/include/hal_hw_interface/hal_system_interface.hpp index a3b2bb0..fba5b77 100644 --- a/hal_hw_interface/include/hal_hw_interface/hal_system_interface.hpp +++ b/hal_hw_interface/include/hal_hw_interface/hal_system_interface.hpp @@ -37,7 +37,7 @@ #endif // HAL -#include +#include #include #include diff --git a/hal_hw_interface/src/hal_control_node.cpp b/hal_hw_interface/src/hal_control_node.cpp index 9199a53..fc19716 100644 --- a/hal_hw_interface/src/hal_control_node.cpp +++ b/hal_hw_interface/src/hal_control_node.cpp @@ -32,7 +32,7 @@ #include #include // pthread_setname_np() #include // sleep() -#include // HAL public API decls +#include // HAL public API decls #include #include #include diff --git a/hal_hw_interface/src/hal_system_interface.cpp b/hal_hw_interface/src/hal_system_interface.cpp index 66fd44c..d8cd40e 100644 --- a/hal_hw_interface/src/hal_system_interface.cpp +++ b/hal_hw_interface/src/hal_system_interface.cpp @@ -32,8 +32,8 @@ // Disable warnings that need to be fixed in external headers #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wignored-qualifiers" -#include // HAL public API decls -#include // halpr_find_comp_by_name +#include // HAL public API decls +#include // halpr_find_comp_by_name #pragma GCC diagnostic pop #include