Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problems with communicating kvh gyro #8

Open
wchen38 opened this issue May 12, 2018 · 18 comments
Open

problems with communicating kvh gyro #8

wchen38 opened this issue May 12, 2018 · 18 comments

Comments

@wchen38
Copy link

wchen38 commented May 12, 2018

I am working with ubuntu 14.04 and indigo on the Husky Robot. I am trying to communicate with the kvh dsp3000 gyro. Downloaded the packages from the master branch. compiles and builds successfully. Now, I plugged in the gyro to the robot PC and checked that there is /dev/clearpath/fog path on my system, then I ran roslaunch kvh dsp3000.launch and it gave me the following error.

~/catkin_ws$ roslaunch kvh dsp3000.launch 
... logging to /home/administrator/.ros/log/3a32e428-5579-11e8-b31d-c986401ef8c9/roslaunch-dhcp-59-208-2780.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://dhcp-59-208:55395/

SUMMARY
========

PARAMETERS
 * /dsp3000/port: /dev/clearpath/fog
 * /rosdistro: indigo
 * /rosversion: 1.11.13

NODES
  /
    dsp3000 (kvh/dsp3000)

ROS_MASTER_URI=http://localhost:11311

core service [/rosout] found
process[dsp3000-1]: started with pid [2798]
[ERROR] [1526084024.469802151]: buffer filled without end of line being found (in SerialPort::readLine)

I was wondering if you know anything about this error?
Thank you.

@jeff-o
Copy link
Contributor

jeff-o commented May 12, 2018 via email

@wchen38
Copy link
Author

wchen38 commented May 12, 2018

I'm not too familiar with udev, but I will look more into it.
When you say

point the driver at the actual port where the KVH is connected.

Do you mean change the launch file's value="$(arg port) attribute to the device path of the kvh usb?
In my case, when I plug in kvh, and i do ls /dev/ , then a new path shows up:/dev/ttyUSB2.

@jeff-o
Copy link
Contributor

jeff-o commented May 12, 2018 via email

@gavanderhoorn
Copy link
Contributor

@jeff-o wrote:

Eventually you'll want to use a udev rule to scan for a unique attribute of your USB to serial adapter (say, product ID and manufacturer ID) and then create a symlink with full permissions.

For serial ports, adding your (Linux) user to the dialout group typically suffices.

@jeff-o
Copy link
Contributor

jeff-o commented May 12, 2018 via email

@wchen38
Copy link
Author

wchen38 commented May 15, 2018

So, I tried to change the launch file value="$(arg port) to value=/dev/ttyUSB1, but I would still get the same error when I run roslaunch kvh dsp3000.

Also, I think there is already an existing clearpath rule under /etc/udev/rules.d shown below:
$: ls /etc/udev/rules.d/
10-microstrain.rules 41-hokuyo.rules 70-persistent-net.rules
41-clearpath.rules 52-ftdi.rules README
Following is the content of the file:

$: cat 41-clearpath.rules
# Recognize our flavoured FTDI cables.
SUBSYSTEM=="tty", ATTRS{idProduct}=="6001", ATTRS{idVendor}=="0403", ATTRS{product}=="Clearpath Robotics /*", MODE="0666", PROGRAM="/bin/echo '%s{product}'", SYMLINK+="clearpath%c{3}"

I checked the ttyUSB1 info to make sure it matches with the clearpath rule, shown below:

:/etc/udev/rules.d$ udevadm info /dev/ttyUSB1
P: /devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/ttyUSB1/tty/ttyUSB1
N: ttyUSB1
S: clearpath/fog
S: ftdi_FTVIQRP1
S: serial/by-id/usb-FTDI_Clearpath_Robotics__fog_FTVIQRP1-if00-port0
S: serial/by-path/pci-0000:00:1a.0-usb-0:1.1:1.0-port0
E: DEVLINKS=/dev/clearpath/fog /dev/ftdi_FTVIQRP1 /dev/serial/by-id/usb-FTDI_Clearpath_Robotics__fog_FTVIQRP1-if00-port0 /dev/serial/by-path/pci-0000:00:1a.0-usb-0:1.1:1.0-port0
E: DEVNAME=/dev/ttyUSB1
E: DEVPATH=/devices/pci0000:00/0000:00:1a.0/usb1/1-1/1-1.1/1-1.1:1.0/ttyUSB1/tty/ttyUSB1
E: ID_BUS=usb
E: ID_MM_CANDIDATE=1
E: ID_MODEL=Clearpath_Robotics__fog
E: ID_MODEL_ENC=Clearpath\x20Robotics\x20\x2ffog
E: ID_MODEL_FROM_DATABASE=FT232 USB-Serial (UART) IC
E: ID_MODEL_ID=6001
E: ID_PATH=pci-0000:00:1a.0-usb-0:1.1:1.0
E: ID_PATH_TAG=pci-0000_00_1a_0-usb-0_1_1_1_0
E: ID_REVISION=0600
E: ID_SERIAL=FTDI_Clearpath_Robotics__fog_FTVIQRP1
E: ID_SERIAL_SHORT=FTVIQRP1
E: ID_TYPE=generic
E: ID_USB_DRIVER=ftdi_sio
E: ID_USB_INTERFACES=:ffffff:
E: ID_USB_INTERFACE_NUM=00
E: ID_VENDOR=FTDI
E: ID_VENDOR_ENC=FTDI
E: ID_VENDOR_FROM_DATABASE=Future Technology Devices International, Ltd
E: ID_VENDOR_ID=0403
E: MAJOR=188
E: MINOR=1
E: SUBSYSTEM=tty
E: USEC_INITIALIZED=5901287

