Giter Site home page Giter Site logo

kvaser_interface's People

Contributors

cvigna9 avatar daniel-stanek avatar driscoll85 avatar icolwell-as avatar lbucklandas avatar rgunjala-as avatar roosta078 avatar srustanastuff avatar wep21 avatar zoakesastuff avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

kvaser_interface's Issues

Kvaser CAN Interface - Error opening reader: -1 - Initialization of the CAN interface failed.

...
process[rosout-1]: started with pid [4343]
started core service [/rosout]
process[kvaser_can_bridge-2]: started with pid [4346]
[ INFO] [1561980220.508395061]: Kvaser CAN Interface - Got hardware_id: 40496
[ INFO] [1561980220.509427126]: Kvaser CAN Interface - Got can_circuit_id: 0
[ INFO] [1561980220.510545732]: Kvaser CAN Interface - Got bit_rate: 500000
[ERROR] [1561980220.585378959]: Kvaser CAN Interface - Error opening reader: -1 - Initialization of the CAN interface failed.
[kvaser_can_bridge-2] process has died [pid 4346, exit code 255, cmd /home/sensetime/catkin_ws/devel/lib/kvaser_interface/kvaser_can_bridge __name:=kvaser_can_bridge __log:=/home/sensetime/.ros/log/ac49e8d4-9bf2-11e9-bfe9-a0369f51a08c/kvaser_can_bridge-2.log].
log file: /home/sensetime/.ros/log/ac49e8d4-9bf2-11e9-bfe9-a0369f51a08c/kvaser_can_bridge-2*.log
...

CANNOT catch some spesific can message IDs

Hello to everyone;

I am using this repo to run my kvaser device.
After cloning, and build process, I run can_bridge node to read data from my can bus.
In this process, I cannot catch some messages.
Especially to control whether my observation is true, I made some tests and saw that some messages which one of them is especially important for me cannot be caught.

About that, what can be a reason for this situation? What is your comment?

Thanks and best regards.

Create jammy dist for kvaser linux

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
Create jammy dist in https://ppa.launchpadcontent.net/astuff/kvaser-linux/ubuntu/dists/.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

How to use this package in ROS2๏ผŸ

Sorry to bother you. I want to use the package in ROS2 building by ros-eloquent enviroment. But it seems hard to do that. Could you please give me some suggestions. Thanks a lot.

Automated Testing Checklist

This is to discuss the addition of automated unit and node tests and what tests make sense to complete. The tests below assume that 2 virtual CAN channels have been created. After some discussion with @zoakesAStuff, this is an initial pass:

Unit Tests (for kvaser_interface) - Implemented in #37

  • KvaserCan::open() while channel is closed. Expected output: ReturnStatuses::OK
  • KvaserCan::open() while channel is open. Expected output: ReturnStatuses::OK
  • KvaserCan::close() while channel is closed. Expected output: ReturnStatuses::CHANNEL_CLOSED
  • KvaserCan::close() while channel is open. Expected output: ReturnStatuses::OK
  • KvaserCan::isOpen() while channel is closed. Expected output: false
  • KvaserCan::isOpen() while channel is open. Expected output: true
  • KvaserCan::read() while channel is closed. Expected output: ReturnStatuses::CHANNEL_CLOSED
  • KvaserCan::read() while channel is open and no messages are being transmitted. Expected output: ReturnStatuses::NO_MESSAGES_RECEIVED
  • KvaserCan::read() while channel is open and messages are being transmitted. Expected output: ReturnStatuses::OK
  • KvaserCan::registerReadCallback() while channel is closed. Expected output: ReturnStatuses::CHANNEL_CLOSED
  • KvaserCan::registerReadCallback() while channel is open. Expected output: ReturnStatuses::OK
  • Read Callback Function after registering callback while channel is open and message is transmitted. Expected output: callback is called.
  • KvaserCan::write() while channel is closed. Expected output: ReturnStatuses::CHANNEL_CLOSED
  • KvaserCan::write() while channel is open. Expected output: ReturnStatuses::OK
  • KvaserCanUtils::dlcToSize() Expected output: Correct size values, 0 if invalid.
  • KvaserCanUtils::sizeToDlc() Expected output: Correct DLC values, 0 if invalid.
  • KvaserCanUtils::getChannelCount() Expected output: 2 (see note above)
  • KvaserCanUtils::getCards() Expected output: 1 (see note above)
  • KvaserCanUtils::getChannels() Expected output: a std::vector of 2 channels (see note above)
  • KvaserCanUtils::getChannelsOnCard() Expected output: a std::vector of 2 channels (see note above)
  • Sent a message on channel 1 with KvaserCan::write() and listen on channel 1 with KvaserCan::read(). Expected output: Message contents written and read are identical.
    • Above test with DLC == 0. Expected output: ReturnStatuses::OK
    • Above test with standard message ID and DLC != payload size. Expected output: Write failure.
    • Above test with ID > 2^11 and is_extended flag == false. Expected output: Write failure.
    • Above test with ID <= 2^11 and is_extended flag == true. Expected output: ReturnStatuses::OK (standard IDs are still valid when Extended IDs are allowed).
  • KvaserCanUtils::getMsgFromFlags() Set flags to 0xFFFFFFFF. Expected output: All flags in the message will be set to true.
  • KvaserCanUtils::getMsgFromFlags() Set flags to 0x000000000. Expected output: All flags in the message will be set to false.
  • KvaserCanUtils::getFlagsFromMsg() Set all flags in message to true. Expected output: All bits associated with known flags will be set to 1.
  • KvaserCanUtils::getFlagsFromMsg() Set all flags in message to false. Expected output: Flags will be 0x00000000.

Node Tests (for kvaser_can_bridge) - Implemented in #40

These tests assume that the virtual channels (2) are still available. The testing rig would set up 2 instances of kvaser_can_bridge: One connected to channel 1 (writer) and one connected to channel 2 (reader).

  • Write to /writer/can_rx at 100Hz. Expected output: messages produced on /reader/can_tx at 100Hz (+- 3.0Hz)
  • Write to /writer/can_rx. Expected output: message produced on /reader/can_tx with contents identical to written message.
    • Above test with DLC == 0. Expected output: Received message is identical to sent message except payload is all 0s.
    • Above test with standard message ID and DLC != payload size. Expected output: Received message is identical to sent message except payload is only populated up to DLC value.
    • Above test with ID > 2^11 and is_extended flag == false. Expected output: Write failure - no matching message received.
    • Above test with ID <= 2^11 and is_extended flag == true. Expected output: Write failure - no matching message received.

Include Kvaser linuxcan in Package

In order to support release on the ROS Build Farm, include the header and .so files needed to support building without installation of the linuxcan SDK. This could introduce problems, however, if the version used in this package differs from the installed version on a user's machine. Discussion is open for alternatives.

ROS2 Warnings when launching kvaser_bridge

When running kvaser_bridge, the console is spammed with around 4-6 warnings.

[kvaser_can_bridge-1] [WARN] [1629384935.908688258] [LifecyclePublisher]: Trying to publish message on the topic '/can_tx', but the publisher is not activated
[kvaser_can_bridge-1] [WARN] [1629384935.908766409] [LifecyclePublisher]: Trying to publish message on the topic '/can_tx', but the publisher is not activated

Update ROS1 CI

Update CI to only build for ROS releases that aren't EOL (melodic and noetic).

Error opening reader: -3 - No available CAN channels were found.

Hello,
I am trying to set up this ROS package and the corresponding Kvaser CANLIB API on Ubuntu 20.04, ROS Noetic; Kernel: 5.13.0-27-generic. I am using Kvaser Leaf Light v2.

I have attempted to install the Kvaser drivers using both methods (astuff PPA and source install with dkms) but I see the same results. Even though I can bring up the CAN interface with the appropriate baud-rate and print the CAN traffic to terminal using the candump can0 utility, The CANlib can not find available channels.

$ ./listChannels
Canlib version 5.36
Found 0 channel(s).

The ROS package thus shows:

prakhag@asset-308:~$ roslaunch kvaser_interface kvaser_can_bridge.launch can_hardware_id:=045365 can_bit_rate:=250000
... logging to /users/prakhag/.ros/log/83ef72d0-8391-11ec-b356-6dc45f8cc30f/roslaunch-asset-308-16711.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://asset-308:37907/

