launch.arg = { "nrovers": str(nrovers), "F": str(F), "nbad": str(nbad), "ngood": str(ngood), "rover_numbers_list": str(rover_numbers_list), "radius": str(radius), "umax": str(umax), "pi": str(pi), "ds": str(ds), "Rs": str(Rs), "Rc": str(Rc), "el": str(el) } launch.node = [] barrier = ezl.node(name="barrier_node", output="screen", pkg="rbf", type="barrier", launch_prefix="xterm -e gdb -ex run --args") barrier.defparam = [ "nrovers", "F", "nbad", "ngood", "rover_numbers_list", "radius", "umax", "pi", "ds", "Rs", "Rc", "el" ] launch.node.append(barrier) launch.write(filename="./2rovers_rbf.launch")
launch.include = [] # include element - empty_world.launch ew = el.include(file="$(find gazebo_ros)/launch/empty_world.launch") ew.arg = { "world_name": "$(find rcomv_uav)/worlds/basic.world", "paused": "true" } launch.include.append(ew) ## Node elements launch.node = [] switch_node = el.node(launch_prefix="xterm -e", name="switch_node", output="screen", pkg="rcomv_r1", type="switch") launch.node.append(switch_node) msrpa_node = el.node(launch_prefix="xterm -e gdb -ex run --args", name="msrpa_node", output="screen", pkg="rcomv_r1", type="msrpa_node") msrpa_node.defparam = [ "n", "k", "F", "eta", "radius", "t0", "xc", "yc", "Rad", "wd", "phi0", "leng", "psi", "v", "start_L", "common_namespace" ] array_msrpa = msrpa_node.copy(n)
"z": "0.1", "rover_number": str(j + 1), "agent_index": str(j + 1), "ugv_name": "R" + str(j + 1), "name_space": "R" + str(j + 1), "Ri": str(formation_r), "alphai": str(formation_angle[j]) } ugv_list[j].arg.update(temp_args) launch.include += ugv_list ## Node elements launch.node = [] # switch_node = el.node(launch_prefix="xterm -e", name="switch_node", output="screen", pkg="rcomv_r1", type="switch") # launch.node.append(switch_node) builder_node = el.node(name="builder_node", output="screen", pkg="state_graph_builder", type="builder", launch_prefix="xterm -e gdb -ex run --args") builder_node.defparam = ["n", "gazebo"] builder_node.param = {"base_ns": "/R"} launch.node.append(builder_node) ## Write the file launch.write(filename="./n_agent_circletraj_circleform.launch")
ew = el.include(file="$(find gazebo_ros)/launch/empty_world.launch") ew.arg = { "world_name": "$(find rcomv_r1)/worlds/basic.world", "paused": "true" } launch.include.append(ew) ## Node elements launch.node = [] # Trucks in a circle! number_of_trucks = 2 radius = 40 truck = el.node(name="obs", pkg="gazebo_ros", type="spawn_model") truck_array = truck.copy(number_of_trucks) args_string = "-file $(find rcomv_r1)/models/pickup/model.sdf -sdf -model " for i in range(number_of_trucks): truck_array[i].args = args_string + truck_array[i].name + " -x " + str( round(radius * cos(i * 2 * pi / number_of_trucks), 2)) + " -y " + str( round(radius * sin(i * 2 * pi / number_of_trucks), 2)) launch.node += truck_array ## Write the file # Command line option if len(sys.argv) > 1: launchfile_name = sys.argv[
"agent_index": str(j + 1), "ugv_name": "R" + str(j + 1), "name_space": "R" + str(j + 1), "Ri": str(formation_r), "alphai": str(formation_angle[j]) } ugv_list[j].arg.update(temp_args) launch.include += ugv_list ## Node elements launch.node = [] # Switch node switch_node = el.node(name="switch_node", pkg="rcomv_r1", type="switch") launch.node.append(switch_node) # Ugv nodes builder_node = el.node(name="builder_node", pkg="state_graph_builder", type="builder") builder_node.defparam = ["n", "gazebo"] builder_node.param = {"base_ns": "/R"} launch.node.append(builder_node) # MS-RPA nodes msrpa_node = el.node(name="msrpa_node", pkg="rcomv_r1", type="msrpa_node") msrpa_node.defparam = [ "n", "k", "F", "eta", "radius", "t0", "xc", "yc", "Rad", "wd", "phi0", "leng", "psi", "v", "start_L", "common_namespace"