Do you guys have any more suggestions on what I should do?
Thank you. @jeff-o @gavanderhoorn

@jeff-o
Copy link
Contributor

jeff-o commented May 15, 2018 via email

@wchen38
Copy link
Author

wchen38 commented May 15, 2018

picocom v1.7

port is        : /dev/clearpath/fog
flowcontrol    : none
baudrate is    : 9600
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

Terminal ready
������?����w���;��f����?��;���w���~;��������;���

after terminal reday , it displays random texts and squares continuously, can't even stop with ctrl c or z.

@geoffviola
Copy link

can you try each of the following

sudo picocom -b 38400 /dev/ttyUSB1
picocom -b 38400 /dev/ttyUSB1
picocom -b 38400 /dev/clearpath/fog

Does any of that work?

@jeff-o
Copy link
Contributor

jeff-o commented May 15, 2018 via email

@wchen38
Copy link
Author

wchen38 commented May 15, 2018

oaky, so I tried both:
sudo picocom -b 38400 /dev/ttyUSB1
picocom -b 38400 /dev/clearpath/fog
and got an output of following:

:~/catkin_ws$ picocom -b 38400 /dev/ttyUSB1
picocom v1.7

port is        : /dev/ttyUSB1
flowcontrol    : none
baudrate is    : 38400
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

Terminal ready
;� 1
      -0.014254   1
       0.003008   1
       0.002845   1
      -0.006517   1
       0.008400   1


...
...
...
*** local echo: yes ***
-0.001415   1
      -0.008012   1
       0.001269   1
       0.006026   1
      -0.004343   1

output from /dev/clearpath/fog:

:~/catkin_ws$ sudo picocom -b 38400 /dev/clearpath/fog
picocom v1.7

port is        : /dev/clearpath/fog
flowcontrol    : none
baudrate is    : 38400
parity is      : none
databits are   : 8
escape is      : C-a
local echo is  : no
noinit is      : no
noreset is     : no
nolock is      : no
send_cmd is    : sz -vv
receive_cmd is : rz -vv
imap is        : 
omap is        : 
emap is        : crcrlf,delbs,

Terminal ready
��       0.006879   1
      -0.015192   1
      -0.007644   1
       0.001754   1
      -0.015353   1
       0.012795   1
       0.002579   1
       0.017074   1
       0.005624   1
       0.018473   1

@jeff-o
Copy link
Contributor

jeff-o commented May 15, 2018

OK, so the device is communicating just fine. Something is tripping up the serial communications though. Is it a newer device? Perhaps its data format has changed ever so slightly since the driver was last tested?

@wchen38
Copy link
Author

wchen38 commented May 15, 2018

Here is a picture of the gyro, it is a few years old. Can you point to me where I should check for the data format?

I'm not sure if this is important, but I notice that when I checked the baud rate of clearpath/fog and ttyUSB1, it gave me 9600, somehow when I did picocom with -b 9600, it doesn't give me any output.

stty -F /dev/clearpath/fog
speed 9600 baud; line = 0;
-brkint -imaxbel

@mikepurvis
Copy link
Member

Maybe dig into the SerialPort::readLine implementation to understand what it is that's in the buffer that apparently doesn't contain a newline?

@wchen38
Copy link
Author

wchen38 commented May 15, 2018

Okay, I will look more into it. I realized, even with the error, readLine error. I am still able to display data using rostopic echo, shown below:

0:~$ rostopic echo /dsp3000_rate
data: -5.18188280694e-05
---
data: -0.000160832089023
---
data: -0.000218462868361
---
data: -4.92008366564e-05
---
data: 5.09112542204e-05
---
data: -4.3458705477e-05
---
data: -0.000118280964671
---
data: -5.68628274777e-05
---
data: -9.15076161618e-05
---
data: 0.000239494096604
---
data: -6.66017658659e-05
---
data: 0.000195494329091
---
data: 0.000112172310764
---
data: -1.25314636534e-05
---
data: 0.000118577678222
---
data: -3.66519157069e-06
---

@mikepurvis
Copy link
Member

Are you certain that there isn't something else running on that computer? Check for processes which have the port open like so:

sudo lsof | grep ttyUSB

@wchen38
Copy link
Author

wchen38 commented May 16, 2018

:~$ sudo lsof | grep ttyUSB
lsof: WARNING: can't stat() fuse.gvfsd-fuse file system /run/user/107/gvfs
      Output information may be incomplete.
husky_nod 1356      administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1492 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1493 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1494 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1535 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1729 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1730 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1813 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1861 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
husky_nod 1356 1863 administrator    9u      CHR              188,0      0t0      11448 /dev/ttyUSB0
dsp3000   3016      administrator    9uW     CHR              188,1      0t0      16538 /dev/ttyUSB1
dsp3000   3016 3022 administrator    9uW     CHR              188,1      0t0      16538 /dev/ttyUSB1
dsp3000   3016 3023 administrator    9uW     CHR              188,1      0t0      16538 /dev/ttyUSB1
dsp3000   3016 3024 administrator    9uW     CHR              188,1      0t0      16538 /dev/ttyUSB1
dsp3000   3016 3029 administrator    9uW     CHR              188,1      0t0      16538 /dev/ttyUSB1

ttyUSB1 shows up when I run the dsp3000 node

@geoffviola
Copy link

There may be an innocuous error printed to screen. I remember there being some tricky serial port behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants