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

Humble v1.2.4 #103

Merged
merged 33 commits into from
Aug 9, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
eb6312c
removed robot name prefix from configs
mhubii Aug 7, 2023
4b21cc0
added empty frame prefixes for now
mhubii Aug 7, 2023
7173d47
1.2.3 -> 1.2.4
mhubii Aug 7, 2023
5217d9c
updated names in hw if
mhubii Aug 8, 2023
541d217
added initial pid version
mhubii Aug 8, 2023
234bd30
removed include
mhubii Aug 8, 2023
b45816a
added static executor
mhubii Aug 8, 2023
2f24039
changed rate to 100
mhubii Aug 8, 2023
de91e78
added utility draft
mhubii Aug 8, 2023
6b65b71
added a prefix
mhubii Aug 8, 2023
44147ec
finished utils draft
mhubii Aug 9, 2023
38230ef
finished utils draft
mhubii Aug 9, 2023
cd00107
added filters and pid to client
mhubii Aug 9, 2023
24bdd28
LBRCommandGuard -> CommandGuard
mhubii Aug 9, 2023
939daf0
LBRApp -> App
mhubii Aug 9, 2023
ee83aec
LBRClient -> Client
mhubii Aug 9, 2023
f992def
LBRAppComponent -> AppComponent
mhubii Aug 9, 2023
1975451
Better logging
mhubii Aug 9, 2023
8a7de5d
LBR_UTILS -> UTILS
mhubii Aug 9, 2023
a761776
smoohting -> alpha, uint -> double
mhubii Aug 9, 2023
3e6be0f
formatted
mhubii Aug 9, 2023
0432f5b
fixed int
mhubii Aug 9, 2023
d4a09c2
removed casts
mhubii Aug 9, 2023
66d915e
fixed namespaces
mhubii Aug 9, 2023
f01114e
amended node name to launch files
mhubii Aug 9, 2023
37f5c3d
updated doc
mhubii Aug 9, 2023
55f57e0
added documentation
mhubii Aug 9, 2023
f79a815
removed legacy param
mhubii Aug 9, 2023
64aa796
simplified app namespace
mhubii Aug 9, 2023
68d87fa
udpated doc
mhubii Aug 9, 2023
e298fe3
added namespace
mhubii Aug 9, 2023
cfff34d
tuned parameters
mhubii Aug 9, 2023
0fed98e
updated default
mhubii Aug 9, 2023
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
18 changes: 9 additions & 9 deletions lbr_bringup/config/config.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -67,47 +67,47 @@ Visualization Manager:
Expand Link Details: false
Expand Tree: false
Link Tree Style: Links in Alphabetic Order
lbr_link_0:
link_0:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
lbr_link_1:
link_1:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
lbr_link_2:
link_2:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
lbr_link_3:
link_3:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
lbr_link_4:
link_4:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
lbr_link_5:
link_5:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
lbr_link_6:
link_6:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
lbr_link_7:
link_7:
Alpha: 1
Show Axes: false
Show Trail: false
Value: true
lbr_link_ee:
link_ee:
Alpha: 1
Show Axes: false
Show Trail: false
Expand Down
6 changes: 3 additions & 3 deletions lbr_bringup/doc/lbr_bringup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,14 @@ Standalone launch is great for research. Only the the real robot is supported. I

.. code:: bash

ros2 launch lbr_fri_ros2 lbr_app.launch.py \
ros2 launch lbr_fri_ros2 app.launch.py \
model:=iiwa7 # [iiwa7, iiwa14, med7, med14] \
robot_name:=lbr # any robot name

This runs the :lbr_fri_ros2:`LBRAppComponentLBRApp <lbr_fri_ros2::LBRAppComponent>`, which creates 2 topics, ``/robot_name/command`` for commands and ``/robot_name/state``. See :ref:`LBR Demos FRI ROS 2` for more examples and :ref:`LBR FRI ROS 2` for more documentation.
This runs the :lbr_fri_ros2:`AppComponent <lbr_fri_ros2::AppComponent>`, which creates 2 topics, ``/robot_name/command`` for commands and ``/robot_name/state``. See :ref:`LBR Demos FRI ROS 2` for more examples and :ref:`LBR FRI ROS 2` for more documentation.

.. note::
For a list of available parameters, call ``ros2 launch lbr_fri_ros2 lbr_app.launch.py -s``.
For a list of available parameters, call ``ros2 launch lbr_fri_ros2 app.launch.py -s``.

Troubleshooting
---------------
Expand Down
2 changes: 1 addition & 1 deletion lbr_bringup/launch/real.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def launch_setup(context: LaunchContext) -> List[LaunchDescriptionEntity]:

# robot state publisher on joint state broadcaster spawn exit
robot_state_publisher = LBRHardwareInterfaceMixin.node_robot_state_publisher(
robot_description=robot_description
robot_description=robot_description, use_sim_time=False, frame_prefix=""
)
robot_state_publisher_event_handler = RegisterEventHandler(
OnProcessExit(
Expand Down
2 changes: 1 addition & 1 deletion lbr_bringup/launch/sim.launch.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def launch_setup(context: LaunchContext) -> List[LaunchDescriptionEntity]:
joint_state_broadcaster = LBRHardwareInterfaceMixin.node_joint_state_broadcaster()
ld.add_action(joint_state_broadcaster)
robot_state_publisher = LBRHardwareInterfaceMixin.node_robot_state_publisher(
robot_description=robot_description
robot_description=robot_description, use_sim_time=True, frame_prefix=""
)
ld.add_action(
robot_state_publisher
Expand Down
2 changes: 1 addition & 1 deletion lbr_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>lbr_bringup</name>
<version>1.2.3</version>
<version>1.2.4</version>
<description>LBR launch files.</description>
<maintainer email="[email protected]">mhubii</maintainer>
<license>MIT</license>
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_fri_ros2_advanced_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>lbr_demos_fri_ros2_advanced_cpp</name>
<version>1.2.3</version>
<version>1.2.4</version>
<description>Advanced C++ demos for the lbr_fri_ros2.</description>
<maintainer email="[email protected]">mhubii</maintainer>
<license>MIT</license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

#include "lbr_fri_msgs/msg/lbr_command.hpp"
#include "lbr_fri_msgs/msg/lbr_state.hpp"
#include "lbr_fri_ros2/lbr_app.hpp"
#include "lbr_fri_ros2/app.hpp"

#include "admittance_controller.hpp"
#include "damped_least_squares.hpp"
Expand All @@ -14,8 +14,8 @@ class AdmittanceControlNode : public rclcpp::Node {
AdmittanceControlNode(const std::string &node_name, const rclcpp::NodeOptions &options)
: rclcpp::Node(node_name, options) {
this->declare_parameter<std::string>("robot_description");
this->declare_parameter<std::string>("base_link", "lbr_link_0");
this->declare_parameter<std::string>("end_effector_link", "lbr_link_ee");
this->declare_parameter<std::string>("base_link", "link_0");
this->declare_parameter<std::string>("end_effector_link", "link_ee");

admittance_controller_ = std::make_unique<AdmittanceController>(
this->get_parameter("robot_description").as_string(),
Expand Down Expand Up @@ -75,15 +75,15 @@ int main(int argc, char **argv) {

auto executor = std::make_shared<rclcpp::executors::StaticSingleThreadedExecutor>();

auto lbr_node =
std::make_shared<rclcpp::Node>("lbr", rclcpp::NodeOptions().use_intra_process_comms(true));
auto app_node = std::make_shared<rclcpp::Node>(
"app", "lbr", rclcpp::NodeOptions().use_intra_process_comms(true));

auto lbr_app = lbr_fri_ros2::LBRApp(lbr_node);
auto app = lbr_fri_ros2::App(app_node);

auto admittance_control_node = std::make_shared<AdmittanceControlNode>(
"admittance_control_node", rclcpp::NodeOptions().use_intra_process_comms(true));

executor->add_node(lbr_node);
executor->add_node(app_node);
executor->add_node(admittance_control_node);
executor->spin();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class AdmittanceController {

public:
AdmittanceController(const std::string &robot_description,
const std::string &base_link = "lbr_link_0",
const std::string &end_effector_link = "lbr_link_ee",
const CartesianVector &f_ext_th = {2., 2., 2., 0.5, 0.5, 0.5},
const JointVector &dq_gains = {2.0, 2.0, 2.0, 2.0, 2.0, 2.0, 2.0},
const std::string &base_link = "link_0",
const std::string &end_effector_link = "link_ee",
const CartesianVector &f_ext_th = {4., 4., 4., 0.5, 0.5, 0.5},
const JointVector &dq_gains = {1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0},
const CartesianVector &dx_gains = {1.5, 1.5, 1.5, 20., 40., 60.})
: dq_gains_(dq_gains), dx_gains_(dx_gains), f_ext_th_(f_ext_th) {
if (!kdl_parser::treeFromString(robot_description, tree_)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Admittance Controller

.. code-block:: bash

ros2 launch lbr_fri_ros2 lbr_app.launch.py model:=iiwa7 # [iiwa7, iiwa14, med7, med14]
ros2 launch lbr_fri_ros2 app.launch.py model:=iiwa7 # [iiwa7, iiwa14, med7, med14]

#. Run the `admittance_control_node <https://github.com/lbr-stack/lbr_fri_ros2_stack/blob/humble/lbr_demos/lbr_demos_fri_ros2_advanced_python/lbr_demos_fri_ros2_advanced_python/admittance_control_node.py>`_:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ def __init__(self, node_name="admittance_control_node") -> None:

# parameters
self.declare_parameter("robot_description", "")
self.declare_parameter("base_link", "lbr_link_0")
self.declare_parameter("end_effector_link", "lbr_link_ee")
self.declare_parameter("base_link", "link_0")
self.declare_parameter("end_effector_link", "link_ee")

self.init_ = False
self.lbr_state_ = LBRState()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ class AdmittanceController(object):
def __init__(
self,
robot_description: str,
base_link: str = "lbr_link_0",
end_effector_link: str = "lbr_link_ee",
base_link: str = "link_0",
end_effector_link: str = "link_ee",
f_ext_th: np.ndarray = np.array([2.0, 2.0, 2.0, 0.5, 0.5, 0.5]),
dq_gain: np.ndarray = np.array([1.5, 1.5, 1.5, 1.5, 1.5, 1.5, 1.5]),
dx_gain: np.ndarray = np.array([1.0, 1.0, 1.0, 20.0, 40.0, 60.0]),
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_fri_ros2_advanced_python/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>lbr_demos_fri_ros2_advanced_python</name>
<version>1.2.3</version>
<version>1.2.4</version>
<description>Advanced Python demos for the lbr_fri_ros2.</description>
<maintainer email="[email protected]">mhubii</maintainer>
<license>MIT</license>
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_fri_ros2_advanced_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name=package_name,
version="1.2.3",
version="1.2.4",
packages=[package_name],
data_files=[
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ def generate_launch_description() -> LaunchDescription:
ld.add_action(LBRDescriptionMixin.arg_robot_name())
robot_description = LBRDescriptionMixin.param_robot_description(sim=False)
ld.add_action(
LBRFRIROS2Mixin.node_lbr_app(
LBRFRIROS2Mixin.node_app(
parameters=[
robot_description,
LBRDescriptionMixin.param_robot_name(),
]
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ def generate_launch_description() -> LaunchDescription:
ld.add_action(LBRDescriptionMixin.arg_robot_name())
robot_description = LBRDescriptionMixin.param_robot_description(sim=False)
ld.add_action(
LBRFRIROS2Mixin.node_lbr_app(
LBRFRIROS2Mixin.node_app(
parameters=[
robot_description,
LBRDescriptionMixin.param_robot_name(),
]
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ def generate_launch_description() -> LaunchDescription:
ld.add_action(LBRDescriptionMixin.arg_robot_name())
robot_description = LBRDescriptionMixin.param_robot_description(sim=False)
ld.add_action(
LBRFRIROS2Mixin.node_lbr_app(
LBRFRIROS2Mixin.node_app(
parameters=[
robot_description,
LBRDescriptionMixin.param_robot_name(),
]
)
)
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_fri_ros2_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>lbr_demos_fri_ros2_cpp</name>
<version>1.2.3</version>
<version>1.2.4</version>
<description>C++ demos for the lbr_fri_ros2.</description>
<maintainer email="[email protected]">mhubii</maintainer>
<license>MIT</license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ def generate_launch_description() -> LaunchDescription:
ld.add_action(LBRDescriptionMixin.arg_robot_name())
robot_description = LBRDescriptionMixin.param_robot_description(sim=False)
ld.add_action(
LBRFRIROS2Mixin.node_lbr_app(
LBRFRIROS2Mixin.node_app(
parameters=[
robot_description,
LBRDescriptionMixin.param_robot_name(),
]
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ def generate_launch_description() -> LaunchDescription:
ld.add_action(LBRDescriptionMixin.arg_robot_name())
robot_description = LBRDescriptionMixin.param_robot_description(sim=False)
ld.add_action(
LBRFRIROS2Mixin.node_lbr_app(
LBRFRIROS2Mixin.node_app(
parameters=[
robot_description,
LBRDescriptionMixin.param_robot_name(),
]
)
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ def generate_launch_description() -> LaunchDescription:
ld.add_action(LBRDescriptionMixin.arg_robot_name())
robot_description = LBRDescriptionMixin.param_robot_description(sim=False)
ld.add_action(
LBRFRIROS2Mixin.node_lbr_app(
LBRFRIROS2Mixin.node_app(
parameters=[
robot_description,
LBRDescriptionMixin.param_robot_name(),
]
)
)
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_fri_ros2_python/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>lbr_demos_fri_ros2_python</name>
<version>1.2.3</version>
<version>1.2.4</version>
<description>Python demos for the lbr_fri_ros2.</description>
<maintainer email="[email protected]">mhubii</maintainer>
<license>MIT</license>
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_fri_ros2_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

setup(
name=package_name,
version="1.2.3",
version="1.2.4",
packages=[package_name],
data_files=[
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_ros2_control_cpp/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>lbr_demos_ros2_control_cpp</name>
<version>1.2.3</version>
<version>1.2.4</version>
<description>C++ demos for the LBR ros2_control integration.</description>
<maintainer email="[email protected]">mhubii</maintainer>
<license>MIT</license>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@

class LBRJointTrajectoryExecutionerNode : public rclcpp::Node {
public:
LBRJointTrajectoryExecutionerNode(const std::string &node_name,
const std::string &robot_name = "lbr")
: Node(node_name), robot_name_(robot_name) {
LBRJointTrajectoryExecutionerNode(const std::string &node_name) : Node(node_name) {

joint_trajectory_action_client_ =
rclcpp_action::create_client<control_msgs::action::FollowJointTrajectory>(
Expand Down Expand Up @@ -43,8 +41,7 @@ class LBRJointTrajectoryExecutionerNode : public rclcpp::Node {
point.time_from_start.sec = sec_from_start;

for (std::size_t i = 0; i < KUKA::FRI::LBRState::NUMBER_OF_JOINTS; ++i) {
joint_trajectory_goal.trajectory.joint_names.push_back(robot_name_ + "_A" +
std::to_string(i + 1));
joint_trajectory_goal.trajectory.joint_names.push_back("A" + std::to_string(i + 1));
}

joint_trajectory_goal.trajectory.points.push_back(point);
Expand All @@ -71,7 +68,6 @@ class LBRJointTrajectoryExecutionerNode : public rclcpp::Node {
}

protected:
std::string robot_name_;
rclcpp_action::Client<control_msgs::action::FollowJointTrajectory>::SharedPtr
joint_trajectory_action_client_;
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ class LBRJointTrajectoryExecutionerNode(Node):
def __init__(
self,
node_name: str,
robot_name: str = "lbr",
) -> None:
super().__init__(node_name=node_name)
self.robot_name_ = robot_name
self.joint_trajectory_action_client_ = ActionClient(
node=self,
action_type=FollowJointTrajectory,
Expand All @@ -38,9 +36,7 @@ def execute(self, positions: list, sec_from_start: int = 10):
point.time_from_start.sec = sec_from_start

for i in range(7):
joint_trajectory_goal.trajectory.joint_names.append(
f"{self.robot_name_}_A{i + 1}"
)
joint_trajectory_goal.trajectory.joint_names.append(f"A{i + 1}")

joint_trajectory_goal.trajectory.points.append(point)

Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_ros2_control_python/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
<name>lbr_demos_ros2_control_python</name>
<version>1.2.3</version>
<version>1.2.4</version>
<description>Python demos for the LBR ros2_control integration.</description>
<maintainer email="[email protected]">mhubii</maintainer>
<license>MIT</license>
Expand Down
2 changes: 1 addition & 1 deletion lbr_demos/lbr_demos_ros2_control_python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

setup(
name=package_name,
version="1.2.3",
version="1.2.4",
packages=[package_name],
data_files=[
("share/ament_index/resource_index/packages", ["resource/" + package_name]),
Expand Down
Loading