Skip to content

Commit c5783c4

Browse files
authored
Change submodule for a copy of URDF's with clear changes. (#152)
Change submodule for a copy of URDF's with clear changes. --------- Signed-off-by: Jelmer de Wolde <[email protected]>
1 parent 4f059fd commit c5783c4

17 files changed

+594
-58
lines changed

.github/workflows/reusable-workspace.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,6 @@ jobs:
2020
steps:
2121
- name: checkout
2222
uses: actions/checkout@v4
23-
with:
24-
submodules: "true"
2523
- name: build workspace
2624
shell: bash -ieo pipefail {0}
2725
run: |

.gitmodules

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,3 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5-
[submodule "ros2_ws/src/franka_description"]
6-
path = ros2_ws/src/franka_description
7-
url = [email protected]:alliander-opensource/franka_description.git
8-
branch = main

dockerfiles/install_scripts/franka_ros2.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
set -e
88

9-
#Install ros2 franka: https://support.franka.de/docs/franka_ros2.html
9+
#Install ros2 franka: https://github.com/frankaemika/franka_ros2
1010
apt update
1111
apt install -y \
1212
ros-humble-angles \
@@ -18,12 +18,11 @@ apt install -y \
1818
ros-humble-hardware-interface
1919

2020
mkdir -p /home/$UNAME/franka_ws/src
21+
cd /home/$UNAME/franka_ws/src
22+
git clone -b v0.1.15 https://github.com/frankaemika/franka_ros2.git
23+
git clone -b 0.4.0 https://github.com/frankaemika/franka_description.git
2124
cd /home/$UNAME/franka_ws
22-
git clone https://github.com/frankaemika/franka_ros2.git src/franka_ros2
23-
cd /home/$UNAME/franka_ws/src/franka_ros2
24-
git checkout v0.1.15
25-
26-
cd /home/$UNAME/franka_ws
25+
rosdep install --from-paths src --ignore-src --rosdistro humble -y
2726
source /home/$UNAME/.bashrc
28-
colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-ignore franka_ign_ros2_control
27+
colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-ignore franka_ign_ros2_control
2928
echo "source /home/$UNAME/franka_ws/install/setup.bash" >>/home/$UNAME/.bashrc

dockerfiles/rcdt_robotics.Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN ./libfranka.sh
2222

2323
COPY ./install_scripts/franka_ros2.sh .
2424
RUN ./franka_ros2.sh
25-
ENV GZ_SIM_RESOURCE_PATH="$GZ_SIM_RESOURCE_PATH:/opt/ros/humble/share/"
25+
ENV GZ_SIM_RESOURCE_PATH="$GZ_SIM_RESOURCE_PATH:/home/$UNAME/franka_ws/src"
2626

2727
COPY ./install_scripts/husarion_ugv_ros.sh .
2828
RUN ./husarion_ugv_ros.sh

docs/content/getting_started.md

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,22 +16,16 @@ The repository uses git LFS for large files, in particular for 3D simulation ass
1616

1717
## Clone
1818

19-
To use this repository, first clone it including the submodules. If you are a contributor with an SSH-key linked, clone via SSH:
19+
To use this repository, first clone it. If you are a contributor with an SSH-key linked, clone via SSH:
2020

2121
```bash
22-
git clone --recurse-submodules [email protected]:alliander-opensource/rcdt_robotics.git
22+
git clone [email protected]:alliander-opensource/rcdt_robotics.git
2323
```
2424

2525
If you only want to use the repository without contributing, you can clone via HTTP:
2626

2727
```bash
28-
git clone --recurse-submodules https://github.com/alliander-opensource/rcdt_robotics.git
29-
```
30-
31-
In case you cloned the repository, but forgot to pass the `--recurse-submodules` flag, this can be fixed by running:
32-
33-
```bash
34-
git submodule update --init --recursive
28+
git clone https://github.com/alliander-opensource/rcdt_robotics.git
3529
```
3630

3731
## Run the container

ros2_ws/src/franka_description

Lines changed: 0 additions & 1 deletion
This file was deleted.

ros2_ws/src/rcdt_franka/config/simulation_controllers.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,13 @@
22
#
33
# SPDX-License-Identifier: Apache-2.0
44

5+
controller_manager:
6+
ros__parameters:
7+
update_rate: 1000
8+
9+
joint_state_broadcaster:
10+
type: joint_state_broadcaster/JointStateBroadcaster
11+
512
fr3_arm_controller:
613
ros__parameters:
714
type: joint_trajectory_controller/JointTrajectoryController

ros2_ws/src/rcdt_franka/launch/core.launch.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,7 @@ def launch_setup(context: LaunchContext) -> None:
2525