SUMMARY
========

PARAMETERS
 * /kvaser_can_bridge/can_bit_rate: 250000
 * /kvaser_can_bridge/can_circuit_id: 0
 * /kvaser_can_bridge/can_hardware_id: 45365
 * /rosdistro: noetic
 * /rosversion: 1.15.14

NODES
  /
    kvaser_can_bridge (kvaser_interface/kvaser_can_bridge)

auto-starting new master
process[master]: started with pid [16719]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to 83ef72d0-8391-11ec-b356-6dc45f8cc30f
process[rosout-1]: started with pid [16729]
started core service [/rosout]
process[kvaser_can_bridge-2]: started with pid [16732]
[ INFO] [1643742155.433134360]: Kvaser CAN Interface - Got hardware_id: 45365
[ INFO] [1643742155.433846738]: Kvaser CAN Interface - Got can_circuit_id: 0
[ INFO] [1643742155.434040922]: Kvaser CAN Interface - Got bit_rate: 250000
[ERROR] [1643742155.436374756]: Kvaser CAN Interface - Error opening reader: -3 - No available CAN channels were found.
[kvaser_can_bridge-2] process has died [pid 16732, exit code 255, cmd /users/prakhag/catkin_ws/devel/lib/kvaser_interface/kvaser_can_bridge __name:=kvaser_can_bridge __log:=/users/prakhag/.ros/log/83ef72d0-8391-11ec-b356-6dc45f8cc30f/kvaser_can_bridge-2.log].
log file: /users/prakhag/.ros/log/83ef72d0-8391-11ec-b356-6dc45f8cc30f/kvaser_can_bridge-2*.log

I tried rebooting the system after the install, but it doesn't help.

Note:

And I have been able to do all this successfully in the past with Ubuntu 18.04 + ROS Melodic, on the same hardware. Is there a way to understand what is going wrong here?

Thanks!

CAN I transmit CANFD messages using kvaser_interface?

Hi, I'm Taehan.
I'm working at autonomous driving field and developing L4 Autonomous Shuttles.
So far, I have been using kvaser interface with 4.0.3 version, but there is an issue that CANFD RX/TX does not work with one kvaser channel, so I am testing with kvaser interface 4.1.1 (recent version).
In detail, kvaser channel 1 is used as RX and kvaser channel 2 as TX, and ch1 and ch2 are the same bus. I want to operate RX/TX with channel 1, but TX is not working.
CAN you suggest the solution?
Best regards,
Taehan.

how could I set the can_bit_rate?

Hi,I could connect the radar device using these ros package .I wonder that which number I should set with the can_bit_rate .Now I use the default number 500kbps.Should I change this number when it is neccessry?How will it influence the data ouput when I change the can_bit_rate
Thanks so much!

How to get started with the Kvaser CAN interface?

Hi,

I'm a master's student on a collegiate student design team, and we're using the Kvaser Leaf Light v2 to connect our CPU to the CAN network. We've had trouble using the generic SocketCAN implementation, so we decided to try a Kvaser-specific solution.

I've followed the README on the main page of the repo, but still we aren't able to get the ROS node to connect to the Kvaser unit. I can see the Leaf module when I run the lsusb tool in the terminal:
Bus 001 Device 011: ID 0bfd:0120 Kvaser AB Kvaser Leaf Light v2

However, using the list_channels tool, it returns No channels found.

Is there any additional setup that needs to be performed before running these tools? Is it like SocketCAN where we have to set up the IP link to the device? Or is it really supposed to be plug-and-play?

Any guidance would be greatly appreciated. Thanks so much!

numeric base:Hexadecimal

Thank you very much for your work. I have a question. The data I accept is decimal. How can I modify the program file to accept hexadecimal data?

Found 0 channels

KakaoTalk_20240116_152702607
image

as you can see my kvaser device is connected to my pc however, when i try cd /linuxcan/canlib/examples ./listchannels it says
found 0 channel.
its not because im running kvaser in virtual environment. i know it cuz it worked perfectly yesterday.

can anyone help me plzz

Error at canSetBusParams()

Hello, I am receiving an error message similar to that of Issue #12 . Through usage of the ROS_WARN() command, I have verified that my hardware_id and circuit_id are correct, and initialization passes until it reaches

if (canSetBusParams(*handle, freq, 0, 0, 0, 0, 0) < 0) return ReturnStatuses::BAD_PARAM;

in kvaser_interface.cpp
which returns BAD_PARAM and kills initialization

Using Ubuntu 16.04 LTS
Running listChannels on from linuxcan confirms that I have the correct hardware id, and that my Kvaser device is recognized

I do not fully understand the documentation of canSetBusParams on Kvaser's website, and am looking for any available help.

Error opening reader: -3 - No available CAN channels were found

Describe the bug
Exact same issue as #75 but on kernel 5.15.0-46-generic

To Reproduce
Steps to reproduce the behavior:

  1. Clone this repository and install dependent libraries as specified in README
  2. ros2 run kvaser_interface list_channels

Expected behavior
A list of channels as expected

Actual Behavior
No channels found.

Desktop (please complete the following information):

  • OS: Ubuntu 20.04 ROS2 Galactic
  • Installed from Apt

Additional context
Confirmed that the Kvaser device itself is working by using CANKing on Windows

Question about "CAN send error: -7 - A write operation failed on the CAN interface"

Hello,
I used the Kvaser Leaf Light v2 and a delphi_esr radar. When I use "roslaunch delphi_esr delphi_esr.launch" commend, it returns "Kvaser CAN Interface - CAN send error: -7 - A write operation failed on the CAN interface", and I receive nothing in rostopic echo /can_tx. I want to know if my implementation is correct or not. Can u send me a tutorial about this?
Waiting for your reply.

Add Linux SocketCAN Support

Need to add support for SocketCAN in addition to Kvaser Linuxcan to make more applicable to other platforms and users.

result after running the launch

there is something stuck after running the launch. I am new to ros and kvaser and I just change the can_hardware_id. It seems nothing came out.

PARAMETERS

  • /kvaser_can_bridge/can_bit_rate: 500000
  • /kvaser_can_bridge/can_circuit_id: 0
  • /kvaser_can_bridge/can_hardware_id: 32231
  • /rosdistro: kinetic
  • /rosversion: 1.12.13

NODES
/
kvaser_can_bridge (kvaser_interface/kvaser_can_bridge)

auto-starting new master
process[master]: started with pid [21302]
ROS_MASTER_URI=http://localhost:11311

setting /run_id to b88297d4-aa9b-11e8-b5eb-80c16e5fb314
process[rosout-1]: started with pid [21316]
started core service [/rosout]
process[kvaser_can_bridge-2]: started with pid [21324]

Why does it print error infomation when I use canmonitor tools

Hi .I could successfully connect the radar system with this ros package.And It could print the can message correctly.However when I use the cannonitor tools with no ROS dependencies(./canmonitor) .It will print error infomation like this below .I wonder why it prints such error.Thaks so much!
Screenshot from 2019-03-27 16-29-10

Rewrite kvaser_can_bridge as a Nodelet

Many of AS's drivers allow the use of kvaser_interface for CAN communications but this currently requires either:

  1. Integration of kvaser_interface as a library which must be a design-time decision or;
  2. Running the kvaser_can_bridge as a stand-alone node, which is memory-inefficient because each message must be published to a network socket.

To achieve both flexibility and efficiency, kvaser_can_bridge should be re-written as a nodelet.

Can't get `roslaunch kvaser_can_bridge.launch` to run

Output when running the command:

landon@ubuntu:~/catkin_ws/src/kvaser_interface-4.1.0/launch$ roslaunch kvaser_can_bridge.launch 
... logging to /home/landon/.ros/log/e9fd98ac-4dee-11ea-9e01-001c42738662/roslaunch-ubuntu-2231.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://ubuntu:35215/

SUMMARY
========

PARAMETERS
 * /kvaser_can_bridge/can_bit_rate: 500000
 * /kvaser_can_bridge/can_circuit_id: 0
 * /kvaser_can_bridge/can_hardware_id: 10051
 * /rosdistro: kinetic
 * /rosversion: 1.12.14

NODES
  /
    kvaser_can_bridge (kvaser_interface/kvaser_can_bridge)

ROS_MASTER_URI=http://localhost:11311

ERROR: cannot launch node of type [kvaser_interface/kvaser_can_bridge]: kvaser_interface
ROS path [0]=/opt/ros/kinetic/share/ros
ROS path [1]=/opt/ros/kinetic/share
No processes to monitor
shutting down processing monitor...
... shutting down processing monitor complete

I'm not exactly sure how to install this from source. I tried putting it in ~/catkin_ws/src and running catkin_make. I'm a ROS noob, and haven't been able to find much online about building something like this from source.

Static Callback Proxy Precludes Multiple KvaserCan Objects

Describe the bug
Using the (static) KvaserReadCbProxy object to store the instance of the KvaserCan object which has the user-defined read callback means that only one user-defined read callback can be stored at a time.

To Reproduce
Create two KvaserCan objects which read the same or different CAN channels and assign them different user-defined read callback functions.

Expected behavior
When a message is received on the channel associated with KvaserCan instance 1, the user-defined read callback function should be called for KvaserCan instance 1. When a message is received on the channel associated with KvaserCan instance 2, the user-defined read callback function should be called for KvaserCan instance 2.

Current Behavior
Whichever KvaserCan instance registered it's user-defined callback function last is the instance who's user-defined callback is always called.

Originally reported by @Daniel-Stanek.

cannot run: sudo apt install kvaser-canlib-dev kvaser-linlib-dev kvaser-drivers-dkms

When I run sudo apt install kvaser-canlib-dev kvaser-linlib-dev kvaser-drivers-dkms, I get the following error below. It was running fine before. Is there a change to the Linux or Kvaser kernel that has caused this? Thanks in advance

ProblemType: Package
DKMSBuildLog:
 DKMS make.log for kvaser-drivers-5.38.841 for kernel 5.19.0-46-generic (x86_64)
 Fri Jun 14 12:02:06 PM PDT 2024
 make[1]: Entering directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/common'
  Start building linuxcan v5.38.84
   User    : root
   System  : Linux Tubpuller2 5.19.0-46-generic #47~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Jun 21 15:35:31 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
   CC      : x86_64-linux-gnu-gcc
   CC ver. : 11.4.0
   KDIR    : /lib/modules/5.19.0-46-generic/build
   Kernel  : 5.19.0-46-generic
 
 --------------------------------------------------------------------
 building kvcommon 
 Kernel src: /lib/modules/5.19.0-46-generic/build
 make -C /lib/modules/5.19.0-46-generic/build M=/var/lib/dkms/kvaser-drivers/5.38.841/build/common modules
 
 make[2]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
   You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/VCanOsIf.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/objbuf.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/queue.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/util.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/softsync.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/capabilities.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/dlc.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/ticks.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/kvcommon.o
 WARNING: Symbol version dump "/var/lib/dkms/kvaser-drivers/5.38.841/build/common/../common/Module.symvers" is missing.
          Modules may not have dependencies or modversions.
          You may get many unresolved symbol warnings.
   MODPOST /var/lib/dkms/kvaser-drivers/5.38.841/build/common/Module.symvers
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/kvcommon.mod.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/common/kvcommon.ko
   BTF [M] /var/lib/dkms/kvaser-drivers/5.38.841/build/common/kvcommon.ko
 Skipping BTF generation for /var/lib/dkms/kvaser-drivers/5.38.841/build/common/kvcommon.ko due to unavailability of vmlinux
 make[2]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'
 --------------------------------------------------------------------
 make[1]: Leaving directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/common'
 make[1]: Entering directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/leaf'
 make[1]: Entering directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra'
 make[1]: Entering directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII'
 make[1]: Entering directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan'
 make[1]: Entering directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/pcican'
 make[1]: Entering directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2'
 make[1]: Entering directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd'
 --------------------------------------------------------------------
 building leaf 
 --------------------------------------------------------------------
 Kernel src: /lib/modules/5.19.0-46-generic/build
 make -C /lib/modules/5.19.0-46-generic/build M=/var/lib/dkms/kvaser-drivers/5.38.841/build/leaf modules
 --------------------------------------------------------------------
 --------------------------------------------------------------------
 building kvvirtualcan 
 building usbcanII 
 building kvpcicanII 
 Kernel src: /lib/modules/5.19.0-46-generic/build
 make[2]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
 Kernel src: /lib/modules/5.19.0-46-generic/build
 make -C /lib/modules/5.19.0-46-generic/build M=/var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan modules
 make -C /lib/modules/5.19.0-46-generic/build M=/var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII modules
 --------------------------------------------------------------------
 Kernel src: /lib/modules/5.19.0-46-generic/build
 make -C /lib/modules/5.19.0-46-generic/build M=/var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2 modules
 --------------------------------------------------------------------
 --------------------------------------------------------------------
 building mhydra 
 make[2]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
 building kvpcican 
 Kernel src: /lib/modules/5.19.0-46-generic/build
 building kvpciefd 
 make -C /lib/modules/5.19.0-46-generic/build M=/var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra modules
 make[2]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
 Kernel src: /lib/modules/5.19.0-46-generic/build
 Kernel src: /lib/modules/5.19.0-46-generic/build
 make -C /lib/modules/5.19.0-46-generic/build M=/var/lib/dkms/kvaser-drivers/5.38.841/build/pcican modules
 make -C /lib/modules/5.19.0-46-generic/build M=/var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd modules
 make[2]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
 make[2]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
 make[2]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
 make[2]: Entering directory '/usr/src/linux-headers-5.19.0-46-generic'
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
   You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
   You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
   You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
   You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
   You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
   You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
 warning: the compiler differs from the one used to build the kernel
   The kernel was built by: x86_64-linux-gnu-gcc (Ubuntu 11.3.0-1ubuntu1~22.04.1) 11.3.0
   You are using:           gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra/mhydraHWIf.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII/usbcanHWIf.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra/mhydraHWIf_TRP.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican/PciCanHwIf.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/leaf/leafHWIf.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2/PciCan2HwIf.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican/dallas.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra/ioctl_handler.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2/memQ.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/pciefd_hwif.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/altera/HAL/src/pciefd.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan/virtualcan.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/altera/HAL/src/pciefd_packet.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/altera/HAL/src/pciefd_rx_fifo.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/altera/HAL/src/altera_avalon_epcs_flash_controller.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/altera/HAL/src/altera_avalon_spi.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/altera/HAL/src/epcs_commands.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/altera/HAL/src/pwm_util.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan/kvvirtualcan.o
   MODPOST /var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan/Module.symvers
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan/kvvirtualcan.mod.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican/kvpcican.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2/kvpcicanII.o
   MODPOST /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican/Module.symvers
   MODPOST /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2/Module.symvers
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII/usbcanII.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan/kvvirtualcan.ko
   BTF [M] /var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan/kvvirtualcan.ko
 Skipping BTF generation for /var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan/kvvirtualcan.ko due to unavailability of vmlinux
 make[2]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'
 --------------------------------------------------------------------
 make[1]: Leaving directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/virtualcan'
   MODPOST /var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII/Module.symvers
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican/kvpcican.mod.o
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2/kvpcicanII.mod.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/leaf/leaf.o
 ERROR: modpost: "do_exit" [/var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII/usbcanII.ko] undefined!
 make[3]: *** [scripts/Makefile.modpost:128: /var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII/Module.symvers] Error 1
 make[2]: *** [Makefile:1771: modules] Error 2
 make[2]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'
 make[1]: *** [/var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII/../config.mak:172: kv_module] Error 2
 make[1]: Leaving directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/usbcanII'
 make: *** [Makefile:124: usbcanII] Error 2
 make: *** Waiting for unfinished jobs....
   MODPOST /var/lib/dkms/kvaser-drivers/5.38.841/build/leaf/Module.symvers
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/kvpciefd.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2/kvpcicanII.ko
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican/kvpcican.ko
   MODPOST /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/Module.symvers
   BTF [M] /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2/kvpcicanII.ko
 Skipping BTF generation for /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2/kvpcicanII.ko due to unavailability of vmlinux
 make[2]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'
 --------------------------------------------------------------------
 make[1]: Leaving directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/pcican2'
   BTF [M] /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican/kvpcican.ko
 Skipping BTF generation for /var/lib/dkms/kvaser-drivers/5.38.841/build/pcican/kvpcican.ko due to unavailability of vmlinux
 make[2]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'
 --------------------------------------------------------------------
 make[1]: Leaving directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/pcican'
 ERROR: modpost: "do_exit" [/var/lib/dkms/kvaser-drivers/5.38.841/build/leaf/leaf.ko] undefined!
 make[3]: *** [scripts/Makefile.modpost:128: /var/lib/dkms/kvaser-drivers/5.38.841/build/leaf/Module.symvers] Error 1
 make[2]: *** [Makefile:1771: modules] Error 2
 make[2]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'
 make[1]: *** [/var/lib/dkms/kvaser-drivers/5.38.841/build/leaf/../config.mak:172: kv_module] Error 2
 make[1]: Leaving directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/leaf'
 make: *** [Makefile:127: leaf] Error 2
   CC [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/kvpciefd.mod.o
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/kvpciefd.ko
   BTF [M] /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/kvpciefd.ko
 Skipping BTF generation for /var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd/kvpciefd.ko due to unavailability of vmlinux
 make[2]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'
 --------------------------------------------------------------------
 make[1]: Leaving directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/pciefd'
   LD [M]  /var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra/mhydra.o
   MODPOST /var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra/Module.symvers
 ERROR: modpost: "do_exit" [/var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra/mhydra.ko] undefined!
 make[3]: *** [scripts/Makefile.modpost:128: /var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra/Module.symvers] Error 1
 make[2]: *** [Makefile:1771: modules] Error 2
 make[2]: Leaving directory '/usr/src/linux-headers-5.19.0-46-generic'
 make[1]: *** [/var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra/../config.mak:172: kv_module] Error 2
 make[1]: Leaving directory '/var/lib/dkms/kvaser-drivers/5.38.841/build/mhydra'
 make: *** [Makefile:130: mhydra] Error 2
DKMSKernelVersion: 5.19.0-46-generic
Date: Fri Jun 14 12:02:15 2024
Package: kvaser-drivers-dkms 5.38.841-0ubuntu0~ppa1
PackageVersion: 5.38.841-0ubuntu0~ppa1
SourcePackage: kvaser-drivers-dkms
Title: kvaser-drivers-dkms 5.38.841-0ubuntu0~ppa1: kvaser-drivers kernel module failed to build

Is it possible to use non-standard bit rates?

I am working with a CAN bus that is transmitting at 33300 kbps and when launching the node I get an error for a bad input parameter. I was wondering if it is possible to setup the current code to operate at that transmission rate or if there is a recommended way to edit the code base to implement this bit rate. Any and all assistance if greatly appreciated.

Update ROS2 CI

Update CI to build for ROS 2 foxy since dashing is now EOL.

Release on OSRF

Is there any plan to release this package as a proper ROS package?

Unable to transmitt frame with a dlc not equal to 8.

I have been trying to send a can frame with dlc of 5 and kept getting error code -9(DLC_LENGTH_MISMATCH). Upon looking into the source code it seemed to have been produced by the following lines in KvaserCan::write (lines 246-247 in kvaser_interface.cpp)

if (payload_size != msg.data.size())
    return ReturnStatuses::DLC_PAYLOAD_MISMATCH;

Since in Kinetic( I am not sure of other distros) the data field in can_msgs/Frame is defined as a fixed length boost array with length 8 there is no way to modify the size of this array prior to sending it to the kvaser_can_bridge.

   typedef boost::array<uint8_t, 8>  _data_type;
  _data_type data;

Couple this with the fact that the dlc is check against this size exactly results any dlc not equal to 8 throwing the -9 error. While I see the reason in the size check to prevent out-of-bound accesses, I think this check is too strict. A check to make sure the dlc is not greater than the size of the data array would prevent the possibility of out-of-bound access while allowing messages with a shorter dlc to be sent. I have compiled and tested a version of the code with the aforementioned changes and it seemed to have fixed the original issue without any problems.

  if (payload_size > msg.data.size())
    return ReturnStatuses::DLC_PAYLOAD_MISMATCH;

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.