Skip to content

Commit

Permalink
fix: arm ros2 model
Browse files Browse the repository at this point in the history
  • Loading branch information
KeseterG committed Oct 6, 2024
1 parent dd9a484 commit afa8120
Show file tree
Hide file tree
Showing 3 changed files with 63 additions and 66 deletions.
Original file line number Diff line number Diff line change
@@ -1,64 +1,63 @@
<?xml version="1.0"?>
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<xacro:macro name="WalliArm_V2_Block_base_ros2_control" params="name initial_positions_file">
<xacro:property name="initial_positions" value="${load_yaml(initial_positions_file)['initial_positions']}"/>
<xacro:macro name="WalliArm_V2_Block_base_ros2_control" params="name initial_positions_file">
<xacro:property name="initial_positions"
value="${load_yaml(initial_positions_file)['initial_positions']}" />

<ros2_control name="${name}" type="system">
<hardware>
<!-- By default, set up controllers for simulation. This won't work on real hardware -->
<plugin>mock_components/GenericSystem</plugin>
</hardware>
<joint name="base_yaw_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<command_interface name="effort"/>
<state_interface name="position">
<param name="initial_value">${initial_positions['base_yaw_joint']}</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="upper_arm_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<command_interface name="effort"/>
<state_interface name="position">
<param name="initial_value">${initial_positions['upper_arm_joint']}</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="fore_arm_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<command_interface name="effort"/>
<state_interface name="position">
<param name="initial_value">${initial_positions['fore_arm_joint']}</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="ee_roll_jont">
<command_interface name="position"/>
<command_interface name="velocity"/>
<command_interface name="effort"/>
<state_interface name="position">
<param name="initial_value">${initial_positions['ee_roll_jont']}</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<joint name="ee_pitch_joint">
<command_interface name="position"/>
<command_interface name="velocity"/>
<command_interface name="effort"/>
<state_interface name="position">
<param name="initial_value">${initial_positions['ee_pitch_joint']}</param>
</state_interface>
<state_interface name="velocity"/>
<state_interface name="effort"/>
</joint>
<ros2_control name="${name}" type="system">
<hardware>
<!-- By default, set up controllers for simulation. This won't work on real hardware -->
<plugin>mock_components/GenericSystem</plugin>
</hardware>
<joint name="base_yaw_joint">
<command_interface name="position" />
<command_interface name="velocity" />
<state_interface name="position">
<param name="initial_value">${initial_positions['base_yaw_joint']}</param>
</state_interface>
<state_interface name="velocity" />
</joint>
<joint name="upper_arm_joint">
<command_interface name="position" />
<command_interface name="velocity" />
<command_interface name="effort" />
<state_interface name="position">
<param name="initial_value">${initial_positions['upper_arm_joint']}</param>
</state_interface>
<state_interface name="velocity" />

</ros2_control>
</xacro:macro>
</robot>
</joint>
<joint name="fore_arm_joint">
<command_interface name="position" />
<command_interface name="velocity" />
<command_interface name="effort" />
<state_interface name="position">
<param name="initial_value">${initial_positions['fore_arm_joint']}</param>
</state_interface>
<state_interface name="velocity" />

</joint>
<joint name="ee_roll_jont">
<command_interface name="position" />
<command_interface name="velocity" />
<command_interface name="effort" />
<state_interface name="position">
<param name="initial_value">${initial_positions['ee_roll_jont']}</param>
</state_interface>
<state_interface name="velocity" />

</joint>
<joint name="ee_pitch_joint">
<command_interface name="position" />
<command_interface name="velocity" />
<command_interface name="effort" />
<state_interface name="position">
<param name="initial_value">${initial_positions['ee_pitch_joint']}</param>
</state_interface>
<state_interface name="velocity" />

</joint>

</ros2_control>
</xacro:macro>
</robot>
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
<xacro:include filename="WalliArm_V2_Block_base.ros2_control.xacro" />


<xacro:WalliArm_V2_Block_base_ros2_control name="FakeSystem" initial_positions_file="$(arg initial_positions_file)"/>
<xacro:WalliArm_V2_Block_base_ros2_control name="FakeSystem"
initial_positions_file="$(arg initial_positions_file)" />

</robot>
</robot>
5 changes: 1 addition & 4 deletions walli_arm_v2_moveit_config/config/ros2_controllers.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
# This config file is used by ros2_control
controller_manager:
ros__parameters:
update_rate: 100 # Hz
update_rate: 100 # Hz

walli_arm_v2_block_controller:
type: joint_trajectory_controller/JointTrajectoryController


joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster

Expand All @@ -21,8 +20,6 @@ walli_arm_v2_block_controller:
command_interfaces:
- position
- velocity
- effort
state_interfaces:
- position
- velocity
- effort

0 comments on commit afa8120

Please sign in to comment.