Skip to content

port socketcan_interface to ROS2 - #364

Draft
mathias-luedtke wants to merge 8 commits into
ros-industrial:dashing-develfrom
mathias-luedtke:ament-socketcan-interface
Draft

port socketcan_interface to ROS2#364
mathias-luedtke wants to merge 8 commits into
ros-industrial:dashing-develfrom
mathias-luedtke:ament-socketcan-interface

Conversation

@mathias-luedtke

Copy link
Copy Markdown
Member

mostly based on #359

ToDo:

  • test pluginlib hack
  • fix CMakeLists.txt and package.xml

@JWhitleyWork

Copy link
Copy Markdown

Are you intending this to be a "complete" port for Dashing? If so, we should consider using composable nodes.

@mathias-luedtke

Copy link
Copy Markdown
Member Author

This is only the non-ROS part, I might add canopen_master and canopen_402 as well.
For the ROS-based packages, composable (and managed) nodes seem to be a very good option.

@samiamlabs

Copy link
Copy Markdown

What type of testing do we need to do here?
Just manually make sure everything works (with hardware?) or automated tests of some kind?

@mathias-luedtke

Copy link
Copy Markdown
Member Author

What type of testing do we need to do here?

Hardware tests (or just with vcan) are fine for now :)

Downstream dependencies don't know that this package depends on several
boost components. Linking to socketcan_interface without specifing these
components will result in a linking error. This package should correctly
export its linking flags.

I've followed the answer from the following post to fix this:
https://answers.ros.org/question/331089/ament_export_dependenciesboost-not-working/?answer=332460#post-id-332460
@mathias-luedtke

Copy link
Copy Markdown
Member Author

@Rayman: Did this version work for you?

@Rayman

Rayman commented Dec 18, 2020

Copy link
Copy Markdown

Yes, I've just re-verified this. It compiles. There are still some tests that fail (uncrustify), but that could also be fixed later.

@mathias-luedtke

Copy link
Copy Markdown
Member Author

There are still some tests that fail (uncrustify), but that could also be fixed later.

ROS crystal seems to have a different uncrustify version..
I will will rebase this PR and disable the tests for crystal later.

@JWhitleyWork

Copy link
Copy Markdown

Crystal is EOL so I don't see any reason to have the Crystal builds included.

@hellantos

hellantos commented Dec 23, 2020

Copy link
Copy Markdown
Member

There seems to be a problem with the install command in CMakeLists.txt:

55 install(FILES socketcan_interface_plugin.xml DESTINATION share/${PROJECT_NAME}/socketcan_interface_plugin.xml)

At least for me it throws the following error:

Starting >>> socketcan_interface
[Processing: socketcan_interface]                             
--- stderr: socketcan_interface                                
CMake Error at cmake_install.cmake:41 (file):
  file INSTALL destination:
  /home/christoph/ws_ros2/install/socketcan_interface/share/socketcan_interface/socketcan_interface_plugin.xml
  is not a directory.


---
Failed   <<< socketcan_interface [54.9s, exited with code 1]

Summary: 0 packages finished [55.5s]
  1 package failed: socketcan_interface
  1 package had stderr output: socketcan_interface

Not sure if this is only throws an error for me. Simple fix is:

55 install(FILES socketcan_interface_plugin.xml DESTINATION share/${PROJECT_NAME}/)

Tested on Ubuntu 20.04, foxy.
Everything else works fine.

@Rayman

Rayman commented Dec 23, 2020

Copy link
Copy Markdown

Not sure if this is only throws an error for me. Simple fix is:

55 install(FILES socketcan_interface_plugin.xml DESTINATION share/${PROJECT_NAME}/)

You could also use pluginlib_export_plugin_description_file (see this link

@JWhitleyWork

Copy link
Copy Markdown

@ipa-mdl Please see mathias-luedtke#6. Testing with vcan now.

@Rayman

Rayman commented Feb 28, 2021

Copy link
Copy Markdown

Last month I've run this branch on a robot that has a socketcan interface and it works quite well. It's now driving with with navigation2 stack on top.

I think this branch is ready to be merged.

@JWhitleyWork

Copy link
Copy Markdown

As an alternative for anyone who just needs basic SocketCan functionality on ROS2, check out https://github.com/autowarefoundation/ros2_socketcan.

@Rayman

Rayman commented May 19, 2021

Copy link
Copy Markdown

I think this branch is now ready for merge. Only the crystal CI is failing because the linter behaves differently. But crystal is not supported so it doesn't matter.

@joe28965

joe28965 commented Oct 4, 2021

Copy link
Copy Markdown

What's the status of this PR? I also ran this on an actual robot (in Foxy even) and it worked perfectly. It would be great if this could be merged and give some functionality to ros_canopen in ROS 2

@amilcarlucas

Copy link
Copy Markdown

ping. Can someone merge this?

@hellantos

Copy link
Copy Markdown
Member

Just wanted to mention, we have started an effort to create ros2_canopen. An alpha with service interface (no ros2_control) is planned in the next weeks. ros2_control integration will come soon.

Architecture has been restructured and lely_core's canopen stack was integrated. There is no direct can/ros bridge any more, only canopen.

Code is here: https://github.com/ros-industrial/ros2_canopen
Documentation is here: https://ros-industrial.github.io/ros2_canopen
Example is here: https://github.com/ipa-cmh/trinamic_pd42_can

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants