test
This commit is contained in:
@@ -1,12 +1,10 @@
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import DeclareLaunchArgument, OpaqueFunction
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch.actions import DeclareLaunchArgument, OpaqueFunction, RegisterEventHandler
|
||||
from launch.event_handlers import OnProcessExit
|
||||
from launch.actions import RegisterEventHandler
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
from webots_ros2_driver.urdf_spawner import URDFSpawner
|
||||
|
||||
|
||||
from iiwa_utils import converter
|
||||
|
||||
|
||||
@@ -22,6 +20,7 @@ def _setup_controllers(context, *args, **kwargs):
|
||||
controller = LaunchConfiguration("controller").perform(context) # "jtc" | "forward"
|
||||
fri_cycle_ms = int(LaunchConfiguration("fri_cycle_ms").perform(context))
|
||||
joint_position_tau = LaunchConfiguration("joint_position_tau").perform(context)
|
||||
joint_velocity_tau = LaunchConfiguration("joint_velocity_tau").perform(context)
|
||||
update_rate = 1000 // fri_cycle_ms
|
||||
|
||||
xacro_args = {"initial_positions_file": initial_positions_file}
|
||||
@@ -30,6 +29,7 @@ def _setup_controllers(context, *args, **kwargs):
|
||||
xacro_args["simulate"] = "true"
|
||||
else:
|
||||
xacro_args["joint_position_tau"] = joint_position_tau
|
||||
xacro_args["joint_velocity_tau"] = joint_velocity_tau
|
||||
|
||||
robot_description = converter.load_robot_description(
|
||||
model_path=description,
|
||||
@@ -139,6 +139,7 @@ def generate_launch_description():
|
||||
return LaunchDescription([
|
||||
DeclareLaunchArgument("fri_cycle_ms", default_value="5"),
|
||||
DeclareLaunchArgument("joint_position_tau", default_value="0.04"),
|
||||
DeclareLaunchArgument("joint_velocity_tau", default_value="0.01"),
|
||||
DeclareLaunchArgument("controller", default_value="jtc"),
|
||||
OpaqueFunction(function=_setup_controllers),
|
||||
])
|
||||
|
||||
Reference in New Issue
Block a user