Results 1 to 5 of 5

Thread: PhantomX / ArbotiX read String from Unity

  1. PhantomX / ArbotiX read String from Unity

    Hi all,

    hope I'm in the correct section. We have mounted a camera on the turret which is capable of face recognition. We want to implement that the camera turret follows a user's face automatically (e.g. when the face of the user is not in the middle of the camera, turn the turret...). So in theory that's relatively simple.
    We send data with Unity to the serial port and read it with the ArbotiX. The problem is, that we want to send strings. There's a function for Arduino Uno for example called readStringUntil() which we want to use, it's not available for ArbotiX though. Why? We have a workaround with parseInt() but that is too slow and cumbersome for our purposes.
    Does anybody know a way to read a string from the serial port so we can send fast commands with Unity? Any help is greatly appreciated!

    Best regards

  2. #2
    Join Date
    Sep 2010
    Location
    ಠ_ಠ
    Posts
    2,289
    Images
    27
    Rep Power
    276

    Re: PhantomX / ArbotiX read String from Unity

    The arbotix originally used customized UART code because of performance issues with the standard core's HardwareSerial from several years ago. Those issues have since been resolved, but the arbotix library still uses an old copy of the arduino avr core (the original developer is not active on the forum, and works on much more expensive robots and components). Since the arbotix is based on the Sanguino, which is an AVR arduino board, it should be directly compatible with any newer arduino core as long as the boards, platform, and variant files are up-to-date. I do not have the hardware to test, but replacing the contents of '/hardware/arbotix/avr/cores/arbotix/' with the contents of '/hardware/arduino/avr/cores/arduino/' to use the functions of the newer core, but some of the arbotix custom non-dynamixel libraries might have issues.
    Please pardon the pedantry... and the profanity... and the convoluted speech pattern...
    "You have failed me, Brain!"
    bleh

  3. #3

    Re: PhantomX / ArbotiX read String from Unity

    You can easily reimplement something like "readStringUntil()" yourself.
    Just keep reading bytes into a buffer until you get the correct end byte or run out of buffer space.

  4. #4

    Re: PhantomX / ArbotiX read String from Unity

    Or you can convert to use the latest versions of Arduino... Been several threads on this. I personally no longer look at any of the Arduino 1.0.x stuff anymore... I have had the stuff running on Arduino 1.5.x and 1.6.x and now 1.8.x for several years now.

    Trossen was in the process of officially converting, but I believe the person doing it is no longer there. More about the steps to do this can be found in the thread: http://forums.trossenrobotics.com/sh...iles-Libraries

    Note: Current Arduino release is 1.8.1, which is find to use the 1.6.x stuff. They went to 1.8 as arduino.cc is now working again with arduino.org (who had 1.7.x releases) and so they numbered next release as 1.8.x...

    Again hopefully someone at Trossen will take this up again

  5. Re: PhantomX / ArbotiX read String from Unity

    Thank you all for your answers, all are helpful! We actually got parseInt() to run much faster today but we will look at all of your suggestions. Have a good day and thanks again!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Question(s) Unable to read AX12 servo position values during Interrupt Service Routine using arbotix.
    By rishflab in forum DYNAMIXEL & Robot Actuators
    Replies: 3
    Last Post: 04-29-2016, 08:23 PM
  2. Question(s) Can not read response bytes from arbotix-m (C++) (PhantomX Pincher)
    By Max in forum Software and Programming
    Replies: 2
    Last Post: 08-19-2015, 09:39 AM
  3. Question(s) Pypose is unable to read servomotors AX12 series through Arbotix-M board
    By ratatouille in forum Arbotix, Microcontrollers, Arduino
    Replies: 0
    Last Post: 03-23-2015, 02:33 AM
  4. Help in Arduino char/string
    By brian25 in forum Software and Programming
    Replies: 2
    Last Post: 08-30-2013, 11:09 AM
  5. Question(s) Arbotix Pypose Read failed: servo id X
    By Ron in forum Robot Computers
    Replies: 20
    Last Post: 11-10-2011, 02:36 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •