-
Notifications
You must be signed in to change notification settings - Fork 437
Prevent segfault in PyKDL when asking for nonexisting segment of chain #228
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
base: master
Are you sure you want to change the base?
Changes from 2 commits
3663023
6eb2246
7fdc4e4
0816b90
4c9b0af
8698e70
114bad4
ceb57a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -251,8 +251,15 @@ public: | |
|
|
||
| unsigned int getNrOfJoints()const; | ||
| unsigned int getNrOfSegments()const; | ||
|
|
||
| const Segment& getSegment(unsigned int nr)const /Factory/; | ||
|
|
||
| const Segment* getSegment(unsigned int nr)const /Factory/; | ||
| %MethodCode | ||
| if (a0 < 0 || a0 >= (unsigned int)sipCpp->getNrOfSegments()) { | ||
| PyErr_SetString(PyExc_IndexError, "Chain index out of range"); | ||
| return 0; | ||
| } | ||
| sipRes = &(sipCpp->getSegment(a0)); | ||
|
||
| %End | ||
|
|
||
| }; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.