Coder Social home page Coder Social logo

ros2_socketcan's People

Contributors

a-higuchi avatar asaba96 avatar jwhitleywork avatar lukajuricic avatar marceldudek avatar timple avatar wep21 avatar xmfcx 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  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  avatar  avatar  avatar  avatar

ros2_socketcan's Issues

Feature request: disable loopback

In ros1 we used to use the socketcan bridge to convert the canbusses to can_msgs/Frame ros messages. All messages we put on /to_canbus were never on the /from_canbus topic.

However, for ROS2 this package is recommended it seems.

Now we do see all messages we send on the /to_canbus back on the /from_canbus topic. Not only led this to (solvable) issues, but this actually almost doubles the frequency of the /from_canbus topic. And (thus) doubles the handling effort on the subscribing nodes as these messages need to be discarded.

Is there a way to get the 'old' behavior back?

Sometimes fails to activate LifecycleNodes automatically

We've found sometimes it fails to activate LifecycleNodes automatically. Manual activation is accepted successfully.
We are currently investigating this. Probably will try to replace the activation condition.

# Launch nodes
$ ros2 launch ros2_socketcan socket_can_bridge.launch.xml interface:=vcan0
[INFO] [launch]: All log files can be found below /home/kenji/.ros/log/2021-03-18-14-49-12-183689-KM-DAIV-69318
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [socket_can_receiver_node_exe-1]: process started with pid [69330]
[INFO] [socket_can_sender_node_exe-2]: process started with pid [69332]
[socket_can_receiver_node_exe-1] [INFO 1616046552.306117348] [socket_can_receiver]: interface: vcan0
[socket_can_receiver_node_exe-1] [INFO 1616046552.306181503] [socket_can_receiver]: interval(s): 0.010000
[socket_can_sender_node_exe-2] [INFO 1616046552.306349697] [socket_can_sender]: interface: vcan0
[socket_can_sender_node_exe-2] [INFO 1616046552.306387237] [socket_can_sender]: timeout(s): 0.010000
[socket_can_sender_node_exe-2] [WARN 1616046552.541547370] [rcl_lifecycle]: No transition matching 3 found for current state unconfigured
[ERROR] [launch_ros.actions.lifecycle_node]: Failed to make transition 'TRANSITION_ACTIVATE' for LifecycleNode '/socket_can_sender'
[socket_can_sender_node_exe-2] [ERROR 1616046552.541622919] []: Unable to start transition 3 from current state unconfigured: Transition is not registered., at /tmp/binarydeb/ros-foxy-rcl-lifecycle-1.1.10/src/rcl_lifecycle.c:350

# Check status
$ ros2 lifecycle get /socket_can_sender
inactive [2]

# Check receiver
$ ros2 lifecycle get /socket_can_receiver
active [3]

# Activate manually
$ ros2 lifecycle set /socket_can_sender activate
Transitioning successful

# Check status again
$ ros2 lifecycle get /socket_can_sender
active [3]

Naming of can_tx and can_rx

Currently, this package uses can_tx for sending topics(receiving can data) and can_rx for receiving topics(sending can data).

I guess this is from kvaser_interface.
https://github.com/astuff/kvaser_interface/blob/56b65758814a6d56ad04a6008334514d84123a8c/src/kvaser_reader_node.cpp#L66
https://github.com/astuff/kvaser_interface/blob/56b65758814a6d56ad04a6008334514d84123a8c/src/kvaser_writer_node.cpp#L68

However, I feel this causes a bit of confusion because reader_node uses tx and writer_node uses rx.
So I think it's better to use can_tx for sending can data(receiving topics) and can_rx for receiving can data(sending topics).

For example, ros-industrial's socketcan_bridge uses this rule. (Naming is a bit different, rx -> received, tx -> sent)
https://github.com/ros-industrial/socketcan_interface/blob/4d105e6eac6b36acd285c00641a25dbd315eb58a/socketcan_bridge/src/topic_to_socketcan.cpp#L37
https://github.com/ros-industrial/socketcan_interface/blob/4d105e6eac6b36acd285c00641a25dbd315eb58a/socketcan_bridge/src/socketcan_to_topic.cpp#L51

@JWhitleyWork Could you tell me your thoughts?

Failed to set CAN socket name via ioctl()

Hi
Thanks for writing this library.

I wanted to try out CAN for my project but am encountering the following error:

[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [socket_can_receiver_node_exe-1]: process started with pid [85606]
[socket_can_receiver_node_exe-1] [INFO] [1671057528.227663086] [socket_can_receiver]: interface: /dev/ttyUSB0
[socket_can_receiver_node_exe-1] [INFO] [1671057528.227695404] [socket_can_receiver]: interval(s): 0.010000
[socket_can_receiver_node_exe-1] [INFO] [1671057528.227701450] [socket_can_receiver]: use bus time: 0
[socket_can_receiver_node_exe-1] [ERROR] [1671057528.470725617] [socket_can_receiver]: Error opening CAN receiver: /dev/ttyUSB0 - Failed to set CAN socket name via ioctl()
[ERROR] [launch_ros.actions.lifecycle_node]: Failed to make transition 'TRANSITION_CONFIGURE' for LifecycleNode '/socket_can_receiver'
^C[WARNING] [launch]: user interrupted with ctrl-c (SIGINT)
[socket_can_receiver_node_exe-1] [INFO] [1671057530.174106048] [rclcpp]: signal_handler(signal_value=2)
[INFO] [socket_can_receiver_node_exe-1]: process has finished cleanly [pid 85606]

Physical setup:
I have an Arduino Due with SEEED studio can bus.

I have the a USB to CAN connector plugged into the computer.

I believe the CAN port is showing up as /dev/ttyUSB0 because when I unplug it, it was the only one that disappeared.

Could you help me identifiy what is the possible issue?

Thanks!
Best,
Michael Wu

High-frequency data handling

I'm using this package to interface with my robot hardware, which is connected via 2 CAN networks. However, my sensors return data at a fairly high rate; the sensor network alone is sending messages at over 2250 Hz. This is not actually that fast for computer systems. However, the FastRTPS DDS implementation for ROS2, the default, is not really capable of handling messages this rapidly, at least not with any kind of reliability.

Although using a different middleware implementation might potentially solve this issue, I'd prefer not to be dependent on any specific implementation. Therefore, I'm looking for alternative solutions first.

Is there a way to reduce the amount of messages passed through by this node? For instance, a filter that only allows messages with a certain node ID to be puclished every X ms?
Alternatively, is there a way to change the qos settings for this node so not all messages are sent with 'reliable' reliability? I suspect my system would perform a lot better if I could set this to 'best-effort', but there don't seem to be any parameters supporting that.

can msg has no member named 'is_rtr' or 'is_extended' or 'is_error'

src/ros2_socketcan/src/socket_can_receiver_node.cpp:137:15: error: ‘using Frame = struct can_msgs::msg::Frame_<std::allocator<void> >’ {aka ‘struct can_msgs::msg::Frame_<std::allocator<void> >’} has no member named ‘is_rtr’
  137 |     frame_msg.is_rtr = (receive_id.frame_type() == FrameType::REMOTE);
      |               ^~~~~~
src/ros2_socketcan/src/socket_can_receiver_node.cpp:138:15: error: ‘using Frame = struct can_msgs::msg::Frame_<std::allocator<void> >’ {aka ‘struct can_msgs::msg::Frame_<std::allocator<void> >’} has no member named ‘is_extended’
  138 |     frame_msg.is_extended = receive_id.is_extended();
      |               ^~~~~~~~~~~
src/ros2_socketcan/src/socket_can_receiver_node.cpp:139:15: error: ‘using Frame = struct can_msgs::msg::Frame_<std::allocator<void> >’ {aka ‘struct can_msgs::msg::Frame_<std::allocator<void> >’} has no member named ‘is_error’
  139 |     frame_msg.is_error = (receive_id.frame_type() == FrameType::ERROR);

When i build the package, i get the above response. I checked can_msgs and i dont see a problem there.
I have just cloned the repo and built it, No changes to the code yet

How to start can0 and can1 interface same time?

Hello thanks for the amazing package. But I have a question. When I want to start can0, there is not problem. But when I want to start can0 and can1, ROS log says:

[socket_can_receiver_node_exe-1] [WARN] [1691756535.767704941] [rcl_lifecycle]: No transition matching 3 found for current state active
[socket_can_receiver_node_exe-1] [ERROR] [1691756535.767726592] []: Unable to start transition 3 from current state active: Transition is not registered., at /tmp/binarydeb/ros-galactic-rcl-lifecycle-3.1.4/src/rcl_lifecycle.c:355
[socket_can_sender_node_exe-2] [WARN] [1691756535.769189078] [rcl_lifecycle]: No transition matching 3 found for current state active
[socket_can_sender_node_exe-2] [ERROR] [1691756535.769207656] []: Unable to start transition 3 from current state active: Transition is not registered., at /tmp/binarydeb/ros-galactic-rcl-lifecycle-3.1.4/src/rcl_lifecycle.c:355

Are there any way to get can0 and can1 same time? Can we give name as like

from_can_bus_can0
to_can_bus_can0
from_can_bus_can1
to_can_bus_can1

Add Support for CAN FD

CAN FD is becoming common-place in new vehicles and my company also needs a driver which supports it. The Linux kernel/socketcan has supported it for some time. However, the can_msgs/msg/Frame message does not support DLCs above 8 or payloads above 8 bytes and, unfortunately, the maintainers of ros_canopen do not seem interested in supporting CAN FD (see ros-industrial/ros_canopen#375) or ROS2 (see ros-industrial/ros_canopen#322). This necessitates that a new message be created for this purpose. There are basically two options:

  1. Create a new message which supports both traditional CAN and CAN FD.
  2. Use can_msgs/msg/Frame for traditional CAN and a new message for CAN FD.

Option 1 introduces an API break for all users of this repository if the node is switched to only using this new message. As such, it is not advisable to back-port this change to older ROS versions like Foxy. Option 2 splinters support and makes it so that CAN and CAN FD messages could not be published on the same topic - even though they can exist on the same bus, per the CAN FD spec. This is also not ideal.

As an alternative, I offer a "re-thinking" of option 1: Adding a new message which supports both traditional CAN and CAN FD but making the use of this message optional in the node with a parameter - something like support_fd. This flag would then enable publishing/subscribing using the new message while the default behavior would be to publish/subscribe using the old message.

I would like to hear feedback from @mitsudome-r, @wep21, or others active in the Autoware and ROS2 communities regarding the above options. Thanks!

previously received data remains

Description

If the DLC(Data Length Code) is less than 8, the previously received data remains in the "data" field of the topic sent by ros2_socketcan.

When supporting multiple types of HW with the same CAN-ID but different DLCs, unintended behavior may occur if garbage is included in the reception result of can_receiver.

I checked with the following steps.

Preparation

  • Install can-utils
sudo apt install can-utils
  • Enable vcan
sudo modprobe vcan
sudo ip link add dev vcan0 type vcan
sudo ip link set up vcan0
  • Invoke ros2_socketcan
ros2 launch ros2_socketcan socket_can_bridge.launch.xml interface:=vcan0
  • Invoke candump
candump vcan0
  • Topic monitoring
ros2 topic echo /from_can_bus

Procedure

Send the following CAN data with cansend.

cansend vcan0 200#1122334455667788
cansend vcan0 123#aa

Output

  • candump output
  vcan0  200   [8]  11 22 33 44 55 66 77 88
  vcan0  123   [1]  AA
  • Topic output
header:
  stamp:
    sec: 1661924425
    nanosec: 956480272
  frame_id: can
id: 512
is_rtr: false
is_extended: false
is_error: false
dlc: 8
data:
- 17
- 34
- 51
- 68
- 85
- 102
- 119
- 136
---
header:
  stamp:
    sec: 1661924437
    nanosec: 538097128
  frame_id: can
id: 291
is_rtr: false
is_extended: false
is_error: false
dlc: 1
data:
- 170
- 34
- 51
- 68
- 85
- 102
- 119
- 136
---

can not receive can data when dlc < 8

const auto ret = receive(&data_raw[0U], timeout); if (ret.length() != sizeof(data)) { throw std::runtime_error{"Received CAN data is of size incompatible with provided type!"}; }
if can data length < 8, it will throw error

socket_can_bridge.launch.xml is not working if group tag is added

Normally, socket_can_bridge.launch.xml works correctly.

$ ros2 launch ros2_socketcan socket_can_bridge.launch.xml interface:=vcan0
[INFO] [launch]: All log files can be found below /home/kenji/.ros/log/2021-03-28-15-45-41-152424-desktop-1257792
[INFO] [launch]: Default logging verbosity is set to INFO
1616913941.225444 [19]       ros2: using network interface enp8s0 (udp/172.16.81.153) selected arbitrarily from: enp8s0, br-51dac8a7becc, docker0
[INFO] [socket_can_receiver_node_exe-1]: process started with pid [1257803]
[INFO] [socket_can_sender_node_exe-2]: process started with pid [1257805]
[socket_can_receiver_node_exe-1] 1616913941.245093 [19] socket_can: using network interface enp8s0 (udp/172.16.81.153) selected arbitrarily from: enp8s0, br-51dac8a7becc, docker0
[socket_can_sender_node_exe-2] 1616913941.245764 [19] socket_can: using network interface enp8s0 (udp/172.16.81.153) selected arbitrarily from: enp8s0, br-51dac8a7becc, docker0
[socket_can_receiver_node_exe-1] [INFO 1616913941.249226146] [socket_can_receiver]: interface: vcan0
[socket_can_receiver_node_exe-1] [INFO 1616913941.249265876] [socket_can_receiver]: interval(s): 0.010000
[socket_can_sender_node_exe-2] [INFO 1616913941.249974288] [socket_can_sender]: interface: vcan0
[socket_can_sender_node_exe-2] [INFO 1616913941.250025899] [socket_can_sender]: timeout(s): 0.010000

Or this is okay.

// test.launch.xml
<launch>
  <include file="$(find-pkg-share ros2_socketcan)/launch/socket_can_bridge.launch.xml">
    <arg name="interface" value="vcan0" />
  </include>
</launch>
$ ros2 launch ./test.launch.xml
(Same result)

However, if group tag is added, it doesn't work. auto_configure and auto_activate couldn't be resolved.

// test.launch.xml
<launch>
  <group>
    <include file="$(find-pkg-share ros2_socketcan)/launch/socket_can_bridge.launch.xml">
      <arg name="interface" value="vcan0" />
    </include>
  </group>
</launch>
$ ros2 launch ./test.launch.xml 
[INFO] [launch]: All log files can be found below /home/kenji/.ros/log/2021-03-28-15-46-32-602952-desktop-1257993
[INFO] [launch]: Default logging verbosity is set to INFO
1616913992.678658 [19]       ros2: using network interface enp8s0 (udp/172.16.81.153) selected arbitrarily from: enp8s0, br-51dac8a7becc, docker0
[INFO] [socket_can_receiver_node_exe-1]: process started with pid [1258004]
[INFO] [socket_can_sender_node_exe-2]: process started with pid [1258006]
Task exception was never retrieved
future: <Task finished name='Task-7' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:271> exception=SubstitutionFailure("launch configuration 'auto_configure' does not exist")>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 273, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 293, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 106, in visit
    if self.__condition is None or self.__condition.evaluate(context):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/condition.py", line 44, in evaluate
    return self._predicate(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/conditions/if_condition.py", line 43, in _predicate_func
    return evaluate_condition_expression(context, self.__predicate_expression)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/conditions/evaluate_condition_expression_impl.py", line 41, in evaluate_condition_expression
    expanded_expression = perform_substitutions(context, expression)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py", line 184, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/substitutions/launch_configuration.py", line 98, in perform
    raise SubstitutionFailure(
launch.substitutions.substitution_failure.SubstitutionFailure: launch configuration 'auto_configure' does not exist
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<LaunchService._process_one_event() done, defined at /opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py:271> exception=SubstitutionFailure("launch configuration 'auto_configure' does not exist")>
Traceback (most recent call last):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 273, in _process_one_event
    await self.__process_event(next_event)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_service.py", line 293, in __process_event
    visit_all_entities_and_collect_futures(entity, self.__context))
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/visit_all_entities_and_collect_futures_impl.py", line 38, in visit_all_entities_and_collect_futures
    sub_entities = entity.visit(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/action.py", line 106, in visit
    if self.__condition is None or self.__condition.evaluate(context):
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/condition.py", line 44, in evaluate
    return self._predicate(context)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/conditions/if_condition.py", line 43, in _predicate_func
    return evaluate_condition_expression(context, self.__predicate_expression)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/conditions/evaluate_condition_expression_impl.py", line 41, in evaluate_condition_expression
    expanded_expression = perform_substitutions(context, expression)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in perform_substitutions
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/utilities/perform_substitutions_impl.py", line 26, in <listcomp>
    return ''.join([context.perform_substitution(sub) for sub in subs])
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/launch_context.py", line 184, in perform_substitution
    return substitution.perform(self)
  File "/opt/ros/foxy/lib/python3.8/site-packages/launch/substitutions/launch_configuration.py", line 98, in perform
    raise SubstitutionFailure(
launch.substitutions.substitution_failure.SubstitutionFailure: launch configuration 'auto_configure' does not exist
[socket_can_receiver_node_exe-1] 1616913992.698730 [19] socket_can: using network interface enp8s0 (udp/172.16.81.153) selected arbitrarily from: enp8s0, br-51dac8a7becc, docker0
[socket_can_sender_node_exe-2] 1616913992.699225 [19] socket_can: using network interface enp8s0 (udp/172.16.81.153) selected arbitrarily from: enp8s0, br-51dac8a7becc, docker0
[socket_can_receiver_node_exe-1] [INFO 1616913992.701642017] [socket_can_receiver]: interface: vcan0
[socket_can_receiver_node_exe-1] [INFO 1616913992.701682377] [socket_can_receiver]: interval(s): 0.010000
[socket_can_sender_node_exe-2] [INFO 1616913992.704002656] [socket_can_sender]: interface: vcan0
[socket_can_sender_node_exe-2] [INFO 1616913992.704059466] [socket_can_sender]: timeout(s): 0.010000

symbol lookup error when launching

Hi, when I try to launch this package I get the following errors:

nvidia@nvidia-desktop:~$ ros2 launch ros2_socketcan socket_can_bridge.launch.xml 
[INFO] [launch]: All log files can be found below /home/nvidia/.ros/log/2022-12-07-15-11-56-825760-nvidia-desktop-3492
[INFO] [launch]: Default logging verbosity is set to INFO
[INFO] [socket_can_receiver_node_exe-1]: process started with pid [3504]
[INFO] [socket_can_sender_node_exe-2]: process started with pid [3506]
[socket_can_receiver_node_exe-1] [INFO] [1670386318.916417368] [socket_can_receiver]: interface: can0
[socket_can_receiver_node_exe-1] [INFO] [1670386318.917685827] [socket_can_receiver]: interval(s): 0.010000
[socket_can_receiver_node_exe-1] [INFO] [1670386318.917841924] [socket_can_receiver]: use bus time: 0
[socket_can_sender_node_exe-2] [INFO] [1670386318.919789173] [socket_can_sender]: interface: can0
[socket_can_sender_node_exe-2] [INFO] [1670386318.920796766] [socket_can_sender]: timeout(s): 0.010000
[socket_can_receiver_node_exe-1] /home/nvidia/ros2_ws/install/ros2_socketcan/lib/ros2_socketcan/socket_can_receiver_node_exe: symbol lookup error: /home/nvidia/ros2_ws/install/ros2_socketcan/lib/libsocket_can_receiver_node.so: undefined symbol: _ZN22rosidl_typesupport_cpp31get_message_type_support_handleIN8can_msgs3msg6Frame_ISaIvEEEEEPK29rosidl_message_type_support_tv
[ERROR] [socket_can_receiver_node_exe-1]: process has died [pid 3504, exit code 127, cmd '/home/nvidia/ros2_ws/install/ros2_socketcan/lib/ros2_socketcan/socket_can_receiver_node_exe --ros-args -r __node:=socket_can_receiver -r __ns:=/ --params-file /tmp/launch_params_d99by55u'].
[ERROR] [socket_can_sender_node_exe-2]: process has died [pid 3506, exit code 127, cmd '/home/nvidia/ros2_ws/install/ros2_socketcan/lib/ros2_socketcan/socket_can_sender_node_exe --ros-args -r __node:=socket_can_sender -r __ns:=/ --params-file /tmp/launch_params_8r0zf3cn'].
[socket_can_sender_node_exe-2] /home/nvidia/ros2_ws/install/ros2_socketcan/lib/ros2_socketcan/socket_can_sender_node_exe: symbol lookup error: /home/nvidia/ros2_ws/install/ros2_socketcan/lib/libsocket_can_sender_node.so: undefined symbol: _ZN22rosidl_typesupport_cpp31get_message_type_support_handleIN8can_msgs3msg6Frame_ISaIvEEEEEPK29rosidl_message_type_support_tv

I am running ros2 foxy on Jetpack 5.02 (ubuntu 20.04) on an industrial xavier computer. I have confirmed that my can interface is working, I've used a peak can device and checked it using a physical can bus:

nvidia@nvidia-desktop:~$ ifconfig 
can0: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 53  

can1: flags=193<UP,RUNNING,NOARP>  mtu 16
        unspec 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00  txqueuelen 10  (UNSPEC)
        RX packets 0  bytes 0 (0.0 B)
        RX errors 0  dropped 0  overruns 0  frame 0
        TX packets 0  bytes 0 (0.0 B)
        TX errors 0  dropped 0 overruns 0  carrier 0  collisions 0
        device interrupt 54  

Colcon build was also successful:

nvidia@nvidia-desktop:~/ros2_ws$ colcon build
Starting >>> ros2_socketcan
Starting >>> ros2_socketcan_msgs             
Finished <<< ros2_socketcan [4.53s]                                                                        
Finished <<< ros2_socketcan_msgs [6.18s]                  

Summary: 2 packages finished [8.55s]

Any help would be much appreciated. Let me know if you'd like more info about the issue. Thanks

Need Node Wrappers

This SocketCAN implementation is currently only a set of classes to create a C++ API for SocketCAN. There are no nodes included which would actually allow someone to communicate using something like can_msgs/msg/Frame. We need the following:

  • Reader node (written as Component)
    • Reads from the SocketCAN device and publishes a topic of type can_msgs/msg/Frame
  • Writer node (written as Component)
    • Subscribes to a topic of type can_msgs/msg/Frame and writes to the SocketCAN device
  • Example launch files
    • Launch file with only a reader
    • Launch file with only a writer
    • Launch file with both reader and writer in a single manager node

A message was lost!!!

Hello,
I have recently migrated from ros_canopen (https://github.com/ros-industrial/ros_canopen) using ROS Noetic to this package to read and write to CAN bus. I am now using ROS2 Humble and I am facing an issue:
When running either the socket_can_bridge.launch.xml or socket_can_receiver.launch.py on its own I am able to read (ros2 topic echo) the messages with no issues, however, when I run a node which subscribes and handles the data on the /from_can_bus topic, I start getting this log:
A message was lost!!!
total count change:2
total count: 19257---
And I am not able to read anything from the bus anymore. Any idea on how to fix this?

Thanks.

Missing header file

Screenshot from 2024-05-14 16-40-54
I can not build a package because of this error. I tried to update the dependencies via rosdep, but did not help.

ROS2 Humble
Ubuntu 22.04

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.