func main() { flag.Parse() log.Println("Opening ", *ttyData) s, err := serial.OpenPort(&serial.Config{Name: *ttyData, Baud: *baudData}) if err != nil { log.Fatal(err) } arm := staubli.NewStaubli(s) if err := arm.MoveRel(*x, *y, *z); err != nil { log.Fatal(" %s", err) } }
func initArm() { origin.x, origin.y, origin.z = *originx, *originy, *originz if *dummy { arm = staubli.Dummy } else { log.Println("Opening ", *ttyData) s, err := serial.OpenPort(&serial.Config{Name: *ttyData, Baud: *baudData}) if err != nil { log.Fatal(err) } arm = staubli.NewStaubli(s) } if *sendvplus { sendPg() } }