Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Check the generated C code of analytic IK against MISRA C

Đang mở
#839 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
48/100
Loại issue
Tái cấu trúc
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Sôi nổi
Công nghệ
c, cpp, python
Lĩnh vực
embedded-iot, robotics

Hướng nghiên cứu

On the feat/symbolic-ik branch, read src/roboticstoolbox/robot/symbolic_ik.py and symbolic_ik_rr.py; use docs/notebooks/ik-symbolic.ipynb to generate the Puma and Jaco C files. Run a MISRA C checker, record violations by rule, and identify inexpensive generator fixes. Done when cheap fixes are made and remaining deviations are documented.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

help wanted

Analytic inverse kinematics can write its solution as C code that needs no library: robot.analytic_ik().generate("c", "my_ik"). This is on the branch feat/symbolic-ik and is not yet merged. We would like to know how close that C code is to MISRA C, since it is meant for embedded use, and to fix the generator where that is cheap.

What we know. I checked the generated C for the Puma 560, Stanford, UR5 and Jaco:

  • no malloc, calloc, realloc or free
  • no input or output, and no goto, setjmp or longjmp
  • no library other than math.h, and string.h for the general 6R code
  • fixed-size working arrays, and the caller provides the array for the solutions
  • no recursion and no variable-length arrays
  • no warnings with cc -std=c99 -pedantic -Wall -Wextra -Wvla

What we don't know. The code has not been checked against MISRA C:2012 or any other coding standard, so we say only that it avoids dynamic memory, not that it is compliant. The C++ output returns a std::vector, which allocates, and is out of scope here.

Help wanted:

  • run a MISRA checker on the generated Puma and Jaco files (for example cppcheck with its MISRA addon, or a commercial tool)
  • list the violations by rule, and say which look cheap to fix in the generator, for example floating-point equality, NAN, multiple returns, or implicit conversions
  • fix those, and document the deviations that we keep

The generator is symbolic_ik.py and symbolic_ik_rr.py in src/roboticstoolbox/robot/ on that branch. The notebook docs/notebooks/ik-symbolic.ipynb shows how to generate the code.

🤖 Generated with Claude Code

Ngôn ngữ chính
C++
Star
3.5k
Fork
639
Merge trung bình
1 ngày 8 giờ
Pull request đã merge (30 ngày)
113

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của petercorke/robotics-toolbox-python

Tất cả issue của petercorke/robotics-toolbox-python

Issue tương tự

Thêm issue về C++

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.