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

Make the package self contained by removing dependencies on #2

Merged
merged 5 commits into from
Aug 30, 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
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"workspaceFolder": "/workspace/src/lbrmed-ros",
// Source the ROS workspace, the ${containerWorkspaceFolder} variable only gets replaced in this .json
// Install dependencies for workspace except Gazebo packages as the OSRF version is installed
"postCreateCommand": "echo 'source /opt/ros/${ROS_DISTRO}/setup.bash' >> ${HOME}/.bashrc && echo 'source ${containerWorkspaceFolder}/devel/setup.bash' >> ${HOME}/.bashrc && /bin/sh .devcontainer/postCreate.sh",
"postCreateCommand": "echo 'source /opt/ros/${ROS_DISTRO}/setup.bash' >> ${HOME}/.bashrc && echo 'source /workspace/devel/setup.bash' >> ${HOME}/.bashrc && /bin/sh .devcontainer/postCreate.sh",
"customizations": {
"vscode": {
"extensions": [
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,3 @@ jobs:
ROS_DISTRO: noetic
CATKIN_LINT: true
CATKIN_LINT_ARGS: -W2
UPSTREAM_WORKSPACE: .rosinstall
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
.catkin_tools
.vscode
8 changes: 0 additions & 8 deletions .rosinstall

This file was deleted.

3 changes: 3 additions & 0 deletions .vscode/copyright_template.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
@license BSD-3 https://opensource.org/licenses/BSD-3-Clause
Copyright (c) $CURRENT_YEAR, Institute of Automatic Control - RWTH Aachen University
All rights reserved.
70 changes: 70 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
/* Copyright (c) 2020, Institute of Automatic Control - RWTH Aachen University
All rights reserved. */
{
"version": "2.0.0",
"tasks": [
{
"label": "merge compile_commands.json",
"type": "shell",
"command": "cd /workspace && jq -s 'map(.[])' /workspace/build/**/compile_commands.json > /workspace/build/compile_commands.json",
"group": "none",
"problemMatcher": "$catkin-gcc"
},
{
"label": "catkin build workspace",
"type": "shell",
"command": "cd /workspace && catkin build && jq -s 'map(.[])' /workspace/build/**/compile_commands.json > /workspace/build/compile_commands.json",
"group": {
"kind": "build",
"isDefault": true
},
"problemMatcher": [
"$catkin-gcc"
]
},
{
"label": "catkin build package",
"type": "shell",
"command": "cd ${fileDirname} && catkin build --this --workspace /workspace && jq -s 'map(.[])' /workspace/build/**/compile_commands.json > /workspace/build/compile_commands.json",
"problemMatcher": [
"$catkin-gcc"
]
},
{
"label": "catkin test current",
"type": "shell",
"command": "cd ${fileDirname} && catkin build --this --workspace /workspace --cmake-args -DCMAKE_BUILD_TYPE=Debug && catkin test --no-deps --this --verbose",
"group": {
"kind": "test",
"isDefault": true
},
"problemMatcher": [
"$msCompile"
]
},
{
"label": "catkin config debug",
"type": "shell",
"command": "cd /workspace && catkin config -j $(($(nproc)-1)) --cmake-args -DCMAKE_BUILD_TYPE=Debug -DCMAKE_EXPORT_COMPILE_COMMANDS=1",
"problemMatcher": [
"$msCompile"
]
},
{
"label": "catkin config release",
"type": "shell",
"command": "cd /workspace && catkin config -j $(($(nproc)-1)) --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=1",
"problemMatcher": [
"$msCompile"
]
},
{
"label": "catkin clean",
"type": "shell",
"command": "cd /workspace && catkin clean --yes",
"problemMatcher": [
"$msCompile"
]
}
]
}
7 changes: 3 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Please look at the READMEs in the specific hardware packages.
* No need to patch a kernel as we do not use kernel interrupts only the standard `ros_control` loop.
* You might observe connectivity errors if you launch additional loads, e.g. RViz, or use a network switch.
* We provide a **development container**, so you can start without manually installing any dependencies.
* For custom setups, **only ROS tools** like `wstool` / `vcs` and `rosdep` are required to install dependencies.
* Otherwise, this package is simple to set up without manual steps using `wstool` / `vcs` and `rosdep`.
* We built collision and visualization meshes for the LBR Med with internal electric connectors.

# Install
Expand Down Expand Up @@ -53,12 +53,11 @@ For the Sunrise Project you have two ways to proceed:
### Installing Dependencies
In the catkin workspace, run the following commands to install all workspace and system dependencies.
```bash
wstool init src
wstool merge -t src src/lbrmed-ros/.rosinstall
wstool update -t src
rosdep install --from-paths src --ignore-src -r -y
```

If you want to use the [FZI Cartesian controllers](https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers), you can find the installation steps in the `lbrmed_control` [README](./lbrmed_control/README.md).

### Building the workspace
To build the packages in parallel, we use the [catkin_tools](https://catkin-tools.readthedocs.io/en/latest/installing.html). After installing them, run:
```bash
Expand Down
2 changes: 1 addition & 1 deletion lbrmed_bringup/launch/hardware.launch
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
<arg name="ft_sensor_ref_link" value="$(arg arm_id)_link8" />
<arg name="control_loop_hz" value="$(arg control_loop_hz)" />

<arg name="load_controllers" value="cartesian_motion_control_handle PositionJointInterface_cartesian_motion_controller PositionJointInterface_abs_admittance_controller"/>
<arg name="load_controllers" value="PositionJointInterface_abs_admittance_controller"/>
<arg name="controllers" value="joint_state_controller force_torque_sensor_controller $(arg hardware_interface)_trajectory_controller" />
</include>

Expand Down
6 changes: 3 additions & 3 deletions lbrmed_bringup/launch/simulation.launch
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
EffortJointInterface for grasping tasks
PositionJointInterface for FZI cartesian controllers
-->
<arg name="hardware_interface" default="PositionJointInterface" />
<arg name="hardware_interface" default="PositionJointInterface" />
<arg name="enable_safety_limits" default="true" />
<!-- Frequency of the control loop, Position requires ≤ 10ms, Effort ≤ 5ms response -->
<arg name="control_loop_hz" default="200" />
Expand Down Expand Up @@ -52,7 +52,7 @@
</include>

<!-- ROS control boilerplate SimHWInterface -->
<include file="$(find lbrmed_control)/launch/lbrmed_sim_hw.launch" >
<include file="$(find lbrmed_control)/launch/lbrmed_sim_hw.launch">
<arg name="arm_id" value="$(arg arm_id)" />
<arg name="control_loop_hz" value="$(arg control_loop_hz)" />
</include>
Expand All @@ -65,7 +65,7 @@
<arg name="ft_sensor_ref_link" value="$(arg arm_id)_link8" />
<arg name="control_loop_hz" value="$(arg control_loop_hz)" />
<arg name="controllers" value="joint_state_controller $(arg hardware_interface)_trajectory_controller" />
<arg name="load_controllers" value="cartesian_motion_control_handle PositionJointInterface_cartesian_motion_controller PositionJointInterface_abs_admittance_controller" />
<arg name="load_controllers" value="PositionJointInterface_abs_admittance_controller" />
</include>

<node name="rqt_controller_manager" pkg="rqt_controller_manager" type="rqt_controller_manager" />
Expand Down
1 change: 0 additions & 1 deletion lbrmed_bringup/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
<license>BSD-3</license>

<buildtool_depend>catkin</buildtool_depend>
<exec_depend>cartesian_controllers</exec_depend>
<exec_depend>joint_state_publisher</exec_depend>
<exec_depend>lbrmed_control</exec_depend>
<exec_depend>lbrmed_description</exec_depend>
Expand Down
4 changes: 4 additions & 0 deletions lbrmed_control/.rosinstall
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
- git:
local-name: cartesian_controllers
uri: https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers.git
version: ros1
6 changes: 3 additions & 3 deletions lbrmed_control/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ find_package(catkin REQUIRED COMPONENTS
roscpp)

catkin_package(
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
INCLUDE_DIRS include
LIBRARIES ${PROJECT_NAME}
CATKIN_DEPENDS
actionlib
controller_interface
lbrmed_msgs
Expand Down
13 changes: 12 additions & 1 deletion lbrmed_control/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,21 @@ Provides launch files to load and start a set of default controllers.
- `joint_state_controller`: Implements a controller which re-publishes the joint states of the robot.
- `force_torque_sensor_controller`: Implements a controller which re-publishes the force and torque sensors of the robot.

## FZI Cartesian controllers
The config contains entries for the [FZI Cartesian controllers](https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers).
However, this package is intended to be a self-contained build and source dependencies are reduced to a minimum.
To install the Cartesian controllers, run the following commands in the workspace root:
```shell
wstool init src
wstool merge -t src src/lbrmed-ros/lbrmed_control/.rosinstall
wstool update -t src
```
Then re-build and -source the whole workspace

## Custom controllers
- `PositionJointInterface_abs_admittance_controller`: Implements an absolute force-based admittance controller.
Compared to a normal admittance controller, the robot approaches an object until the total force exceeds a limit and stops.
I tried implementing a similar behavior using the [FZI cartesian controllers](https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers), but it deviated from the commanded position, no matter how I tuned the parameters.
I tried implementing a similar behavior using the [FZI Cartesian controllers](https://github.com/fzi-forschungszentrum-informatik/cartesian_controllers), but it deviated from the commanded position, no matter how I tuned the parameters.
This controller uses good old KDL inverse kinematics and monitors the forces in the ROS control loop.
Compared to the FZI version, this implementation is **less robust near singularities**.
- Offers `abs_admittance_control` action:
Expand Down
2 changes: 1 addition & 1 deletion lbrmed_control/launch/lbrmed_control.launch
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
-->
<arg name="controllers" default="joint_state_controller force_torque_sensor_controller PositionJointInterface_trajectory_controller" />
<!-- These controllers are only loaded and not started -->
<arg name="load_controllers" default=" cartesian_motion_control_handle PositionJointInterface_cartesian_motion_controller PositionJointInterface_abs_admittance_controller" />
<arg name="load_controllers" default="PositionJointInterface_abs_admittance_controller" />

<!-- Frequency of the control loop, Position requires ≤ 10ms, Effort ≤ 5ms response -->
<arg name="control_loop_hz" default="200" />
Expand Down
2 changes: 0 additions & 2 deletions lbrmed_control/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
<license>BSD-3</license>

<buildtool_depend>catkin</buildtool_depend>
<exec_depend>cartesian_compliance_controller</exec_depend>
<exec_depend>cartesian_motion_controller</exec_depend>
<exec_depend>controller_manager</exec_depend>
<exec_depend>effort_controllers</exec_depend>
<exec_depend>joint_state_controller</exec_depend>
Expand Down
4 changes: 0 additions & 4 deletions lbrmed_hw_fri/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,6 @@ install(TARGETS ${PROJECT_NAME}_node
RUNTIME DESTINATION ${CATKIN_PACKAGE_BIN_DESTINATION}
)

# Install Plugin
install(FILES ${PROJECT_NAME}_plugin.xml DESTINATION ${CATKIN_PACKAGE_SHARE_DESTINATION})


############
# Unit Tests
############
Expand Down
7 changes: 0 additions & 7 deletions lbrmed_hw_fri/lbrmed_hw_fri_plugin.xml

This file was deleted.

4 changes: 0 additions & 4 deletions lbrmed_hw_fri/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,4 @@
<exec_depend>hardware_interface</exec_depend>
<exec_depend>lbrmed_control</exec_depend>

<export>
<hardware_interface plugin="${prefix}/lbrmed_hw_fri_plugin.xml" />
</export>

</package>
5 changes: 1 addition & 4 deletions lbrmed_hw_fri/src/lbrmed_hw_fri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include <kdl_parser/kdl_parser.hpp>
// ROS
#include <ros/console.h>
#include <ros_control_boilerplate/combinable_generic_hw.h>
#include <rosparam_shortcuts/rosparam_shortcuts.h>
#include <transmission_interface/transmission_interface.h>
// KUKA lib
Expand Down Expand Up @@ -212,6 +211,4 @@ double HardwareInterface::low_pass_filter(double y_k, double u_k, double T, doub
}
}

} // namespace lbrmed_hw_fri
PLUGINLIB_EXPORT_CLASS(ros_control_boilerplate::CombinableGenericHW<lbrmed_hw_fri::HardwareInterface>,
hardware_interface::RobotHW)
} // namespace lbrmed_hw_fri
23 changes: 12 additions & 11 deletions lbrmed_moveit_config/launch/moveit.rviz
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ Panels:
Property Tree Widget:
Expanded:
- /Global Options1
- /MotionPlanning1
- /MotionPlanning1/Planned Path1
Splitter Ratio: 0.5415094494819641
Tree Height: 390
Tree Height: 285
- Class: rviz/Help
Name: Help
- Class: rviz/Views
Expand Down Expand Up @@ -120,7 +121,7 @@ Visualization Manager:
Alpha: 1
Show Axes: false
Show Trail: false
Loop Animation: false
Loop Animation: true
Robot Alpha: 0.5
Robot Color: 150; 50; 150
Show Robot Collision: false
Expand Down Expand Up @@ -351,25 +352,25 @@ Visualization Manager:
Views:
Current:
Class: rviz/XYOrbit
Distance: 3.281726837158203
Distance: 2.0772390365600586
Enable Stereo Rendering:
Stereo Eye Separation: 0.05999999865889549
Stereo Focal Distance: 1
Swap Stereo Eyes: false
Value: false
Field of View: 0.7853981852531433
Focal Point:
X: 0
Y: 0
Z: 0
X: 0.13066630065441132
Y: -0.12184453010559082
Z: -5.960464477539063e-08
Focal Shape Fixed Size: false
Focal Shape Size: 0.05000000074505806
Invert Z Axis: false
Name: Current View
Near Clip Distance: 0.009999999776482582
Pitch: 0.260398268699646
Pitch: 0.3603981137275696
Target Frame: lbrmed14_link0
Yaw: 0.5303983688354492
Yaw: 1.4153984785079956
Saved: ~
Window Geometry:
Displays:
Expand All @@ -383,9 +384,9 @@ Window Geometry:
collapsed: false
MotionPlanning - Trajectory Slider:
collapsed: false
QMainWindow State: 000000ff00000000fd00000003000000000000023100000391fc020000000cfb000000100044006900730070006c006100790073010000003b00000217000000c700fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e00670100000258000001740000016900fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e006701000001f1000002070000000000000000fb0000000800480065006c00700000000342000000bb0000006e00fffffffb0000000c00430061006d00650072006100000002ff000001610000000000000000fb0000001e004d006f00740069006f006e00200050006c0061006e006e0069006e00670100000374000001890000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000001600000016fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007202000000000000000000000280000001e0fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007202000000000000000000000280000001e0fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e006702000000000000001b000002b60000020dfb000000280020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007202000000000000000000000280000001e0fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007202000000000000000000000280000001e0000000010000012a00000391fc0200000001fb0000000a00560069006500770073010000003b00000391000000a000ffffff000000030000059e00000174fc0100000001fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000021a0000059e00000000000000000000040d0000039100000001000000020000000100000002fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
QMainWindow State: 000000ff00000000fd0000000300000000000001ca00000391fc020000000cfb000000100044006900730070006c006100790073010000003b000001ae000000c700fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e006701000001ef000001dd0000016900fffffffb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e006701000001f1000002070000000000000000fb0000000800480065006c00700000000342000000bb0000006e00fffffffb0000000c00430061006d00650072006100000002ff000001610000000000000000fb0000001e004d006f00740069006f006e00200050006c0061006e006e0069006e00670100000374000001890000000000000000fb00000044004d006f00740069006f006e0050006c0061006e006e0069006e00670020002d0020005400720061006a006500630074006f0072007900200053006c00690064006500720000000000ffffffff0000001600000016fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007202000000000000000000000280000001e0fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007202000000000000000000000280000001e0fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e006702000000000000001b000002b60000020dfb000000280020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007202000000000000000000000280000001e0fb000000280020002d0020005400720061006a006500630074006f0072007900200053006c006900640065007202000000000000000000000280000001e0000000010000012a00000391fc0200000001fb0000000a00560069006500770073010000003b00000391000000a000ffffff000000030000059e00000174fc0100000001fb0000001c004d006f00740069006f006e0050006c0061006e006e0069006e0067010000021a0000059e0000000000000000000004740000039100000001000000020000000100000002fc0000000100000002000000010000000a0054006f006f006c00730100000000ffffffff0000000000000000
Views:
collapsed: false
Width: 1908
X: -34
Y: 17
X: 0
Y: 4