AS: connection with Pd

This commit is contained in:
Alexander Schaefer 2025-04-07 19:20:31 +02:00
parent c95e0f4c0c
commit e00fa0a38a
30 changed files with 127 additions and 635 deletions

BIN
.DS_Store vendored

Binary file not shown.

View File

@ -1,542 +0,0 @@
<?xml version="1.0" ?>
<!-- =================================================================================== -->
<!-- | This document was autogenerated by xacro from /opt/ros/humble/share/ur_description/urdf/ur.urdf.xacro | -->
<!-- | EDITING THIS FILE BY HAND IS NOT RECOMMENDED | -->
<!-- =================================================================================== -->
<robot name="ur10e">
<!--
Base UR robot series xacro macro.
NOTE this is NOT a URDF. It cannot directly be loaded by consumers
expecting a flattened '.urdf' file. See the top-level '.xacro' for that
(but note that .xacro must still be processed by the xacro command).
This file models the base kinematic chain of a UR robot, which then gets
parameterised by various configuration files to convert it into a UR3(e),
UR5(e), UR10(e) or UR16e.
NOTE the default kinematic parameters (i.e., link lengths, frame locations,
offsets, etc) do not correspond to any particular robot. They are defaults
only. There WILL be non-zero offsets between the Forward Kinematics results
in TF (i.e., robot_state_publisher) and the values reported by the Teach
Pendant.
For accurate (and robot-specific) transforms, the 'kinematics_parameters_file'
parameter MUST point to a .yaml file containing the appropriate values for
the targeted robot.
If using the UniversalRobots/Universal_Robots_ROS_Driver, follow the steps
described in the readme of that repository to extract the kinematic
calibration from the controller and generate the required .yaml file.
Main author of the migration to yaml configs Ludovic Delval.
Contributors to previous versions (in no particular order)
- Denis Stogl
- Lovro Ivanov
- Felix Messmer
- Kelsey Hawkins
- Wim Meeussen
- Shaun Edwards
- Nadia Hammoudeh Garcia
- Dave Hershberger
- G. vd. Hoorn
- Philip Long
- Dave Coleman
- Miguel Prada
- Mathias Luedtke
- Marcel Schnirring
- Felix von Drigalski
- Felix Exner
- Jimmy Da Silva
- Ajit Krisshna N L
- Muhammad Asif Rana
-->
<!--
NOTE the macro defined in this file is NOT part of the public API of this
package. Users CANNOT rely on this file being available, or stored in
this location. Nor can they rely on the existence of the macro.
-->
<!-- create link fixed to the "world" -->
<link name="world"/>
<ros2_control name="ur10e" type="system">
<hardware>
<plugin>ur_robot_driver/URPositionHardwareInterface</plugin>
<param name="robot_ip">172.18.0.2</param>
<param name="script_filename">/opt/ros/humble/share/ur_client_library/resources/external_control.urscript</param>
<param name="output_recipe_filename">/opt/ros/humble/share/ur_robot_driver/resources/rtde_output_recipe.txt</param>
<param name="input_recipe_filename">/opt/ros/humble/share/ur_robot_driver/resources/rtde_input_recipe.txt</param>
<param name="headless_mode">False</param>
<param name="reverse_port">50001</param>
<param name="script_sender_port">50002</param>
<param name="reverse_ip">0.0.0.0</param>
<param name="script_command_port">50004</param>
<param name="trajectory_port">50003</param>
<param name="tf_prefix"></param>
<param name="non_blocking_read">True</param>
<param name="servoj_gain">2000</param>
<param name="servoj_lookahead_time">0.03</param>
<param name="use_tool_communication">False</param>
<param name="kinematics/hash">calib_5119701370761913513</param>
<param name="tool_voltage">0</param>
<param name="tool_parity">0</param>
<param name="tool_baud_rate">115200</param>
<param name="tool_stop_bits">1</param>
<param name="tool_rx_idle_chars">1.5</param>
<param name="tool_tx_idle_chars">3.5</param>
<param name="tool_device_name">/tmp/ttyUR</param>
<param name="tool_tcp_port">54321</param>
<param name="keep_alive_count">2</param>
</hardware>
<joint name="shoulder_pan_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<state_interface name="position">
<!-- initial position for the FakeSystem and simulation -->
<param name="initial_value">0.0</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="shoulder_lift_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<state_interface name="position">
<!-- initial position for the FakeSystem and simulation -->
<param name="initial_value">-1.57</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="elbow_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<state_interface name="position">
<!-- initial position for the FakeSystem and simulation -->
<param name="initial_value">0.0</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="wrist_1_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<state_interface name="position">
<!-- initial position for the FakeSystem and simulation -->
<param name="initial_value">-1.57</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="wrist_2_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<state_interface name="position">
<!-- initial position for the FakeSystem and simulation -->
<param name="initial_value">0.0</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="wrist_3_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<state_interface name="position">
<!-- initial position for the FakeSystem and simulation -->
<param name="initial_value">0.0</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<sensor name="tcp_fts_sensor">
<state_interface name="force.x"/>
<state_interface name="force.y"/>
<state_interface name="force.z"/>
<state_interface name="torque.x"/>
<state_interface name="torque.y"/>
<state_interface name="torque.z"/>
</sensor>
<sensor name="tcp_pose">
<state_interface name="position.x"/>
<state_interface name="position.y"/>
<state_interface name="position.z"/>
<state_interface name="orientation.x"/>
<state_interface name="orientation.y"/>
<state_interface name="orientation.z"/>
<state_interface name="orientation.w"/>
</sensor>
<!-- NOTE The following are joints used only for testing with fake hardware and will change in the future -->
<gpio name="speed_scaling">
<state_interface name="speed_scaling_factor"/>
<param name="initial_speed_scaling_factor">1</param>
<command_interface name="target_speed_fraction_cmd"/>
<command_interface name="target_speed_fraction_async_success"/>
</gpio>
<gpio name="gpio">
<command_interface name="standard_digital_output_cmd_0"/>
<command_interface name="standard_digital_output_cmd_1"/>
<command_interface name="standard_digital_output_cmd_2"/>
<command_interface name="standard_digital_output_cmd_3"/>
<command_interface name="standard_digital_output_cmd_4"/>
<command_interface name="standard_digital_output_cmd_5"/>
<command_interface name="standard_digital_output_cmd_6"/>
<command_interface name="standard_digital_output_cmd_7"/>
<command_interface name="standard_digital_output_cmd_8"/>
<command_interface name="standard_digital_output_cmd_9"/>
<command_interface name="standard_digital_output_cmd_10"/>
<command_interface name="standard_digital_output_cmd_11"/>
<command_interface name="standard_digital_output_cmd_12"/>
<command_interface name="standard_digital_output_cmd_13"/>
<command_interface name="standard_digital_output_cmd_14"/>
<command_interface name="standard_digital_output_cmd_15"/>
<command_interface name="standard_digital_output_cmd_16"/>
<command_interface name="standard_digital_output_cmd_17"/>
<command_interface name="standard_analog_output_cmd_0"/>
<command_interface name="standard_analog_output_cmd_1"/>
<command_interface name="analog_output_domain_cmd"/>
<command_interface name="tool_voltage_cmd"/>
<command_interface name="io_async_success"/>
<state_interface name="digital_output_0"/>
<state_interface name="digital_output_1"/>
<state_interface name="digital_output_2"/>
<state_interface name="digital_output_3"/>
<state_interface name="digital_output_4"/>
<state_interface name="digital_output_5"/>
<state_interface name="digital_output_6"/>
<state_interface name="digital_output_7"/>
<state_interface name="digital_output_8"/>
<state_interface name="digital_output_9"/>
<state_interface name="digital_output_10"/>
<state_interface name="digital_output_11"/>
<state_interface name="digital_output_12"/>
<state_interface name="digital_output_13"/>
<state_interface name="digital_output_14"/>
<state_interface name="digital_output_15"/>
<state_interface name="digital_output_16"/>
<state_interface name="digital_output_17"/>
<state_interface name="digital_input_0"/>
<state_interface name="digital_input_1"/>
<state_interface name="digital_input_2"/>
<state_interface name="digital_input_3"/>
<state_interface name="digital_input_4"/>
<state_interface name="digital_input_5"/>
<state_interface name="digital_input_6"/>
<state_interface name="digital_input_7"/>
<state_interface name="digital_input_8"/>
<state_interface name="digital_input_9"/>
<state_interface name="digital_input_10"/>
<state_interface name="digital_input_11"/>
<state_interface name="digital_input_12"/>
<state_interface name="digital_input_13"/>
<state_interface name="digital_input_14"/>
<state_interface name="digital_input_15"/>
<state_interface name="digital_input_16"/>
<state_interface name="digital_input_17"/>
<state_interface name="standard_analog_output_0"/>
<state_interface name="standard_analog_output_1"/>
<state_interface name="standard_analog_input_0"/>
<state_interface name="standard_analog_input_1"/>
<state_interface name="analog_io_type_0"/>
<state_interface name="analog_io_type_1"/>
<state_interface name="analog_io_type_2"/>
<state_interface name="analog_io_type_3"/>
<state_interface name="tool_mode"/>
<state_interface name="tool_output_voltage"/>
<state_interface name="tool_output_current"/>
<state_interface name="tool_temperature"/>
<state_interface name="tool_analog_input_0"/>
<state_interface name="tool_analog_input_1"/>
<state_interface name="tool_analog_input_type_0"/>
<state_interface name="tool_analog_input_type_1"/>
<state_interface name="robot_mode"/>
<state_interface name="robot_status_bit_0"/>
<state_interface name="robot_status_bit_1"/>
<state_interface name="robot_status_bit_2"/>
<state_interface name="robot_status_bit_3"/>
<state_interface name="safety_mode"/>
<state_interface name="safety_status_bit_0"/>
<state_interface name="safety_status_bit_1"/>
<state_interface name="safety_status_bit_2"/>
<state_interface name="safety_status_bit_3"/>
<state_interface name="safety_status_bit_4"/>
<state_interface name="safety_status_bit_5"/>
<state_interface name="safety_status_bit_6"/>
<state_interface name="safety_status_bit_7"/>
<state_interface name="safety_status_bit_8"/>
<state_interface name="safety_status_bit_9"/>
<state_interface name="safety_status_bit_10"/>
<state_interface name="program_running"/>
</gpio>
<gpio name="payload">
<command_interface name="mass"/>
<command_interface name="cog.x"/>
<command_interface name="cog.y"/>
<command_interface name="cog.z"/>
<command_interface name="payload_async_success"/>
</gpio>
<gpio name="resend_robot_program">
<command_interface name="resend_robot_program_cmd"/>
<command_interface name="resend_robot_program_async_success"/>
</gpio>
<gpio name="hand_back_control">
<command_interface name="hand_back_control_cmd"/>
<command_interface name="hand_back_control_async_success"/>
</gpio>
<gpio name="zero_ftsensor">
<command_interface name="zero_ftsensor_cmd"/>
<command_interface name="zero_ftsensor_async_success"/>
</gpio>
<gpio name="system_interface">
<state_interface name="initialized"/>
</gpio>
<gpio name="get_robot_software_version">
<state_interface name="get_version_major"/>
<state_interface name="get_version_minor"/>
<state_interface name="get_version_build"/>
<state_interface name="get_version_bugfix"/>
</gpio>
</ros2_control>
<!-- Add URDF transmission elements (for ros_control) -->
<!--<xacro:ur_arm_transmission prefix="${prefix}" hw_interface="${transmission_hw_interface}" />-->
<!-- Placeholder for ros2_control transmission which don't yet exist -->
<!-- links - main serial chain -->
<link name="base_link"/>
<link name="base_link_inertia">
<visual>
<origin rpy="0 0 3.141592653589793" xyz="0 0 0"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/visual/base.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 3.141592653589793" xyz="0 0 0"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/collision/base.stl"/>
</geometry>
</collision>
<inertial>
<mass value="4.0"/>
<origin rpy="0 0 0" xyz="0 0 0"/>
<inertia ixx="0.0061063308908" ixy="0.0" ixz="0.0" iyy="0.0061063308908" iyz="0.0" izz="0.01125"/>
</inertial>
</link>
<link name="shoulder_link">
<visual>
<origin rpy="0 0 3.141592653589793" xyz="0 0 0"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/visual/shoulder.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 3.141592653589793" xyz="0 0 0"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/collision/shoulder.stl"/>
</geometry>
</collision>
<inertial>
<mass value="7.369"/>
<origin rpy="1.570796326794897 0 0" xyz="0.021 -0.027 0.0"/>
<inertia ixx="0.03408" ixy="2e-05" ixz="-0.00425" iyy="0.03529" iyz="8e-05" izz="0.02156"/>
</inertial>
</link>
<link name="upper_arm_link">
<visual>
<origin rpy="1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0.1762"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/visual/upperarm.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0.1762"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/collision/upperarm.stl"/>
</geometry>
</collision>
<inertial>
<mass value="13.051"/>
<origin rpy="0 0 0" xyz="-0.2327 0.0 0.158"/>
<inertia ixx="0.02814" ixy="5e-05" ixz="-0.01561" iyy="0.77068" iyz="2e-05" izz="0.76943"/>
</inertial>
</link>
<link name="forearm_link">
<visual>
<origin rpy="1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0.0393"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/visual/forearm.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="1.5707963267948966 0 -1.5707963267948966" xyz="0 0 0.0393"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/collision/forearm.stl"/>
</geometry>
</collision>
<inertial>
<mass value="3.989"/>
<origin rpy="0 0 0" xyz="-0.33155 0.0 0.068"/>
<inertia ixx="0.01014" ixy="8e-05" ixz="0.00916" iyy="0.30928" iyz="0.0" izz="0.30646"/>
</inertial>
</link>
<link name="wrist_1_link">
<visual>
<origin rpy="1.5707963267948966 0 0" xyz="0 0 -0.135"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/visual/wrist1.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="1.5707963267948966 0 0" xyz="0 0 -0.135"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/collision/wrist1.stl"/>
</geometry>
</collision>
<inertial>
<mass value="2.1"/>
<origin rpy="1.570796326794897 0 0" xyz="0.0 -0.018 0.007"/>
<inertia ixx="0.00296" ixy="-1e-05" ixz="0.0" iyy="0.00222" iyz="-0.00024" izz="0.00258"/>
</inertial>
</link>
<link name="wrist_2_link">
<visual>
<origin rpy="0 0 0" xyz="0 0 -0.12"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/visual/wrist2.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="0 0 0" xyz="0 0 -0.12"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/collision/wrist2.stl"/>
</geometry>
</collision>
<inertial>
<mass value="1.98"/>
<origin rpy="-1.570796326794897 0 0" xyz="0.0 0.018 -0.007"/>
<inertia ixx="0.00296" ixy="-1e-05" ixz="0.0" iyy="0.00222" iyz="-0.00024" izz="0.00258"/>
</inertial>
</link>
<link name="wrist_3_link">
<visual>
<origin rpy="1.5707963267948966 0 0" xyz="0 0 -0.1168"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/visual/wrist3.dae"/>
</geometry>
</visual>
<collision>
<origin rpy="1.5707963267948966 0 0" xyz="0 0 -0.1168"/>
<geometry>
<mesh filename="package://ur_description/meshes/ur10e/collision/wrist3.stl"/>
</geometry>
</collision>
<inertial>
<mass value="0.615"/>
<origin rpy="0 0 0" xyz="0.0 0.0 -0.026"/>
<inertia ixx="0.0004" ixy="0.0" ixz="0.0" iyy="0.00041" iyz="0.0" izz="0.00034"/>
</inertial>
</link>
<!-- base_joint fixes base_link to the environment -->
<joint name="base_joint" type="fixed">
<origin rpy="0 0 0" xyz="0 0 0"/>
<parent link="world"/>
<child link="base_link"/>
</joint>
<!-- joints - main serial chain -->
<joint name="base_link-base_link_inertia" type="fixed">
<parent link="base_link"/>
<child link="base_link_inertia"/>
<!-- 'base_link' is REP-103 aligned (so X+ forward), while the internal
frames of the robot/controller have X+ pointing backwards.
Use the joint between 'base_link' and 'base_link_inertia' (a dummy
link/frame) to introduce the necessary rotation over Z (of pi rad).
-->
<origin rpy="0 0 3.141592653589793" xyz="0 0 0"/>
</joint>
<joint name="shoulder_pan_joint" type="revolute">
<parent link="base_link_inertia"/>
<child link="shoulder_link"/>
<origin rpy="0 0 0" xyz="0 0 0.1807"/>
<axis xyz="0 0 1"/>
<limit effort="330.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="2.0943951023931953"/>
<safety_controller k_position="20" k_velocity="0.0" soft_lower_limit="-6.133185307179586" soft_upper_limit="6.133185307179586"/>
<dynamics damping="0" friction="0"/>
</joint>
<joint name="shoulder_lift_joint" type="revolute">
<parent link="shoulder_link"/>
<child link="upper_arm_link"/>
<origin rpy="1.570796327 0 0" xyz="0 0 0"/>
<axis xyz="0 0 1"/>
<limit effort="330.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="2.0943951023931953"/>
<safety_controller k_position="20" k_velocity="0.0" soft_lower_limit="-6.133185307179586" soft_upper_limit="6.133185307179586"/>
<dynamics damping="0" friction="0"/>
</joint>
<joint name="elbow_joint" type="revolute">
<parent link="upper_arm_link"/>
<child link="forearm_link"/>
<origin rpy="0 0 0" xyz="-0.6127 0 0"/>
<axis xyz="0 0 1"/>
<limit effort="150.0" lower="-3.141592653589793" upper="3.141592653589793" velocity="3.141592653589793"/>
<safety_controller k_position="20" k_velocity="0.0" soft_lower_limit="-2.991592653589793" soft_upper_limit="2.991592653589793"/>
<dynamics damping="0" friction="0"/>
</joint>
<joint name="wrist_1_joint" type="revolute">
<parent link="forearm_link"/>
<child link="wrist_1_link"/>
<origin rpy="0 0 0" xyz="-0.57155 0 0.17415"/>
<axis xyz="0 0 1"/>
<limit effort="54.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="3.141592653589793"/>
<safety_controller k_position="20" k_velocity="0.0" soft_lower_limit="-6.133185307179586" soft_upper_limit="6.133185307179586"/>
<dynamics damping="0" friction="0"/>
</joint>
<joint name="wrist_2_joint" type="revolute">
<parent link="wrist_1_link"/>
<child link="wrist_2_link"/>
<origin rpy="1.570796327 0 0" xyz="0 -0.11985 -2.458164590756244e-11"/>
<axis xyz="0 0 1"/>
<limit effort="54.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="3.141592653589793"/>
<safety_controller k_position="20" k_velocity="0.0" soft_lower_limit="-6.133185307179586" soft_upper_limit="6.133185307179586"/>
<dynamics damping="0" friction="0"/>
</joint>
<joint name="wrist_3_joint" type="revolute">
<parent link="wrist_2_link"/>
<child link="wrist_3_link"/>
<origin rpy="1.570796326589793 3.141592653589793 3.141592653589793" xyz="0 0.11655 -2.390480459346185e-11"/>
<axis xyz="0 0 1"/>
<limit effort="54.0" lower="-6.283185307179586" upper="6.283185307179586" velocity="3.141592653589793"/>
<safety_controller k_position="20" k_velocity="0.0" soft_lower_limit="-6.133185307179586" soft_upper_limit="6.133185307179586"/>
<dynamics damping="0" friction="0"/>
</joint>
<link name="ft_frame"/>
<joint name="wrist_3_link-ft_frame" type="fixed">
<parent link="wrist_3_link"/>
<child link="ft_frame"/>
<origin rpy="3.141592653589793 0 0" xyz="0 0 0"/>
</joint>
<!-- ROS-Industrial 'base' frame - base_link to UR 'Base' Coordinates transform -->
<link name="base"/>
<joint name="base_link-base_fixed_joint" type="fixed">
<!-- Note the rotation over Z of pi radians - as base_link is REP-103
aligned (i.e., has X+ forward, Y+ left and Z+ up), this is needed
to correctly align 'base' with the 'Base' coordinate system of
the UR controller.
-->
<origin rpy="0 0 3.141592653589793" xyz="0 0 0"/>
<parent link="base_link"/>
<child link="base"/>
</joint>
<!-- ROS-Industrial 'flange' frame - attachment point for EEF models -->
<link name="flange"/>
<joint name="wrist_3-flange" type="fixed">
<parent link="wrist_3_link"/>
<child link="flange"/>
<origin rpy="0 -1.5707963267948966 -1.5707963267948966" xyz="0 0 0"/>
</joint>
<!-- ROS-Industrial 'tool0' frame - all-zeros tool frame -->
<link name="tool0"/>
<joint name="flange-tool0" type="fixed">
<!-- default toolframe - X+ left, Y+ up, Z+ front -->
<origin rpy="1.5707963267948966 0 1.5707963267948966" xyz="0 0 0"/>
<parent link="flange"/>
<child link="tool0"/>
</joint>
</robot>

