Unity-Technologies/Unity-Robotics-Hub

Add a pose to the Pick and Place Trajectory Planner

rbriki opened this issue · 0 comments

Hi guys,
First of all it is needed to sey that I am new to programming with just some basic knowledge in C#, Python and C++.
I am working on the Unity Robotics Hub's Pick and Place tutorial and I would like to add another pose to the sequence (the initial one) so to make the robot came back to its original position. I have no clue on how to do that so any kind of info or starting point would be appreciated and a step by step solution would be loved.
Making a new button to make the robot came back not in sequence with the other pose would be even better but I do not know if that is harder/easier/possible at all.

By now i have tried to do it without using movit but with just a C# script:

`using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System;
using System.Threading;

public class SnapToPosition : MonoBehaviour
{
private Vector3 snapPosition;
private Quaternion originalRotationValue;
float rotationResetSpeed = 1.0f;

 private void Start()
 {
     snapPosition = this.transform.position;
     originalRotationValue = transform.rotation;
 }

 public void MoveObject ()
 {
     this.transform.position = snapPosition;
     transform.rotation = Quaternion.Slerp(transform.rotation, originalRotationValue, Time.time * rotationResetSpeed); 
     
 }

}`

This does not work properly as it change the position of the body just for a second and only if the button is clicked continuously and suddenly cames back in the end pose of the pick and place. Not sure to have expressed myselfe properly but it is difficult to describes it. The importan point is that the button does not work and as I understand that is due to the articulation body properties. This i why I suppose tha it is necessary to pass through MoveIt
Thanks for your help.