astuff / kvaser_interface

A Kvaser CAN interface ROS abstraction layer.
MIT License
83 stars 51 forks source link

Topic rate is too slow in the latest package. #48

Closed wep21 closed 4 years ago

wep21 commented 5 years ago

When I run kvaser_interface with pacmod3, topic rate was too slow(about 5 Hz). So, I checked out to version 3.1.0 and rerun it.Topic rate was about 30 Hz.

JWhitleyWork commented 5 years ago

@wep21 - We have found this issue recently and are working to release a new version which corrects it. Can you please use the repo to build from source and test it as well? We have found the performance with the latest driver to be significantly better. We are finishing up testing on this version prior to a release, hopefully in the next week.

wep21 commented 5 years ago

Thank you for your reply! I will test the newest version if it is released.

punitagrawal commented 5 years ago

I was wondering if there is any update on this issue?

When moving from 2.0.2 to 4.0.3 we noticed that the rate on can_tx ROS topic dropped from ~83KHz to ~330Hz.

JWhitleyWork commented 5 years ago

@punitagrawal - The version on the master branch of this repo fixes this problem, for the most part. Please test this package building it from source and let me know your results.

JWhitleyWork commented 4 years ago

@punitagrawal / @wep21 - The latest version has been released as 4.1.0. However, it requires a dependency that was not required before (an unexpected consequence of how our CI builds the debian files) - To install the new ros-$ROS_DISTRO-kvaser-interface, you must switch PPAs for Linuxcan to get the new dependency, kvaser-canlib-dev. Here are the instructions:

If you have the linuxcan-dkms PPA Installed:

sudo apt purge linuxcan-dkms
sudo rm -rf /usr/src/linuxcan*
sudo apt-add-repository --remove ppa:jwhitleyastuff/linuxcan-dkms

To install the new kvaser-linux PPA:

sudo apt-add-repository ppa:jwhitleyastuff/kvaser-linux
sudo apt update
sudo apt install kvaser-canlib-dev kvaser-drivers-dkms

The new PPA splits the Linuxcan SDK into 3 packages: kvaser-canlib-dev, kvaser-linlib-dev, and kvaser-drivers-dkms. Only kvaser-canlib-dev is required to install/run ros-$ROS_DISTRO-kvaser-interface but the kvaser-drivers-dkms contains all of the hardware drivers and is required to use kvaser-interface with any real hardware.

punitagrawal commented 4 years ago

Thanks for making the release - I was waiting for vehicle test availability to try the tip of master before reporting back.

I get the following error when trying steps above -

$ sudo apt-add-repository ppa:jwhitleyastuff/kvaser-linux
Cannot add PPA: 'ppa:~jwhitleyastuff/ubuntu/kvaser-linux'.
ERROR: '~jwhitleyastuff' user or team does not exist.

Any idea what I am doing wrong?

JWhitleyWork commented 4 years ago

@punitagrawal - I copied and pasted the command that you used into a terminal and it worked correctly. I'm using 18.04 but I've done this exact command with 16.04 as well and it works fine. Here is a link to the repository: https://launchpad.net/~jwhitleyastuff/+archive/ubuntu/kvaser-linux

Try the commands under the "Adding this PPA to Your System" section. They use add-apt-repository instead of apt-add-repository. Maybe there is a difference?

punitagrawal commented 4 years ago

After some messing around I realized that name resolution was broken in the context I was running the apt-add-repository. This in turn was leading to the error I was in the previous messages.

Once I fixed the underlying issue, I was able to add the repository without any issues. Apologies for the trouble.

With that out of the way...

Is there any reason to not add kvaser-canlib-dev as a dependency of kvaser-drivers-dkms? It would simplify the dependency management that little bit.

JWhitleyWork commented 4 years ago

@punitagrawal - I will consider making kvaser-canlib-dev a dependency of kvaser-drivers-dkms. I won't do the other way around because installing canlib by itself for building, development, CI, etc. is very useful. However, I think if you are installing the drivers, you probably want a way to access the hardware through a software API so the dependency makes sense.