View File

@ -6,7 +6,7 @@
# since a plain shell script can't determine its own path when being sourced
# either use the provided COLCON_CURRENT_PREFIX
# or fall back to the build time prefix (if it exists)
_colcon_prefix_sh_COLCON_CURRENT_PREFIX="/ros2_ws/install"
_colcon_prefix_sh_COLCON_CURRENT_PREFIX="/BA/ros2_ws/install"
if [ -z "$COLCON_CURRENT_PREFIX" ]; then
if [ ! -d "$_colcon_prefix_sh_COLCON_CURRENT_PREFIX" ]; then
echo "The build time path \"$_colcon_prefix_sh_COLCON_CURRENT_PREFIX\" doesn't exist. Either source a script for a different shell or set the environment variable \"COLCON_CURRENT_PREFIX\" explicitly." 1>&2

View File

@ -17,11 +17,6 @@ _colcon_prefix_chain_bash_source_script() {
fi
}
# source chained prefixes
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="/opt/ros/humble"
_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash"
# source this prefix
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)"

View File

@ -21,9 +21,6 @@ function _colcon_prefix_chain_powershell_source_script {
}
}
# source chained prefixes
_colcon_prefix_chain_powershell_source_script "/opt/ros/humble\local_setup.ps1"
# source this prefix
$env:COLCON_CURRENT_PREFIX=(Split-Path $PSCommandPath -Parent)
_colcon_prefix_chain_powershell_source_script "$env:COLCON_CURRENT_PREFIX\local_setup.ps1"

