hybo-ilidar / api-demo

Example programs to connect to iLidar and demonstrate our sensor API
11 stars 1 forks source link

ROS2 Support #1

Open gramss opened 4 years ago

gramss commented 4 years ago

Hey,

I just wanted to ask when you plan to release the promised ROS integration. It would be great to release them directly for ROS2 eloquent or foxy (LTS).

Thank you :) I hope this repo is appropriate for this question!

hybo-ilidar commented 4 years ago

Thanks for posting, @gramss. Initially, I tried to use the ROS serial port library, but ran into several problems which escape my memory at the moment. Eventually we chose libserialport from the sigrok project. Once other things settle down in the code and interface, I was planning to revisit ROS integration. Specifically, I recall reading that ROS2 was "better" and easier to work with.

Now that's only the actual serial port interface. Can you let us know what other types of ROS2 integration would be helpful in your project(s)?

-Chris

gramss commented 4 years ago

Hey Chris!

Thank you for your answer! Are you using an RTOS (FreeRTOS or Zephyr) under the hood? If so you could try implementing your firmware stack with MicroROS. This is the new standard for ROS running on microprocessors. What's cool about it is, that you can directly pub/sub topics, services from your micro-controller. Maybe you can ask the guys from eProsima to support you as a first real hardware product that supports MicroROS. Or second if you count CrazyFly drones :)

Data wise: the microcontroller speaks with an agent on the host via serial and the agent translates the raw data to the ROS2 language via DDS.

You can find everything here: https://micro-ros.github.io/ I tested MicroROS with Zephyr on a new board (that was not supported by them originally) and where quite happy with the results.

If you do not want to implement it on the hardware level. It would be great if you can write an agent that speaks your protocol. This agent would then push the messages in the ROS language. You could even do this agent open source, so others could help maintaining it in the future. As their should be no IP inside it other than using your API.

Would be cool if you could integrate it. This was the main purpose why I bought one of your lasers..

Cheers!

hybo-ilidar commented 4 years ago

We are not using MicroROS internally, and I suspect that would be too big a change in the near future. I will have a look at making an agent, that sounds more appropriate at the moment. Do you have any good examples of such agents you could point me to?

gramss commented 4 years ago

Hey, I asked the head of Navigation in ROS2 for some advice. This was his answer:

Steve: https://github.com/SteveMacenski/ros2_ouster_drivers Think of the /os1 directories as the "SDK/drivers" provided by the vendor that I wrap into ROS using lifecycle

I do though introduce some unique ideas I had around modular processors, but you can ignore that

Simpler examples: https://github.com/ros-drivers/phidgets_drivers/tree/melodic/phidgets_imu https://github.com/ros-drivers/urg_node

[Intel] Realsense as well, but those are overly complex for what they are

I hope this helps 👍

gramss commented 4 years ago

hey @hybo-ilidar any update on this? Cheers

coderkarl commented 3 years ago

Does anyone have the hybo-lidar sensor yet that wants the ros driver? Looking at src/sensor2csv.c, I would try reading the sensor continuously and publish the xyz points to a pointcloud2 message. Publish the imu data to an imu message. I might start a draft of the hybo-lidar ros-foxy driver that others can validate and fix. Do we want to have this api-demo c-code and the ros C++ driver in the same place, or should I try to write the ros package that simply depends on an independently built hybo-lidar library? My first attempt would probably be just fork this repo and add the ros package C++ folder somewhere. I may just throw all of this api-demo's src/ and include/ files in the ros package folder src/ and include/ directories. For now, if anyone else can do this quickly, please do so. It is all just my thoughts for now :)

The ros2 foxy node should be very similar to this sweep ros2 node I ported: https://github.com/coderkarl/sweep-ros/tree/foxy