Commit 2b21619
committed
AIRO-392 Fixing list index exception when planner fails
When the MoveIt trajectory planner fails to find a valid path, it
returns an empty list of path points. Our mover.py script assumes there
is always something in the list, so we get an exception when there is
not (which breaks our listener node and mandates a re-launch).
Added out of bounds checks and moved the response population to the
bottom to ensure we only send a path back when it is complete, and
otherwise send an empty response (for which the srv will print an adequate
error to console).
Tested by running DemoScene with out of bounds locations for target
placement.1 parent 1efc796 commit 2b21619
File tree
1 file changed
+18
-5
lines changed- tutorials/pick_and_place/ROS/src/niryo_moveit/scripts
1 file changed
+18
-5
lines changedLines changed: 18 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | | - | |
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
96 | 99 | | |
97 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
98 | 104 | | |
99 | 105 | | |
100 | | - | |
101 | 106 | | |
102 | 107 | | |
103 | 108 | | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
104 | 112 | | |
105 | 113 | | |
106 | | - | |
107 | 114 | | |
108 | 115 | | |
109 | 116 | | |
110 | 117 | | |
111 | | - | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
112 | 125 | | |
113 | 126 | | |
114 | 127 | | |
| |||
126 | 139 | | |
127 | 140 | | |
128 | 141 | | |
129 | | - | |
| 142 | + | |
0 commit comments