View File

@ -7,7 +7,7 @@
# since a plain shell script can't determine its own path when being sourced
# either use the provided COLCON_CURRENT_PREFIX
# or fall back to the build time prefix (if it exists)
_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX=/ros2_ws/install
_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX=/BA/ros2_ws/install
if [ ! -z "$COLCON_CURRENT_PREFIX" ]; then
_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX="$COLCON_CURRENT_PREFIX"
elif [ ! -d "$_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX" ]; then
@ -29,12 +29,6 @@ _colcon_prefix_chain_sh_source_script() {
fi
}
# source chained prefixes
# setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script
COLCON_CURRENT_PREFIX="/opt/ros/humble"
_colcon_prefix_chain_sh_source_script "$COLCON_CURRENT_PREFIX/local_setup.sh"
# source this prefix
# setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script
COLCON_CURRENT_PREFIX="$_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX"

View File

@ -17,11 +17,6 @@ _colcon_prefix_chain_zsh_source_script() {
fi
}
# source chained prefixes
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="/opt/ros/humble"
_colcon_prefix_chain_zsh_source_script "$COLCON_CURRENT_PREFIX/local_setup.zsh"
# source this prefix
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="$(builtin cd -q "`dirname "${(%):-%N}"`" > /dev/null && pwd)"

View File

@ -1 +1 @@
build_2025-01-29_16-04-47
build_2025-03-27_14-22-13

View File

@ -38,7 +38,7 @@ def main():
if urdf_string:
# Save to a file
urdf_path = "/BA/robot.urdf"
urdf_path = "/BA/robot_ur5.urdf"
with open(urdf_path, "w") as file:
file.write(urdf_string)

View File

@ -5,7 +5,6 @@ from rcl_interfaces.srv import GetParameters
import time
from cart_to_angles import ik_sol
import roboticstoolbox as rtb
import xacro
class ScaledJointTrajectoryPublisher(Node):
def __init__(self):

View File

@ -1,21 +1,13 @@
AMENT_PREFIX_PATH=/BA/workspace/install/joint_info:/BA/workspace/install/joint_control:/opt/ros/humble
COLCON=1
COLCON_PREFIX_PATH=/BA/workspace/install
HOME=/root
HOSTNAME=3230bc57d699
HOSTNAME=0e38e264ac6b
LANG=C.UTF-8
LC_ALL=C.UTF-8
LD_LIBRARY_PATH=/opt/ros/humble/opt/rviz_ogre_vendor/lib:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib
LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;01:mi=00:su=37;41:sg=30;43:ca=30;41:tw=30;42:ow=34;42:st=37;44:ex=01;32:*.tar=01;31:*.tgz=01;31:*.arc=01;31:*.arj=01;31:*.taz=01;31:*.lha=01;31:*.lz4=01;31:*.lzh=01;31:*.lzma=01;31:*.tlz=01;31:*.txz=01;31:*.tzo=01;31:*.t7z=01;31:*.zip=01;31:*.z=01;31:*.dz=01;31:*.gz=01;31:*.lrz=01;31:*.lz=01;31:*.lzo=01;31:*.xz=01;31:*.zst=01;31:*.tzst=01;31:*.bz2=01;31:*.bz=01;31:*.tbz=01;31:*.tbz2=01;31:*.tz=01;31:*.deb=01;31:*.rpm=01;31:*.jar=01;31:*.war=01;31:*.ear=01;31:*.sar=01;31:*.rar=01;31:*.alz=01;31:*.ace=01;31:*.zoo=01;31:*.cpio=01;31:*.7z=01;31:*.rz=01;31:*.cab=01;31:*.wim=01;31:*.swm=01;31:*.dwm=01;31:*.esd=01;31:*.jpg=01;35:*.jpeg=01;35:*.mjpg=01;35:*.mjpeg=01;35:*.gif=01;35:*.bmp=01;35:*.pbm=01;35:*.pgm=01;35:*.ppm=01;35:*.tga=01;35:*.xbm=01;35:*.xpm=01;35:*.tif=01;35:*.tiff=01;35:*.png=01;35:*.svg=01;35:*.svgz=01;35:*.mng=01;35:*.pcx=01;35:*.mov=01;35:*.mpg=01;35:*.mpeg=01;35:*.m2v=01;35:*.mkv=01;35:*.webm=01;35:*.webp=01;35:*.ogm=01;35:*.mp4=01;35:*.m4v=01;35:*.mp4v=01;35:*.vob=01;35:*.qt=01;35:*.nuv=01;35:*.wmv=01;35:*.asf=01;35:*.rm=01;35:*.rmvb=01;35:*.flc=01;35:*.avi=01;35:*.fli=01;35:*.flv=01;35:*.gl=01;35:*.dl=01;35:*.xcf=01;35:*.xwd=01;35:*.yuv=01;35:*.cgm=01;35:*.emf=01;35:*.ogv=01;35:*.ogx=01;35:*.aac=00;36:*.au=00;36:*.flac=00;36:*.m4a=00;36:*.mid=00;36:*.midi=00;36:*.mka=00;36:*.mp3=00;36:*.mpc=00;36:*.ogg=00;36:*.ra=00;36:*.wav=00;36:*.oga=00;36:*.opus=00;36:*.spx=00;36:*.xspf=00;36:
OLDPWD=/BA/workspace/src
PATH=/opt/ros/humble/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
OLDPWD=/
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/BA/workspace/build/joint_control
PYTHONPATH=/BA/workspace/build/joint_info:/BA/workspace/install/joint_info/lib/python3.10/site-packages:/BA/workspace/build/joint_control:/BA/workspace/install/joint_control/lib/python3.10/site-packages:/BA/workspace/src/build/joint_info:/BA/workspace/src/install/joint_info/lib/python3.10/site-packages:/BA/workspace/src/build/joint_control:/BA/workspace/src/install/joint_control/lib/python3.10/site-packages:/opt/ros/humble/lib/python3.10/site-packages:/opt/ros/humble/local/lib/python3.10/dist-packages
ROS_DISTRO=humble
ROS_LOCALHOST_ONLY=0
ROS_PYTHON_VERSION=3
ROS_VERSION=2
SHLVL=1
TERM=xterm
_=/usr/bin/colcon
_colcon_cd_root=/opt/ros/foxy/

