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

How to start can0 and can1 interface same time? #35

Open
imecar-github opened this issue Aug 11, 2023 · 1 comment
Open

How to start can0 and can1 interface same time? #35

imecar-github opened this issue Aug 11, 2023 · 1 comment

Comments

@imecar-github
Copy link

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

@Timple
Copy link
Contributor

Timple commented Apr 8, 2024

If you compile ros2_socketcan from source, you can use this:

    <!-- socketcan_bridges -->
    <group>
        <push-ros-namespace namespace="can0"/>
        <include file="$(find-pkg-share ros2_socketcan)/launch/socket_can_bridge.launch.xml" >
            <arg name="interface" value="can0"/>
            <arg name="from_can_bus_topic" value="rx" />
            <arg name="to_can_bus_topic" value="tx" />
        </include>
    </group>

    <group>
        <push-ros-namespace namespace="can1"/>
        <include file="$(find-pkg-share ros2_socketcan)/launch/socket_can_bridge.launch.xml" >
            <arg name="interface" value="can1"/>
            <arg name="from_can_bus_topic" value="rx" />
            <arg name="to_can_bus_topic" value="tx" />
        </include>
    </group>

Until #39 is released in binary form.

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

2 participants