-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added inertial properties of links with macro taken from franka_ros.
- Loading branch information
Showing
13 changed files
with
791 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
#!/usr/bin/env python3 | ||
|
||
import os | ||
|
||
from ament_index_python.packages import get_package_share_directory | ||
from launch import LaunchDescription | ||
from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription, Shutdown | ||
from launch.conditions import IfCondition, UnlessCondition | ||
from launch.launch_description_sources import PythonLaunchDescriptionSource | ||
from launch.substitutions import Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution | ||
from launch_ros.actions import Node | ||
from launch_ros.substitutions import FindPackageShare | ||
|
||
def generate_launch_description(): | ||
robot_ip_parameter_name = 'robot_ip' | ||
load_gripper_parameter_name = 'load_gripper' | ||
use_fake_hardware_parameter_name = 'use_fake_hardware' | ||
fake_sensor_commands_parameter_name = 'fake_sensor_commands' | ||
use_rviz_parameter_name = 'use_rviz' | ||
|
||
robot_ip = LaunchConfiguration(robot_ip_parameter_name) | ||
load_gripper = LaunchConfiguration(load_gripper_parameter_name) | ||
use_fake_hardware = LaunchConfiguration(use_fake_hardware_parameter_name) | ||
fake_sensor_commands = LaunchConfiguration(fake_sensor_commands_parameter_name) | ||
use_rviz = LaunchConfiguration(use_rviz_parameter_name) | ||
|
||
franka_xacro_file = os.path.join(get_package_share_directory('my_panda_description'), 'robots', | ||
'panda_arm.urdf.xacro') | ||
robot_description = Command( | ||
[FindExecutable(name='xacro'), ' ', franka_xacro_file, ' hand:=', load_gripper, | ||
' robot_ip:=', robot_ip, ' use_fake_hardware:=', use_fake_hardware, | ||
' fake_sensor_commands:=', fake_sensor_commands]) | ||
|
||
rviz_file = os.path.join(get_package_share_directory('my_panda_viz'), 'rviz', | ||
'visualize_franka.rviz') | ||
|
||
franka_controllers = PathJoinSubstitution( | ||
[ | ||
FindPackageShare('my_panda_controller'), | ||
'config', | ||
'controllers.yaml', | ||
] | ||
) | ||
|
||
return LaunchDescription([ | ||
DeclareLaunchArgument( | ||
robot_ip_parameter_name, | ||
description='Hostname or IP address of the robot.'), | ||
DeclareLaunchArgument( | ||
use_rviz_parameter_name, | ||
default_value='false', | ||
description='Visualize the robot in Rviz'), | ||
DeclareLaunchArgument( | ||
use_fake_hardware_parameter_name, | ||
default_value='false', | ||
description='Use fake hardware'), | ||
DeclareLaunchArgument( | ||
fake_sensor_commands_parameter_name, | ||
default_value='false', | ||
description="Fake sensor commands. Only valid when '{}' is true".format( | ||
use_fake_hardware_parameter_name)), | ||
DeclareLaunchArgument( | ||
load_gripper_parameter_name, | ||
default_value='true', | ||
description='Use Franka Gripper as an end-effector, otherwise, the robot is loaded ' | ||
'without an end-effector.'), | ||
Node( | ||
package='robot_state_publisher', | ||
executable='robot_state_publisher', | ||
name='robot_state_publisher', | ||
output='screen', | ||
parameters=[{'robot_description': robot_description}], | ||
), | ||
Node( | ||
package='joint_state_publisher', | ||
executable='joint_state_publisher', | ||
name='joint_state_publisher', | ||
parameters=[ | ||
{'source_list': ['franka/joint_states', 'panda_gripper/joint_states'], | ||
'rate': 30}], | ||
), | ||
Node( | ||
package='controller_manager', | ||
executable='ros2_control_node', | ||
parameters=[{'robot_description': robot_description}, franka_controllers], | ||
remappings=[('joint_states', 'franka/joint_states')], | ||
output={ | ||
'stdout': 'screen', | ||
'stderr': 'screen', | ||
}, | ||
on_exit=Shutdown(), | ||
), | ||
Node( | ||
package='controller_manager', | ||
executable='spawner', | ||
arguments=['joint_state_broadcaster'], | ||
output='screen', | ||
), | ||
Node( | ||
package='controller_manager', | ||
executable='spawner', | ||
arguments=['franka_robot_state_broadcaster'], | ||
output='screen', | ||
condition=UnlessCondition(use_fake_hardware), | ||
), | ||
IncludeLaunchDescription( | ||
PythonLaunchDescriptionSource([PathJoinSubstitution( | ||
[FindPackageShare('franka_gripper'), 'launch', 'gripper.launch.py'])]), | ||
launch_arguments={robot_ip_parameter_name: robot_ip, | ||
use_fake_hardware_parameter_name: use_fake_hardware}.items(), | ||
condition=IfCondition(load_gripper) | ||
), | ||
|
||
Node(package='rviz2', | ||
executable='rviz2', | ||
name='rviz2', | ||
arguments=['--display-config', rviz_file], | ||
condition=IfCondition(use_rviz) | ||
) | ||
|
||
]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,139 @@ | ||
controller_manager: | ||
ros__parameters: | ||
update_rate: 1000 # Hz | ||
|
||
gravity_compensation_example_controller: | ||
type: franka_example_controllers/GravityCompensationExampleController | ||
|
||
joint_impedance_example_controller: | ||
type: franka_example_controllers/JointImpedanceExampleController | ||
|
||
joint_velocity_example_controller: | ||
type: franka_example_controllers/JointVelocityExampleController | ||
|
||
joint_position_example_controller: | ||
type: franka_example_controllers/JointPositionExampleController | ||
|
||
cartesian_velocity_example_controller: | ||
type: franka_example_controllers/CartesianVelocityExampleController | ||
|
||
cartesian_pose_example_controller: | ||
type: franka_example_controllers/CartesianPoseExampleController | ||
|
||
cartesian_pose_elbow_example_controller: | ||
type: franka_example_controllers/CartesianElbowExampleController | ||
|
||
joint_impedance_with_ik_example_controller: | ||
type: franka_example_controllers/JointImpedanceWithIKExampleController | ||
|
||
cartesian_orientation_example_controller: | ||
type: franka_example_controllers/CartesianOrientationExampleController | ||
|
||
elbow_example_controller: | ||
type: franka_example_controllers/ElbowExampleController | ||
|
||
move_to_start_example_controller: | ||
type: franka_example_controllers/MoveToStartExampleController | ||
|
||
model_example_controller: | ||
type: franka_example_controllers/ModelExampleController | ||
|
||
joint_trajectory_controller: | ||
type: joint_trajectory_controller/JointTrajectoryController | ||
|
||
joint_state_broadcaster: | ||
type: joint_state_broadcaster/JointStateBroadcaster | ||
|
||
franka_robot_state_broadcaster: | ||
type: franka_robot_state_broadcaster/FrankaRobotStateBroadcaster | ||
|
||
joint_impedance_with_ik_example_controller: | ||
ros__parameters: | ||
arm_id: panda | ||
k_gains: | ||
- 600.0 | ||
- 600.0 | ||
- 600.0 | ||
- 600.0 | ||
- 250.0 | ||
- 150.0 | ||
- 50.0 | ||
d_gains: | ||
- 30.0 | ||
- 30.0 | ||
- 30.0 | ||
- 30.0 | ||
- 10.0 | ||
- 10.0 | ||
- 5. | ||
|
||
franka_robot_state_broadcaster: | ||
ros__parameters: | ||
arm_id: panda | ||
|
||
model_example_controller: | ||
ros__parameters: | ||
arm_id: panda | ||
|
||
joint_trajectory_controller: | ||
ros__parameters: | ||
joints: | ||
- panda_joint1 | ||
- panda_joint2 | ||
- panda_joint3 | ||
- panda_joint4 | ||
- panda_joint5 | ||
- panda_joint6 | ||
- panda_joint7 | ||
command_interfaces: | ||
- effort | ||
state_interfaces: | ||
- position | ||
- velocity | ||
gains: | ||
panda_joint1: { p: 600., d: 30., i: 0., i_clamp: 1. } | ||
panda_joint2: { p: 600., d: 30., i: 0., i_clamp: 1. } | ||
panda_joint3: { p: 600., d: 30., i: 0., i_clamp: 1. } | ||
panda_joint4: { p: 600., d: 30., i: 0., i_clamp: 1. } | ||
panda_joint5: { p: 250., d: 10., i: 0., i_clamp: 1. } | ||
panda_joint6: { p: 150., d: 10., i: 0., i_clamp: 1. } | ||
panda_joint7: { p: 50., d: 5., i: 0., i_clamp: 1. } | ||
|
||
joint_impedance_example_controller: | ||
ros__parameters: | ||
arm_id: panda | ||
k_gains: | ||
- 24.0 | ||
- 24.0 | ||
- 24.0 | ||
- 24.0 | ||
- 10.0 | ||
- 6.0 | ||
- 2.0 | ||
d_gains: | ||
- 2.0 | ||
- 2.0 | ||
- 2.0 | ||
- 1.0 | ||
- 1.0 | ||
- 1.0 | ||
- 0.5 | ||
move_to_start_example_controller: | ||
ros__parameters: | ||
arm_id: panda | ||
k_gains: | ||
- 600.0 | ||
- 600.0 | ||
- 600.0 | ||
- 600.0 | ||
- 250.0 | ||
- 150.0 | ||
- 50.0 | ||
d_gains: | ||
- 30.0 | ||
- 30.0 | ||
- 30.0 | ||
- 30.0 | ||
- 10.0 | ||
- 10.0 | ||
- 5. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.