View File

@ -1,9 +1,20 @@
package.xml
setup.cfg
setup.py
../../build/joint_control/joint_control.egg-info/PKG-INFO
../../build/joint_control/joint_control.egg-info/SOURCES.txt
../../build/joint_control/joint_control.egg-info/dependency_links.txt
../../build/joint_control/joint_control.egg-info/entry_points.txt
../../build/joint_control/joint_control.egg-info/requires.txt
../../build/joint_control/joint_control.egg-info/top_level.txt
../../build/joint_control/joint_control.egg-info/zip-safe
joint_control/__init__.py
joint_control/cart_tcp_server.py
joint_control/joint_angles_server.py
joint_control/plugdata.py
joint_control/plugdata2.py
joint_control/plugdata3.py
joint_control/test.py
joint_control/trajectory_server.py
joint_control/trajectory_server_cart.py
joint_control.egg-info/PKG-INFO

View File

@ -1,6 +1,10 @@
[console_scripts]
cart_coords = joint_control.cart_tcp_server:main
joint_control = joint_control.joint_angles_server:main
plugdata = joint_control.plugdata:main
plugdata2 = joint_control.plugdata2:main
plugdata3 = joint_control.plugdata3:main
test = joint_control.test:main
trajectory_server = joint_control.trajectory_server:main
trajectory_server_cart = joint_control.trajectory_server_cart:main

View File

@ -1,8 +1,8 @@
AMENT_PREFIX_PATH=/BA/workspace/install/joint_info:/BA/workspace/install/joint_control:/opt/ros/humble
AMENT_PREFIX_PATH=/opt/ros/humble:/BA/workspace/install/mock_robot:/BA/workspace/install/joint_info:/BA/workspace/install/joint_control
COLCON=1
COLCON_PREFIX_PATH=/BA/workspace/install
HOME=/root
HOSTNAME=3230bc57d699
HOSTNAME=0e38e264ac6b
LANG=C.UTF-8
LC_ALL=C.UTF-8
LD_LIBRARY_PATH=/opt/ros/humble/opt/rviz_ogre_vendor/lib:/opt/ros/humble/lib/x86_64-linux-gnu:/opt/ros/humble/lib
@ -10,7 +10,7 @@ LS_COLORS=rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd
OLDPWD=/BA/workspace/src
PATH=/opt/ros/humble/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
PWD=/BA/workspace/build/joint_info
PYTHONPATH=/BA/workspace/build/joint_info:/BA/workspace/install/joint_info/lib/python3.10/site-packages:/BA/workspace/build/joint_control:/BA/workspace/install/joint_control/lib/python3.10/site-packages:/BA/workspace/src/build/joint_info:/BA/workspace/src/install/joint_info/lib/python3.10/site-packages:/BA/workspace/src/build/joint_control:/BA/workspace/src/install/joint_control/lib/python3.10/site-packages:/opt/ros/humble/lib/python3.10/site-packages:/opt/ros/humble/local/lib/python3.10/dist-packages
PYTHONPATH=/opt/ros/humble/lib/python3.10/site-packages:/opt/ros/humble/local/lib/python3.10/dist-packages:/BA/workspace/build/mock_robot:/BA/workspace/install/mock_robot/lib/python3.10/site-packages:/BA/workspace/build/joint_info:/BA/workspace/install/joint_info/lib/python3.10/site-packages:/BA/workspace/build/joint_control:/BA/workspace/install/joint_control/lib/python3.10/site-packages
ROS_DISTRO=humble
ROS_LOCALHOST_ONLY=0
ROS_PYTHON_VERSION=3
@ -18,4 +18,3 @@ ROS_VERSION=2
SHLVL=1
TERM=xterm
_=/usr/bin/colcon
_colcon_cd_root=/opt/ros/foxy/

View File

@ -1,6 +1,13 @@
package.xml
setup.cfg
setup.py
../../build/joint_info/joint_info.egg-info/PKG-INFO
../../build/joint_info/joint_info.egg-info/SOURCES.txt
../../build/joint_info/joint_info.egg-info/dependency_links.txt
../../build/joint_info/joint_info.egg-info/entry_points.txt
../../build/joint_info/joint_info.egg-info/requires.txt
../../build/joint_info/joint_info.egg-info/top_level.txt
../../build/joint_info/joint_info.egg-info/zip-safe
joint_info/__init__.py
joint_info/osc_joint_states_pub.py
joint_info/osc_joint_states_sub.py

View File

@ -17,11 +17,6 @@ _colcon_prefix_chain_bash_source_script() {
fi
}
# source chained prefixes
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="/opt/ros/humble"
_colcon_prefix_chain_bash_source_script "$COLCON_CURRENT_PREFIX/local_setup.bash"
# source this prefix
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="$(builtin cd "`dirname "${BASH_SOURCE[0]}"`" > /dev/null && pwd)"

