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

Port to ROS2 foxy #248

Draft
wants to merge 19 commits into
base: foxy-devel
Choose a base branch
from
Draft

Conversation

agutenkunst
Copy link
Contributor

@agutenkunst agutenkunst commented Apr 8, 2021

I started porting this a while ago. Builds and runs with foxy.

Remarks for supporters:

Here are some remarks to get starting supporting this port

Create markers

Still a bit fuzzy with the correct deps

ros2 run aruco_detect create_markers.py 101 102 fiducials.pdf

Or use fiducials.pdf

Perform fiducial detection using USB camera

I am using a fork from https://github.com/klintan/ros2_usb_camera with this patch to deal with ros-perception/image_common#156

With git clone -b bad_patch_do_not_merge [email protected]:agutenkunst/ros2_usb_camera.git

(check that corrected calibration file is attached)

ros2 launch usb_camera_driver usb_camera_node.launch.py

Note: Just using some "valid" calibration data should be fine.

Probably https://github.com/ros-drivers/usb_cam/tree/ros2 works as well.

Start detection with

ros2 launch aruco_detect aruco_detect.launch.py

Check images in rviz with

ros2 run rviz2 rviz2 -d src/fiducials/aruco_detect/cfg/fiducials.rviz2.rviz

Should look like:
image

Perform Fiducials SLAM

  • Start detection like above

  • In addition:

Publish static transforms

ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 base_link camera
ros2 run tf2_ros static_transform_publisher 0 0 0 0 0 0 odom base_link
ros2 launch fiducial_slam fiducial_slam.launch.py

DONE

  • Rebase/Reintegrate everything from 1afc4b9 and later
  • Port tests
    • aruco_detect_images test (see a5b3c59)
    • fiducial_slam test
  • Implement the handling of parameter updates
    • Port ROS1 FiducialsNode::configCallback functionality into FiducialsNode::param_change_callback (more info)[http://design.ros2.org/articles/ros_parameters.html]

IN PROGRESS

TODOs

  • Port aruco_gazebo(?)
  • Check that fiducial_slam is working as expected (help wanted)
  • Check that aruco_gazebo is working
  • Add CI

NOT TODO

  • Fix formatting
    • To keep the diff somehow readable I suggest postponing a (really needed) fix of the formating with clang-format
  • Increase testablility
    • Would be really helpful and maybe the first thing to start once this is upstream. Especially some unittests for the detection shouldn't hurt.

I hope this is a helpful starting point and I will try to get to the first three points in the next two weeks.

Anyone interested in supporting is welcome!

@agutenkunst agutenkunst changed the title Port to ROS2 foxy (draft) Port to ROS2 foxy Apr 8, 2021
@agutenkunst
Copy link
Contributor Author

This closes #247

@MoffKalast
Copy link
Contributor

MoffKalast commented Apr 9, 2021

Nice work, we definitely wouldn't merge this into kinetic-devel though as that would break ROS 1, there'd have to be a separate foxy branch. I can make one if you want to fork from it for ease of merging later on. Edit: Moved to foxy-devel.

Right now though I think just about nobody on the dev team actually uses ROS 2 yet, nor can our robot run it because it's a 32 bit system, so we have no practical way of testing the whole thing.

@MoffKalast MoffKalast changed the base branch from kinetic-devel to foxy-devel April 9, 2021 14:58
@agutenkunst
Copy link
Contributor Author

Actually that was meant to target this branch. Force of habit. Thanks for fixing.

I can try to provide some demo videos of the current state for you to decide on the readiness.

@einstine909
Copy link

I am interested in helping port this to Foxy. I have it compiled, but not successfully detecting any markers. Please advise on how I can best assist.

@agutenkunst
Copy link
Contributor Author

Update

  • Added "Remarks for supporters" to the description to help others contribute
  • Fixed an issue of aruco_detect crashing on first detection

@agutenkunst
Copy link
Contributor Author

@einstine909 Help of any kind is welcome!

First of try I would recoomend to get the basic detection running and move on the fiducial_slam after this.

To gain confidence in the porting I consider the tests the be of high piority. Yet I also have no experience in ROS2 testing and especially ROS2/rclcpp/launch testing seems to be a bit more challenging than launch-testing in ROS1.

Depending on your experience you could see if the first TODO "Implement the handling of parameter updates" is suitable for you?

Otherwise just pointing out stuff I missed etc and testing the ported functionality also really helps!

I suggest opening a PR to https://github.com/agutenkunst/fiducials/tree/ros2 if you have changes contributing to this PR

@agutenkunst
Copy link
Contributor Author

agutenkunst commented Jul 2, 2021

@rohbotics @MoffKalast @JanezCim

I still will have play around with this.
Also I am not sure about aruco_gazebo but I will try to have a look at it.

What do you think how we should preceed? Is there more information / demos you need?

@jdekarske
Copy link

Thanks for porting this! My build fails unfortunately:

--- stderr: fiducial_slam                           
CMake Error at CMakeLists.txt:91 (find_package):
  By not providing "Findament_cmake_nose.cmake" in CMAKE_MODULE_PATH this
  project has asked CMake to find a package configuration file provided by
  "ament_cmake_nose", but CMake did not find one.

  Could not find a package configuration file provided by "ament_cmake_nose"
  with any of the following names:

    ament_cmake_noseConfig.cmake
    ament_cmake_nose-config.cmake

  Add the installation prefix of "ament_cmake_nose" to CMAKE_PREFIX_PATH or
  set "ament_cmake_nose_DIR" to a directory containing one of the above
  files.  If "ament_cmake_nose" provides a separate development package or
  SDK, be sure it has been installed.


---
Failed   <<< fiducial_slam [1.16s, exited with code 1]

Summary: 12 packages finished [2.27s]
  1 package failed: fiducial_slam
  1 package had stderr output: fiducial_slam

I sidestepped, assuming this is just used for testing.

@enunezs
Copy link

enunezs commented Aug 15, 2022

Hello!

It might have been some time since this was last active, but I am also interested in using, porting the fiducial system to ROS 2.

I'm an newbie on Github contributions/open source work, but have some experience in ROS2. Is the work still being carried on this repo or on the fork?

@anfederman
Copy link

anfederman commented Aug 15, 2022 via email

@enunezs
Copy link

enunezs commented Aug 15, 2022

Thanks for the quick reply!

I have previously used Ros2bridge to connect a webcam to detect fiducials, but the bridge compilation times made it unfeasible on my system. I ended making a basic python wrapper of the cv2 library for the detection functionality, which ended working quite alright.

Were the previous porting attempts based on this guide? ROS1-to-ROS2-porting

Im currently working in Foxy. Are the differences between versions too great?

@agutenkunst
Copy link
Contributor Author

Due to a change in field I won't be able to continue that and it probably is hugely outdated. Feel free to take whatever is still useful and open own PR.

@davecrawley
Copy link
Contributor

davecrawley commented Aug 15, 2022 via email

@enunezs
Copy link

enunezs commented Aug 23, 2022

Thanks David, very appreciated

@anfederman
Copy link

anfederman commented Aug 23, 2022 via email

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

Successfully merging this pull request may close these issues.

7 participants