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

Testing package with ROS 2 Humble and Ubuntu 22.04 #1

Closed
Supernova1114 opened this issue Oct 11, 2023 · 12 comments
Closed

Testing package with ROS 2 Humble and Ubuntu 22.04 #1

Supernova1114 opened this issue Oct 11, 2023 · 12 comments

Comments

@Supernova1114
Copy link

Hello ODrive team,

I am currently in the process of testing out this ROS package as I am working on a project. I noticed on the docs you mentioned developing and testing this package on ROS 2 Iron and Ubuntu 23.04.

I am currently using ROS 2 Humble with Ubuntu 22.04, with an ODrive S1.
It only required one line get it to build and a few slight changes in ROS commands, and then I successfully ran the ODrive over CAN. Was wondering if I could contribute my findings in order for this package to get official Humble support?

@samuelsadok
Copy link
Member

We're happy to take contributions! We don't currently have the capacity to test ourselves on multiple ROS version, but if you say that it works for you, and it doesn't break Iron, then that's cool.

@jmejias0
Copy link

Of course, you can and should contribute with all your findings, one of the things you share will help another person, just like some of the things that we look for from someone else help to us.

@Supernova1114
Copy link
Author

Supernova1114 commented Oct 20, 2023

https://github.com/odriverobotics/odrive_can/blob/73a02074ba4a669685418945f1e0ebd4b39b5769/src/odrive_can_node.cpp#L43-L44

Here's the run-down:

  • Looks like the create_service function does not take a rclcpp::QoS object in ROS 2 Humble. Instead it takes a 'rmw_qos_profile_t` data type. If you remove the QoS argument, then the package builds. The service by default uses 'rmw_qos_services_default' as the QoS type if you remove the argument.

Easiest option, as it's only a small change, would be to add a Alternate ROS Distro Support section to the README, that specifies changes needed to get the package running on different distros.

I tested the package with the ODrive S1, and was able to get the cyclical data off it as well as could give it movement commands.

@anthonywebb
Copy link

@Supernova1114 i am trying to get it to build on 22.04 as well. Can you confirm that all you did was remove the “, srv_qos” from the end of line 44? I am still running into a build error so I thought I would ask.

@Supernova1114
Copy link
Author

@anthonywebb
Yes that had fixed it, I got it working on RPi 4B, amd64 laptop, and docker image on a Jetson.

Do you want to share the build output? I may be able to help.

@anthonywebb
Copy link

Specifically the error is

/workspaces/isaac_ros-dev/src/odrive_can/src/odrive_can_node.cpp:81:55: error: ‘const struct can_frame’ has no member named ‘len’
   81 |             if (!verify_length("kHeartbeat", 8, frame.len)) break;

@anthonywebb
Copy link

It looks like there are 7 or 8 references to “Len” that are failing. Everything else looks good.

@anthonywebb
Copy link

I should probably mention I am on a jetson nano, in docker for my Isaac ROS setup @Supernova1114

@Supernova1114
Copy link
Author

Supernova1114 commented Dec 31, 2023

From some quick research, the can_frame struct in the code is from the #include <linux/can.h> which is the socket can library in the Linux kernel.

https://www.kernel.org/doc/html/next/networking/can.html#:~:text=The%20Classical%20CAN%20frame%20structure%20(aka%20CAN%202.0B)%2C%20the%20CAN%20FD%20frame%20structure%20and%20the%20sockaddr%20structure%20are%20defined%20in%20include/linux/can.h%3A

It's possible that the kernel is not up to date.
Do a sudo apt update & sudo apt upgrade on your system to see if it updates the file. Then build.

See if you can replace frame.len with frame.can_dlc. It could be that the file is not up to date and still using the deprecated call for frame length.

You should also check the linux/can.h to see what that struct looks like.

@anthonywebb
Copy link

anthonywebb commented Dec 31, 2023

@Supernova1114 thanks for the tip. Updates and upgrades of both the host machine and the docker image had no effect, but replaced all instances of frame.len with frame.can_dlc and it built fine. Going to test it now.

@00Doc-T
Copy link

00Doc-T commented Jan 2, 2024

I did the above, replacing frame.Len with frame.can_dlc. Everything built just fine.

@samuelsadok
Copy link
Member

Ok after merging #4 and adding the proposed len => can_dlc change, the package now builds on:

  • ROS2 Iron + Ubuntu 22.04 (verified by CI)
  • ROS2 Humble + Ubuntu 22.04 (verified by CI)
  • ROS2 Rolling + Ubuntu 20.04 (tested locally)

Looks like Isaac ROS is currently based on ROS2 Humble + Ubuntu 20.04 (source), so based on your comments it sounds like that works too with these changes.

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

5 participants