View File

@ -21,9 +21,6 @@ function _colcon_prefix_chain_powershell_source_script {
}
}
# source chained prefixes
_colcon_prefix_chain_powershell_source_script "/opt/ros/humble\local_setup.ps1"
# source this prefix
$env:COLCON_CURRENT_PREFIX=(Split-Path $PSCommandPath -Parent)
_colcon_prefix_chain_powershell_source_script "$env:COLCON_CURRENT_PREFIX\local_setup.ps1"

View File

@ -29,12 +29,6 @@ _colcon_prefix_chain_sh_source_script() {
fi
}
# source chained prefixes
# setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script
COLCON_CURRENT_PREFIX="/opt/ros/humble"
_colcon_prefix_chain_sh_source_script "$COLCON_CURRENT_PREFIX/local_setup.sh"
# source this prefix
# setting COLCON_CURRENT_PREFIX avoids relying on the build time prefix of the sourced script
COLCON_CURRENT_PREFIX="$_colcon_prefix_chain_sh_COLCON_CURRENT_PREFIX"

View File

@ -17,11 +17,6 @@ _colcon_prefix_chain_zsh_source_script() {
fi
}
# source chained prefixes
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="/opt/ros/humble"
_colcon_prefix_chain_zsh_source_script "$COLCON_CURRENT_PREFIX/local_setup.zsh"
# source this prefix
# setting COLCON_CURRENT_PREFIX avoids determining the prefix in the sourced script
COLCON_CURRENT_PREFIX="$(builtin cd -q "`dirname "${(%):-%N}"`" > /dev/null && pwd)"

View File

@ -1 +1 @@
build_2025-03-24_10-47-50
build_2025-04-07_10-59-55

View File

@ -1,12 +1,13 @@
from osc4py3.as_eventloop import *
from osc4py3 import oscbuildparse
import time
def main():
# Start the OSC system
osc_startup()
# Make client channels to send packets
osc_udp_client("127.0.0.1", 8000, "osc_client")
osc_udp_client("172.18.0.3", 8000, "osc_client")
# Example joint positions to send
@ -17,11 +18,32 @@ def main():
joint_positions5 = [-0.5,-0.6, 0.2,0.0, 0.0, 0.0]
msg = oscbuildparse.OSCMessage("/joint_trajectory", None, [joint_positions1, joint_positions2, joint_positions3, joint_positions4, joint_positions5])
print("Sending joint positions")
# Send the OSC message
osc_send(msg, "osc_client")
print("Sent joint positions")
osc_process()
print("Sending joint positions")
'''
time.sleep(2)
msg = oscbuildparse.OSCMessage("/tcp_coordinates", None, joint_positions2)
osc_send(msg, "osc_client")
osc_process()
print("Sent joint positions2")
time.sleep(3)
msg = oscbuildparse.OSCMessage("/tcp_coordinates", None, joint_positions3)
osc_send(msg, "osc_client")
osc_process()
print("Sent joint positions3")
time.sleep(3)
msg = oscbuildparse.OSCMessage("/tcp_coordinates", None, joint_positions4)
osc_send(msg, "osc_client")
osc_process()
print("Sent joint positions4")
time.sleep(3)
msg = oscbuildparse.OSCMessage("/tcp_coordinates", None, joint_positions5)
osc_send(msg, "osc_client")
osc_process()
print("Sent joint positions5")
time.sleep(3)
'''
osc_terminate()
if __name__ == "__main__":

View File

@ -33,7 +33,7 @@ class ScaledJointTrajectoryPublisher(Node):
def tcp_coordinates_handler(self, *args):
"""Handles incoming OSC messages for tcp position."""
#time1 = time.time()
time1 = time.time()
if len(args) == len(self.joint_positions):
x, y, z, roll, pitch, yaw = args
duration = 4.0 # Default duration
@ -62,10 +62,10 @@ class ScaledJointTrajectoryPublisher(Node):
if sol[1]:
joint_positions = list(sol[0])
self.send_trajectory(joint_positions, duration)
print(f"Computed joint positions: {joint_positions}")
#print(f"Computed joint positions: {joint_positions}")
else:
print("Inverse kinematics failed")
#print(f"Frequency: {1/(time.time() - time1)} Hz")
print(f"Frequency: {1/(time.time() - time1)} Hz")
def send_trajectory(self, joint_positions, duration=4.0):
"""Publish a joint trajectory command to move the robot."""

View File

@ -29,8 +29,10 @@ class ScaledJointTrajectoryPublisher(Node):
def joint_angles_handler(self, *args):
"""Handles incoming OSC messages for joint positions."""
print(args)
if len(args) == len(self.joint_positions):
self.joint_positions = args
self.joint_positions = list(args)
print(self.joint_positions)
self.send_trajectory(self.joint_positions)
elif len(args) == len(self.joint_positions) + 1:
self.joint_positions = args[:-1]
@ -39,11 +41,12 @@ class ScaledJointTrajectoryPublisher(Node):
def send_trajectory(self, joint_positions, duration=3.0):
def send_trajectory(self, joint_positions, duration=0.01):
"""Publish a joint trajectory command to move the robot."""
msg = JointTrajectory()
msg.joint_names = self.joint_names
point = JointTrajectoryPoint()
joint_positions = [float(joint) for joint in joint_positions]
point.positions = joint_positions # Updated joint positions
point.time_from_start.sec = int(duration)
point.time_from_start.nanosec = int((duration - int(duration)) * 1e9)
@ -55,8 +58,8 @@ class ScaledJointTrajectoryPublisher(Node):
def main():
"""Main function to get joint names and start the ROS 2 & OSC system."""
tree = ET.parse('/BA/robot.urdf')
robot_urdf = input("Enter the path to the URDF file: ")
tree = ET.parse(robot_urdf)
root = tree.getroot()
joint_names = [joint.get('name') for joint in root.findall('joint') if joint.get('type') == 'revolute' or joint.get('type') == 'continuous' or joint.get('type') == 'prismatic']

