Exemplo n.º 1
0
 public PlanningOptions(PlanningScene planning_scene_diff, bool plan_only, bool look_around, int look_around_attempts, double max_safe_execution_cost, bool replan, int replan_attempts, double replan_delay)
 {
     this.planning_scene_diff     = planning_scene_diff;
     this.plan_only               = plan_only;
     this.look_around             = look_around;
     this.look_around_attempts    = look_around_attempts;
     this.max_safe_execution_cost = max_safe_execution_cost;
     this.replan          = replan;
     this.replan_attempts = replan_attempts;
     this.replan_delay    = replan_delay;
 }
Exemplo n.º 2
0
        // this gets called when we're connected to the master
        async void Start()
        {
            Uri masterUri = new Uri("http://141.3.59.5:11311");
            Uri myUri     = RosClient.TryGetCallerUriFor(masterUri, 7635) ?? RosClient.TryGetCallerUri(7635);

            connectionClient = await RosClient.CreateAsync(masterUri, "/iviz_test", myUri);

            scenePublisher = new RosChannelWriter <PlanningScene> {
                LatchingEnabled = true
            };
            await scenePublisher.StartAsync(connectionClient, "/move_group/monitored_planning_scene");

            //Logger.LogDebug = Debug.Log;
            Logger.Log      = Debug.Log;
            Logger.LogError = Debug.LogWarning;

            Debug.Log($"{this}: Connected!");
            while (true)
            {
                if (this == null)
                {
                    return;
                }

                // keep checking whether the moveit_test node is on
                const string trajectoryService = "/moveit_test/calculate_trajectory";
                var          systemState       = await connectionClient.GetSystemStateAsync();

                bool hasService = systemState.Services.Any(service => service.Topic == trajectoryService);
                if (hasService)
                {
                    break;
                }

                Debug.LogWarning($"{this}: Service not detected! Retrying...");
                await Task.Delay(2000);
            }

            Debug.Log($"{this}: Service found. Starting robot and listeners.");

            // generate two robots: 'robot' for the real robot, and 'planRobot' for the plan
            await GenerateRobotAsync();

            // start listening to the joints topic
            // these joints apply only for 'robot'.
            jointsListener = new RosChannelReader <JointState>();
            await jointsListener.StartAsync(connectionClient, "/joint_states");

            // here we create a new collision object for the scene
            PlanningScene scene = new PlanningScene();

            scene.Name = "(noname+)"; // taken from rviz
            scene.World.CollisionObjects = new[]
 public GetPlanningSceneResponse(PlanningScene scene)
 {
     this.scene = scene;
 }
 public GetPlanningSceneResponse()
 {
     this.scene = new PlanningScene();
 }
Exemplo n.º 5
0
 public ApplyPlanningSceneRequest(PlanningScene scene)
 {
     this.scene = scene;
 }
Exemplo n.º 6
0
 public ApplyPlanningSceneRequest()
 {
     this.scene = new PlanningScene();
 }