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

#1930 Modified copy_ros_msg.cpp file #12

Open
wants to merge 82 commits into
base: moveit_py
Choose a base branch
from

Conversation

Sujeendra
Copy link

@Sujeendra Sujeendra commented Feb 8, 2023

… loops to range based forloop.

Description

MoveIt Python Library: Replace Traditional For Loops with Range-based For Loops moveit#1930

All the traditional for loops within moveit_py folder are replaced with range based for loop.

Checklist

  • Required by CI: Code is auto formatted using clang-format
  • Extend the tutorials / documentation reference
  • Document API changes relevant to the user in the MIGRATION.md notes
  • Create tests, which fail without this PR reference
  • Include a screenshot if changing a GUI
  • While waiting for someone to review your request, please help review another open pull request to support the maintainers

peterdavidfagan and others added 30 commits February 6, 2023 11:52
Co-authored-by: Henning Kayser <[email protected]>
Co-authored-by: Henning Kayser <[email protected]>
Co-authored-by: Henning Kayser <[email protected]>
this commit also adds back the record function as it is a requirement of the abstract base class Teleop
@peterdavidfagan peterdavidfagan force-pushed the moveit_py branch 2 times, most recently from 517d313 to 0417485 Compare February 8, 2023 18:26
@peterdavidfagan
Copy link
Owner

Hi @Sujeendra,

I am going to cherry pick your changes and add you as a coauthor on the commit. Ideally I would ask for you to rebase this but it is likely quicker to simply cherry pick in this case.

@peterdavidfagan
Copy link
Owner

Hi @Sujeendra,

There are some errors when building the library based off of your changes see output below for details:

Starting >>> moveit
--- stderr: moveit_py                                               
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp: In function ‘shape_msgs::msg::Mesh moveit_py::moveit_py_utils::MeshToCpp(const pybind11::object&)’:
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:152:44: error: invalid initialization of reference of type ‘const pybind11::object&’ from expression of type ‘pybind11::handle*’
  152 |     mesh_cpp.vertices.push_back(PointToCpp(&vertex));
      |                                            ^~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:86:56: note: in passing argument 1 of ‘geometry_msgs::msg::Point moveit_py::moveit_py_utils::PointToCpp(const pybind11::object&)’
   86 | geometry_msgs::msg::Point PointToCpp(const py::object& point)
      |                                      ~~~~~~~~~~~~~~~~~~^~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:157:52: error: invalid initialization of reference of type ‘const pybind11::object&’ from expression of type ‘pybind11::handle’
  157 |     mesh_cpp.triangles.push_back(MeshTriangleToCpp(triangle));
      |                                                    ^~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:134:67: note: in passing argument 1 of ‘shape_msgs::msg::MeshTriangle moveit_py::moveit_py_utils::MeshTriangleToCpp(const pybind11::object&)’
  134 | shape_msgs::msg::MeshTriangle MeshTriangleToCpp(const py::object& mesh_triangle)
      |                                                 ~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp: In function ‘moveit_msgs::msg::BoundingVolume moveit_py::moveit_py_utils::BoundingVolumeToCpp(const pybind11::object&)’:
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:172:29: error: invalid initialization of reference of type ‘const pybind11::object&’ from expression of type ‘pybind11::handle’
  172 |         SolidPrimitiveToCpp(primitive));
      |                             ^~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:120:71: note: in passing argument 1 of ‘shape_msgs::msg::SolidPrimitive moveit_py::moveit_py_utils::SolidPrimitiveToCpp(const pybind11::object&)’
  120 | shape_msgs::msg::SolidPrimitive SolidPrimitiveToCpp(const py::object& primitive)
      |                                                     ~~~~~~~~~~~~~~~~~~^~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:179:19: error: invalid initialization of reference of type ‘const pybind11::object&’ from expression of type ‘pybind11::handle’
  179 |         PoseToCpp(primitive_pose));
      |                   ^~~~~~~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:55:54: note: in passing argument 1 of ‘geometry_msgs::msg::Pose moveit_py::moveit_py_utils::PoseToCpp(const pybind11::object&)’
   55 | geometry_msgs::msg::Pose PoseToCpp(const py::object& pose)
      |                                    ~~~~~~~~~~~~~~~~~~^~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:185:52: error: invalid initialization of reference of type ‘const pybind11::object&’ from expression of type ‘pybind11::handle’
  185 |     bounding_volume_cpp.meshes.push_back(MeshToCpp(mesh));
      |                                                    ^~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:145:51: note: in passing argument 1 of ‘shape_msgs::msg::Mesh moveit_py::moveit_py_utils::MeshToCpp(const pybind11::object&)’
  145 | shape_msgs::msg::Mesh MeshToCpp(const py::object& mesh)
      |                                 ~~~~~~~~~~~~~~~~~~^~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:191:56: error: invalid initialization of reference of type ‘const pybind11::object&’ from expression of type ‘pybind11::handle’
  191 |     bounding_volume_cpp.mesh_poses.push_back(PoseToCpp(mesh_pose));
      |                                                        ^~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:55:54: note: in passing argument 1 of ‘geometry_msgs::msg::Pose moveit_py::moveit_py_utils::PoseToCpp(const pybind11::object&)’
   55 | geometry_msgs::msg::Pose PoseToCpp(const py::object& pose)
      |                                    ~~~~~~~~~~~~~~~~~~^~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp: In function ‘moveit_msgs::msg::CollisionObject moveit_py::moveit_py_utils::CollisionObjectToCpp(const pybind11::object&)’:
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:281:28: error: conversion from ‘pybind11::handle’ to non-scalar type ‘pybind11::object’ requested
  281 |     py::object primitive = py_primitive;
      |                            ^~~~~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:290:33: error: conversion from ‘pybind11::handle’ to non-scalar type ‘pybind11::object’ requested
  290 |     py::object primitive_pose = py_primitive_pose;
      |                                 ^~~~~~~~~~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:300:23: error: conversion from ‘pybind11::handle’ to non-scalar type ‘pybind11::object’ requested
  300 |     py::object mesh = py_mesh;
      |                       ^~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:309:28: error: conversion from ‘pybind11::handle’ to non-scalar type ‘pybind11::object’ requested
  309 |     py::object mesh_pose = py_mesh_pose;
      |                            ^~~~~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp: In function ‘moveit_msgs::msg::Constraints moveit_py::moveit_py_utils::ConstraintsToCpp(const pybind11::object&)’:
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:329:35: error: conversion from ‘pybind11::handle’ to non-scalar type ‘pybind11::object’ requested
  329 |     py::object joint_constraint = py_joint_constraint;
      |                                   ^~~~~~~~~~~~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:338:38: error: conversion from ‘pybind11::handle’ to non-scalar type ‘pybind11::object’ requested
  338 |     py::object position_constraint = py_position_constraint;
      |                                      ^~~~~~~~~~~~~~~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:347:41: error: conversion from ‘pybind11::handle’ to non-scalar type ‘pybind11::object’ requested
  347 |     py::object orientation_constraint = py_orientation_constraint;
      |                                         ^~~~~~~~~~~~~~~~~~~~~~~~~
/home/peterdavidfagan/Code/ws_moveit2/src/moveit2/moveit_py/src/moveit/moveit_py_utils/src/copy_ros_msg.cpp:356:40: error: conversion from ‘pybind11::handle’ to non-scalar type ‘pybind11::object’ requested
  356 |     py::object visibility_constraint = py_visibility_constraint;
      |                                        ^~~~~~~~~~~~~~~~~~~~~~~~
gmake[2]: *** [src/moveit/moveit_py_utils/CMakeFiles/moveit_py_utils.dir/build.make:76: src/moveit/moveit_py_utils/CMakeFiles/moveit_py_utils.dir/src/copy_ros_msg.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:263: src/moveit/moveit_py_utils/CMakeFiles/moveit_py_utils.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< moveit_py [4.85s, exited with code 2]
Aborted  <<< moveit [0.26s]

Would it be possible to address these, I will retest your changes and merge them after these issues have been resolved.

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.

3 participants