Aufgrund einer Wartung wird GitLab am 18.01. zwischen 8:00 und 9:00 Uhr kurzzeitig nicht zur Verfügung stehen. / Due to maintenance, GitLab will be temporarily unavailable on 18.01. between 8:00 and 9:00 am.

Commit ee2a1caf authored by Mattis Hoppe's avatar Mattis Hoppe
Browse files

added GUI for RL

parent 60f5fa39
Pipeline #493731 failed with stage
in 54 seconds
{
"name": "rl_autopilot",
"map_name": "aachen",
"max_duration": [10,0],
"tick_duration": [0,10000000],
"cars": [
{
"start_pos": [ -123.09, 21.64 ],
"start_orientation": -30.0,
"task": {
"goals": [
{
"type": "path",
"ltl_operator": "eventually",
"path": [ [-63.83, -171.96] ],
"range": 5
}
]
},
"components": [
{
"type": "constant_bus",
"connected_to": [
"SteeringActuator",
"BrakingActuator",
"GasActuator",
"TrueVelocitySensor",
"TruePositionSensor",
"TrueCompassSensor",
"Navigation",
"RLAutopilot"
]
},
{
"type": "actuator",
"name": "SteeringActuator",
"physical_value_name": "steering",
"change_rate": 60.0,
"sensor": { "type": "sensor" }
},
{
"type": "actuator",
"name": "BrakingActuator",
"physical_value_name": "braking",
"change_rate": 10.0,
"sensor": { "type": "sensor" }
},
{
"type": "actuator",
"name": "GasActuator",
"physical_value_name": "gas",
"sensor": { "type": "sensor" }
},
{
"type": "sensor",
"name": "TrueVelocitySensor",
"physical_value_name": "true_velocity"
},
{
"type": "sensor",
"name": "TruePositionSensor",
"physical_value_name": "true_position"
},
{
"type": "sensor",
"name": "TrueCompassSensor",
"physical_value_name": "true_compass"
},
{ "type": "navigation" },
{
"type": "rl_autopilot",
"name": "RLAutopilot",
"maxVehicleAccel": 7.460690450979396
}
]
}
]
}
......@@ -23,6 +23,7 @@ import de.rwth.montisim.simulation.simulator.visualization.ui.SimulationRunner;
import de.rwth.montisim.simulation.simulator.visualization.ui.UIInfo;
import de.rwth.montisim.simulation.simulator.visualization.ui.Viewer2D;
import de.rwth.montisim.simulation.vehicle.Vehicle;
import de.rwth.montisim.simulation.simulator.visualization.rl.RLVisualizer;
import javax.swing.*;
import java.awt.Color;
......@@ -35,6 +36,12 @@ import java.time.*;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import org.ros.exception.RosRuntimeException;
import org.ros.node.DefaultNodeMainExecutor;
import org.ros.node.NodeConfiguration;
import org.ros.node.NodeMain;
import org.ros.node.NodeMainExecutor;
public class ScenarioVis extends SimVis implements SimulationRunner {
private static final long serialVersionUID = 7903217594061845406L;
......@@ -96,7 +103,15 @@ public class ScenarioVis extends SimVis implements SimulationRunner {
e1.printStackTrace();
return;
}
simulator = simConfig.build(world, pathfinding, map);
if(current_scenario.charAt(0) == 'r' && current_scenario.charAt(1) == 'l'){
System.out.println(pathfinding == null);
RLVisualizer viz = new RLVisualizer(world, map, pathfinding, simConfig, viewer, simConfig.start_time);
viz.init();
return;
}
else{
simulator = simConfig.build(world, pathfinding, map);
}
// Setup visualizer
......@@ -117,6 +132,7 @@ public class ScenarioVis extends SimVis implements SimulationRunner {
viewer.repaint();
}
void setView(Collection<Vehicle> vehicles) {
Vec2 avg_pos = new Vec2(0, 0);
int count = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment