Переработана вся структура запуска файлов. Теперь в iiwa_bringup хранятся только launch файлы.
Все конфигурационные файлы переехали в пакет `iiwa_config`. также там появился общий конфигурационный файл, который упращает запуск `digital_twin.launch.py` Добавлен дополнительный пакет `iiwa_utils`, в который переехал весь код с папки `iiwa_bringup/utils`, а также все тестовые ноды переехали с `iiwa_object_spawner` в этот пакет Пакеты `iiwa_bringup` и `iiwa_description` переведены на `ament_cmake` для дальнейшего удобсва - пакеты не будут содержать код для реализации
This commit is contained in:
@@ -4,23 +4,26 @@ from launch.substitutions import LaunchConfiguration
|
||||
from launch_ros.actions import Node
|
||||
from webots_ros2_driver.urdf_spawner import URDFSpawner
|
||||
|
||||
|
||||
from iiwa_bringup.utils import converter
|
||||
from iiwa_utils import converter
|
||||
|
||||
|
||||
def _setup_controllers(context, *args, **kwargs):
|
||||
xacro_file = LaunchConfiguration("xacro_file").perform(context)
|
||||
robot_name = LaunchConfiguration("robot_name").perform(context)
|
||||
description = LaunchConfiguration("description").perform(context)
|
||||
transform = LaunchConfiguration("transform").perform(context)
|
||||
rotation = LaunchConfiguration("rotation").perform(context)
|
||||
timer = LaunchConfiguration("controller_timer").perform(context)
|
||||
|
||||
robot_description = converter.load_robot_description(
|
||||
model_path=xacro_file, robot_name=robot_name
|
||||
controller_timer = LaunchConfiguration("controller_timer").perform(context)
|
||||
initial_positions_file = LaunchConfiguration("initial_positions_file").perform(
|
||||
context
|
||||
)
|
||||
|
||||
tmo = ["--controller-manager-timeout", str(timer)]
|
||||
|
||||
robot_description = converter.load_robot_description(
|
||||
model_path=description,
|
||||
robot_name=robot_name,
|
||||
xacro_args={"initial_positions_file": initial_positions_file},
|
||||
)
|
||||
|
||||
tmo = ["--controller-manager-timeout", str(controller_timer)]
|
||||
|
||||
jsb = Node(
|
||||
package="controller_manager",
|
||||
|
||||
@@ -16,24 +16,28 @@ from webots_ros2_driver.webots_launcher import WebotsLauncher
|
||||
|
||||
|
||||
def _spawn_setup(context, *args, **kwargs):
|
||||
xacro_file = LaunchConfiguration("xacro_file").perform(context)
|
||||
robot_name = LaunchConfiguration("robot_name").perform(context)
|
||||
world_path = LaunchConfiguration("world").perform(context)
|
||||
description = LaunchConfiguration("description").perform(context)
|
||||
world = LaunchConfiguration("world").perform(context)
|
||||
transform = LaunchConfiguration("transform").perform(context)
|
||||
rotation = LaunchConfiguration("rotation").perform(context)
|
||||
timer = LaunchConfiguration("controller_timer").perform(context)
|
||||
controller_timer = LaunchConfiguration("controller_timer").perform(context)
|
||||
controller = LaunchConfiguration("controller").perform(context)
|
||||
initial_positions_file = LaunchConfiguration("initial_positions_file").perform(
|
||||
context
|
||||
)
|
||||
|
||||
webots = WebotsLauncher(world=world_path, ros2_supervisor=True)
|
||||
webots = WebotsLauncher(world=world, ros2_supervisor=True)
|
||||
|
||||
driver = WebotsController(
|
||||
robot_name=robot_name,
|
||||
parameters=[
|
||||
{
|
||||
"robot_description": xacro_file,
|
||||
"robot_description": description,
|
||||
"use_sim_time": False,
|
||||
"set_robot_state_publisher": False,
|
||||
},
|
||||
LaunchConfiguration("controller").perform(context),
|
||||
controller,
|
||||
],
|
||||
respawn=True,
|
||||
)
|
||||
@@ -51,10 +55,11 @@ def _spawn_setup(context, *args, **kwargs):
|
||||
),
|
||||
launch_arguments={
|
||||
"robot_name": robot_name,
|
||||
"xacro_file": xacro_file,
|
||||
"description": description,
|
||||
"transform": transform,
|
||||
"rotation": rotation,
|
||||
"controller_timer": timer,
|
||||
"controller_timer": controller_timer,
|
||||
"initial_positions_file": initial_positions_file,
|
||||
}.items(),
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user