2626
xacro_path = get_file_path("rcdt_franka", ["urdf"], "franka.urdf.xacro")
2727
xacro_arguments = {}
28-
xacro_arguments["robot_ip"] = "172.16.0.2"
29-
xacro_arguments["gazebo"] = "true" if use_sim else "false"
28+
xacro_arguments["simulation"] = "true" if use_sim else "false"
3029
xacro_arguments["load_realsense"] = "true" if use_realsense else "false"
3130
robot_description = get_robot_description(xacro_path, xacro_arguments)
3231

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
<?xml version="1.0"?>
2+
<!--
3+
Based on:
4+
https://github.com/frankaemika/franka_description/blob/0.4.0/robots/common/franka_arm.ros2_control.xacro
5+
A copy of the original file is located in the /original directory.
6+
To compare the two files in VSCode, see:
7+
https://code.visualstudio.com/docs/editing/codebasics#_compare-files
8+
-->
9+
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
10+
11+
<xacro:macro name="franka_arm_ros2_control"
12+
params="arm_id
13+
robot_ip
14+
use_fake_hardware:=^|false
15+
fake_sensor_commands:=^|false
16+
gazebo:=^|false
17+
hand:=^|false
18+
gazebo_effort:=^|false
19+
arm_prefix:=''
20+
multi_arm:=false
21+
namespace:=''">
22+
23+
<xacro:property name="arm_prefix_modified" value="${'' if arm_prefix == '' else arm_prefix + '_'}" />
24+
<ros2_control name="${arm_prefix_modified}FrankaHardwareInterface" type="system">
25+
<hardware>
26+
<param name="arm_id">${arm_id}</param>
27+
<param name="prefix">${arm_prefix}</param>
28+
<xacro:if value="${use_fake_hardware}">
29+
<plugin>fake_components/GenericSystem</plugin>
30+
<param name="fake_sensor_commands">${fake_sensor_commands}</param>
31+
<param name="state_following_offset">0.0</param>
32+
</xacro:if>
33+
34+
<xacro:if value="${gazebo}">
35+
<plugin>ign_ros2_control/IgnitionSystem</plugin>
36+
</xacro:if>
37+
38+
<xacro:if value="${use_fake_hardware == 0 and gazebo == 0 and multi_arm == 0}">
39+
<plugin>franka_hardware/FrankaHardwareInterface</plugin>
40+
<param name="robot_ip">${robot_ip}</param>
41+
<param name="arm_prefix">${arm_prefix}</param>
42+
</xacro:if>
43+
<xacro:if value="${use_fake_hardware == 0 and gazebo == 0 and multi_arm == 1}">
44+
<plugin>franka_hardware/MultiFrankaHardwareInterface</plugin>
45+
<param name="robot_ip">${robot_ip}</param>
46+
<param name="arm_prefix">${arm_prefix}</param>
47+
</xacro:if>
48+
</hardware>
49+
50+
<xacro:macro name="configure_joint" params="joint_name initial_position">
51+
<joint name="${joint_name}">
52+
<!--
53+
deactivated for gazebo velocity and position interface due to a bug
54+
https://github.com/ros-controls/gz_ros2_control/issues/343
55+
56+
Command Interfaces -->
57+
<xacro:if value="${multi_arm == 0}">
58+
<command_interface name="position"/>
59+
<command_interface name="velocity"/>
60+
</xacro:if>
61+
<xacro:if value="${gazebo == 0 or gazebo_effort == 1}">
62+
<command_interface name="effort"/>
63+
</xacro:if>
64+
65+
<!-- State Interfaces -->
66+
<state_interface name="position">
67+
<param name="initial_value">${initial_position}</param>
68+
</state_interface>
69+
<state_interface name="velocity"/>
70+
<param name="initial_value">0.0</param>
71+
<state_interface name="effort"/>
72+
</joint>
73+
</xacro:macro>
74+
75+
<xacro:configure_joint joint_name="${arm_prefix_modified}${arm_id}_joint1" initial_position="0.0"/>
76+
<xacro:configure_joint joint_name="${arm_prefix_modified}${arm_id}_joint2" initial_position="${-pi/4}"/>
77+
<xacro:configure_joint joint_name="${arm_prefix_modified}${arm_id}_joint3" initial_position="0.0"/>
78+
<xacro:configure_joint joint_name="${arm_prefix_modified}${arm_id}_joint4" initial_position="${-3*pi/4}"/>
79+
<xacro:configure_joint joint_name="${arm_prefix_modified}${arm_id}_joint5" initial_position="0.0"/>
80+
<xacro:configure_joint joint_name="${arm_prefix_modified}${arm_id}_joint6" initial_position="${pi/2}"/>
81+
<xacro:configure_joint joint_name="${arm_prefix_modified}${arm_id}_joint7" initial_position="${pi/4}"/>
82+
<xacro:if value="${gazebo and hand}">
83+
<xacro:configure_joint joint_name="${arm_id}_finger_joint1" initial_position="0.0" />
84+
<!-- Add finger_joint2, required when controlling gripper in simulation: -->
85+
<joint name="${arm_id}_finger_joint2">
86+
<param name="mimic">${arm_id}_finger_joint1</param>
87+
<param name="multiplier">1</param>
88+
</joint>
89+
</xacro:if>
90+
91+
</ros2_control>
92+
<xacro:if value="${gazebo}">
93+
<gazebo>
94+
<plugin filename="ign_ros2_control-system" name="ign_ros2_control::IgnitionROS2ControlPlugin">
95+
<parameters>$(find rcdt_franka)/config/simulation_controllers.yaml</parameters>
96+
<ros>
97+
<namespace>${namespace}</namespace>
98+
<xacro:include filename="$(find rcdt_gazebo)/urdf/remappings.urdf.xacro" />
99+
<xacro:remappings />
100+
</ros>
101+
</plugin>
102+
</gazebo>
103+
</xacro:if>
104+
105+
</xacro:macro>
106+
</robot>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
SPDX-FileCopyrightText: Alliander N. V.
2+
3+
SPDX-License-Identifier: Apache-2.0

0 commit comments

Comments
 (0)