View File

@ -15,20 +15,26 @@ class ScaledJointTrajectoryPublisher(Node):
super().__init__('scaled_joint_trajectory_publisher')
self.robot = robot
self.trajectroy_topic_name = input("Enter the topic name to which the joint trajectory should be sent to: ")
if self.trajectroy_topic_name == "":
self.trajectroy_topic_name = '/scaled_joint_trajectory_controller/joint_trajectory'
# ROS2 Publisher
self.publisher = self.create_publisher(
JointTrajectory,
'/scaled_joint_trajectory_controller/joint_trajectory',
self.trajectroy_topic_name,
10
)
# Store received joint positions
self.joint_names = joint_names
self.port = 8000 # UDP port
osc_startup()
osc_udp_server("0.0.0.0", 8000, "osc_server")
print("Server started on 0.0.0.0:8000 \n ready to receive messages in the following format: /joint_trajectroy [tcp_coordinates0, tcp_coordinates1, ...] optional: timestamp as last element of each tcp_coordinates")
osc_udp_server("0.0.0.0", self.port, "osc_server")
print(f"Server started on 0.0.0.0:{str(self.port)} \n ready to receive messages in the following format: /joint_trajectroy [tcp_coordinates0, tcp_coordinates1, ...] optional: timestamp as last element of each tcp_coordinates")
# Register OSC handler
osc_method("/joint_trajectory", self.joint_angles_handler, argscheme=osm.OSCARG_DATAUNPACK)
@ -41,26 +47,53 @@ class ScaledJointTrajectoryPublisher(Node):
joint_positions = [0.0] * len(self.joint_names)
steps = 30
vel = 0.4
if len(args[0]) == len(self.joint_names):
if True: #len(args[0]) == len(self.joint_names):
n=2.0
for i in range(len(args)-1):
print(f'i = {i}')
x, y, z, roll, pitch, yaw = args[i]
print(1)
Tep1 = sm.SE3(x, y, z) * sm.SE3.RPY([roll, pitch, yaw], order='xyz')
print(2)
x, y, z, roll, pitch, yaw = args[i+1]
print(3)
Tep2 = sm.SE3(x, y, z) * sm.SE3.RPY([roll, pitch, yaw], order='xyz')
print(4)
cart_traj = rtb.ctraj(Tep1, Tep2, steps)
for j in range(steps-1):
print(cart_traj)
print(5)
for j in range(steps):
print(f'j = {j}')
print(6)
sol = self.robot.ik_LM(cart_traj[j], q0=joint_positions)
dist = np.linalg.norm(cart_traj[j].t - cart_traj[j+1].t)
point = JointTrajectoryPoint()
point.positions = list(sol[0])
joint_positions = list(sol[0])
point.time_from_start.sec = int(n)
point.time_from_start.nanosec = int((n - int(n)) * 1e9)
n+=dist/vel
n+=0.1
msg.points.append(point)
print(7)
if sol[1] == 1:
print(8)
if j == 0: dist = vel*n
else: dist = np.linalg.norm(cart_traj[j].t - cart_traj[j-1].t)
print(9)
point = JointTrajectoryPoint()
print(10)
point.positions = list(sol[0])
print(11)
joint_positions = list(sol[0])
print(12)
point.time_from_start.sec = int(n)
print(13)
point.time_from_start.nanosec = int((n - int(n)) * 1e9)
print(14)
n+=dist/vel
print(16)
msg.points.append(point)
print(17)
else: print('IK could not find a solution!')
print(18)
self.publisher.publish(msg)
print(19)
print(f"published joint positions {msg.points[-1]}")
print(f'Frequency: {round(1/(time.time()-time1),2)} Hz')
'''
elif len(args[0]) == len(self.joint_names) + 1:
for i in range(len(args)):
x, y, z, roll, pitch, yaw, timetag = args[i]
@ -72,20 +105,18 @@ class ScaledJointTrajectoryPublisher(Node):
sol = self.robot.ik_LM(Tep, q0=joint_positions)
else:
print("Invalid number or format of arguments")
print("Invalid number or format of arguments")'''
self.publisher.publish(msg)
print("published joint positions")
print(f'Frequency: {round(1/(time.time()-time1),2)} Hz')
def main():
"""Main function to get joint names and start the ROS 2 & OSC system."""
tree = ET.parse('/BA/robot.urdf')
path_to_urdf = input("Enter the path to the URDF file: ")
tree = ET.parse(path_to_urdf)
root = tree.getroot()
joint_names = [joint.get('name') for joint in root.findall('joint') if joint.get('type') == 'revolute' or joint.get('type') == 'continuous' or joint.get('type') == 'prismatic']
robot = rtb.ERobot.URDF('/BA/robot.urdf')
robot = rtb.ERobot.URDF(path_to_urdf)
print(robot)
rclpy.init()
node = ScaledJointTrajectoryPublisher(joint_names, robot)

View File

@ -25,6 +25,10 @@ setup(
'cart_coords = joint_control.cart_tcp_server:main',
'trajectory_server = joint_control.trajectory_server:main',
'trajectory_server_cart = joint_control.trajectory_server_cart:main',
'plugdata = joint_control.plugdata:main',
'plugdata2 = joint_control.plugdata2:main',
'test=joint_control.test:main',
'plugdata3 = joint_control.plugdata3:main',
],
},
)