Skip to content

Commit

Permalink
Mock Franka Setup fixed for ros2 controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
yilmazabdurrah committed Nov 26, 2024
1 parent fcd9d4d commit 4dad4aa
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 3 deletions.
34 changes: 34 additions & 0 deletions franka_moveit_config/config/panda_mock_ros_controllers.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
controller_manager:
ros__parameters:
update_rate: 1000 # Hz

panda_arm_controller:
type: joint_trajectory_controller/JointTrajectoryController

joint_state_broadcaster:
type: joint_state_broadcaster/JointStateBroadcaster


panda_arm_controller:
ros__parameters:
command_interfaces:
- position # for real arm: -effort, for fake arm: -position
state_interfaces:
- position
- velocity
joints:
- panda_joint1
- panda_joint2
- panda_joint3
- panda_joint4
- panda_joint5
- panda_joint6
- panda_joint7
gains:
panda_joint1: { p: 600., d: 30., i: 0., i_clamp: 1., ff_velocity_scale: 1. }
panda_joint2: { p: 600., d: 30., i: 0., i_clamp: 1., ff_velocity_scale: 1. }
panda_joint3: { p: 600., d: 30., i: 0., i_clamp: 1., ff_velocity_scale: 1. }
panda_joint4: { p: 600., d: 30., i: 0., i_clamp: 1., ff_velocity_scale: 1. }
panda_joint5: { p: 250., d: 10., i: 0., i_clamp: 1., ff_velocity_scale: 1. }
panda_joint6: { p: 150., d: 10., i: 0., i_clamp: 1., ff_velocity_scale: 1. }
panda_joint7: { p: 50., d: 5., i: 0., i_clamp: 1., ff_velocity_scale: 1. }
Original file line number Diff line number Diff line change
Expand Up @@ -219,19 +219,21 @@ def generate_launch_description():
package='robot_state_publisher',
executable='robot_state_publisher',
name='robot_state_publisher',
output='both',
output='screen',
parameters=[robot_description],
remappings=[('joint_states', 'franka/joint_states')],
)

ros2_controllers_path = os.path.join(
get_package_share_directory('franka_moveit_config'),
'config',
'panda_ros_controllers.yaml',
'panda_mock_ros_controllers.yaml' if use_fake_hardware else 'panda_ros_controllers.yaml',
)

ros2_control_node = Node(
package='controller_manager',
executable='ros2_control_node',
parameters=[robot_description, ros2_controllers_path],
parameters=[robot_description, ros2_controllers_path], #[ros2_controllers_path]
remappings=[('joint_states', 'franka/joint_states')],
output={
'stdout': 'screen',
Expand Down

0 comments on commit 4dad4aa

Please sign in to comment.