123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- package at.acdp.urweb;
- import at.acdp.urweb.fhpp.FHMaster;
- import at.acdp.urweb.fhpp.FHMasterSim;
- import at.acdp.urweb.fhpp.IFHMaster;
- import at.acdp.urweb.rtde.RTDEClient;
- import at.acdp.urweb.rtde.packets.*;
- import at.acdp.urweb.web.FestoXRServer;
- import com.nmote.nanohttp.NanoServer;
- import com.nmote.xr.HTTPServerEndpoint;
- import com.nmote.xr.XR;
- import org.slf4j.LoggerFactory;
- public class Main {
- private final static org.slf4j.Logger logger = LoggerFactory.getLogger(Main.class);
- public static IFHMaster fhm=new FHMaster();
- public static void main(String[] args) {
- Params app = null;
- try {
- app = picocli.CommandLine.populateCommand(new Params(), args);
- if(app==null) {
- System.exit(1);
- }
- NanoServer server = new NanoServer("http://0.0.0.0:" + app.port);
- RTDEClient r=new RTDEClient("127.0.0.1", 30004);
- var so=new RtdeSetupOutputs()
- .addVariable("timestamp")
- .addVariable("robot_mode")
- .addVariable("safety_mode")
- .addVariable("safety_status")
- .addVariable("target_speed_fraction")
- .addVariable("runtime_state")
- .addVariable("speed_scaling");
- r.start(so);
- PosThread p=new PosThread(r, fhm);
- p.start();
- FestoXRServer fxrs = new FestoXRServer(r);
- HTTPServerEndpoint xrs = XR.server(fxrs, FestoXRServer.class);
- server.add(xrs);
- server.start();
- } catch (Exception e) {
- logger.error("Server exited", e);
- }
- try {
- fhm.start(app);
- } catch (Exception e) {
- logger.error("failed.", e);
- picocli.CommandLine.usage(new Params(), System.out);
- System.exit(1);
- }
- }
- }
|