Skip to main content

A Tutorial to Use the MediaPipe Framework with ROS2

  • Chapter
  • First Online:
Robot Operating System (ROS)

Abstract

This chapter presents a tutorial on the use of the MediaPipe package for ROS2, developed by the authors. Through the MediaPipe framework it is possible to collect data from the positions of the hand, face and body of an operator, using a webcam, and publish them in ROS2 topics, which can be used for various applications in robotics. A complete example application using this technology is also covered in this chapter. MediaPipe is used to collect data from the image of an operator’s pose (hands, fingers, face and body positions), and this information is then used to control the navigation of a robot inside a simulated environment. The programming language used is Python and the only hardware needed for execution is a computer with Linux Ubuntu 20.04, ROS2 Galactic and a webcam. At the end of the chapter, the reader will be able to develop control strategies or other functionalities that use information about the movements of the operator, captured directly by the developed ROS2 package, through a webcam. All files used in this chapter can be accessed from the link https://github.com/dmartinelli1997/media_pipe_ros2, as well as the project videos. All code used in this project can be found in the following repository: https://github.com/dmartinelli1997/Script_ROSBOOK2021.git. (This project was partially funded by National Counsil of Technological and Scientific Development of Brazil (CNPq), and by Coordination for the Improvement of Higher Level People (CAPES).) (This study was financed by the Human Resource Program of The Brazilian National Agency for Petroleum, Natural Gas, and Biofuels—PRH-ANP—FINEP Management, contractual instrument n\(^{\circ }\) 0.1.19.0240.00, Ref 0431/19 - PRH21-UTFPR.)

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 109.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 139.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info
Hardcover Book
USD 199.99
Price excludes VAT (USA)
  • Durable hardcover edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. LLC, G.: Mediapipe (2020). https://google.github.io/mediapipe/

  2. Yam-Viramontes, B.A., Mercado-Ravell, D.: Implementation of a natural user interface to command a drone. In: 2020 International Conference on Unmanned Aircraft Systems (ICUAS), pp. 1139–1144. IEEE (2020)

    Google Scholar 

  3. Vighneshwara, C., Kini, M.S., Shenoy, K.P.: Robot motion control using openpose. In: Smart Sensors Measurements and Instrumentation, pp. 49–57. Springer (2021)

    Google Scholar 

  4. Martinelli, D., Sousa, A.L., Augusto, M.E., Kalempa, V.C., de Oliveira, A.S., Rohrich, R.F., Teixeira, M.A.: Remote control for mobile robots using gestures captured by the rgb camera and recognized by deep learning techniques. In: Latin American Robotics Symposium (LARS), 2019 Brazilian Symposium on Robotics (SBR) and 2019 Workshop on Robotics in Education (WRE), pp. 98–103. IEEE (2019)

    Google Scholar 

  5. Cao, Z., Hidalgo, G., Simon, T., Wei, S.-E., Sheikh, Y.: Openpose: realtime multi-person 2d pose estimation using part affinity fields. IEEE Trans. Pattern Anal. Mach. Intell. 43(1), 172–186 (2019)

    Google Scholar 

  6. Team, O.: Opencv (2021). https://opencv.org/

  7. LLC, G.: Mediapipe (2020). https://google.github.io/mediapipe/getting_started/getting_started.html

  8. da Silva Neto, J.G., Teixeira, J.M.X.N., Teichrieb, V.: Analyzing embedded pose estimation solutions for human behaviour understanding. In: Anais Estendidos do XXII Simpósio de Realidade Virtual e Aumentada, pp. 30–34. SBC (2020)

    Google Scholar 

  9. Foundation, O.S.R.: Gazebosim (2014). http://gazebosim.org/

  10. Foundation, O.S.R: Gazebosim (2014). https://www.turtlebot.com/

  11. Team, O.: Openposedoc (2021). https://github.com/tramper2/openpose/blob/master/doc/installation.md

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Dieisson Martinelli .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2023 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this chapter

Check for updates. Verify currency and authenticity via CrossMark

Cite this chapter

Martinelli, D., Cerbaro, J., Teixeira, M.A.S., Fabro, J.A., Schneider de Oliveira, A. (2023). A Tutorial to Use the MediaPipe Framework with ROS2. In: Koubaa, A. (eds) Robot Operating System (ROS). Studies in Computational Intelligence, vol 1051. Springer, Cham. https://doi.org/10.1007/978-3-031-09062-2_1

Download citation

Publish with us

Policies and ethics