Skip to content

Commit 2e26dfe

Browse files
committed
Removed unreachable code
1 parent f668a02 commit 2e26dfe

2 files changed

Lines changed: 0 additions & 46 deletions

File tree

include/ur_client_library/exceptions.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -217,22 +217,6 @@ class UnsupportedMotionType : public UrException
217217
}
218218
};
219219

220-
/*!
221-
* \brief Thrown when data received from or passed through the library does not match the
222-
* expected structure or value range.
223-
*
224-
* Examples include motion targets whose variant alternative is not handled by the corresponding
225-
* primitive constructor.
226-
*/
227-
class InvalidData : public UrException
228-
{
229-
public:
230-
explicit InvalidData() = delete;
231-
explicit InvalidData(const std::string& error_text) : std::runtime_error(error_text)
232-
{
233-
}
234-
};
235-
236220
class UnknownVariable : public UrException
237221
{
238222
private:

src/control/trajectory_point_interface.cpp

Lines changed: 0 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -102,11 +102,6 @@ bool TrajectoryPointInterface::writeMotionPrimitive(const std::shared_ptr<contro
102102
movej_primitive->target_pose.z, movej_primitive->target_pose.rx,
103103
movej_primitive->target_pose.ry, movej_primitive->target_pose.rz };
104104
}
105-
else
106-
{
107-
throw InvalidData("Motion type " + motionTypeToString(movej_primitive->type) +
108-
" is not allowed in a MoveJPrimitive.");
109-
}
110105
second_block.fill(primitive->velocity);
111106
third_block.fill(primitive->acceleration);
112107
break;
@@ -125,11 +120,6 @@ bool TrajectoryPointInterface::writeMotionPrimitive(const std::shared_ptr<contro
125120
{
126121
first_block = movel_primitive->target_joint_configuration;
127122
}
128-
else
129-
{
130-
throw InvalidData("Motion type " + motionTypeToString(movel_primitive->type) +
131-
" is not allowed in a MoveLPrimitive.");
132-
}
133123
second_block.fill(primitive->velocity);
134124
third_block.fill(primitive->acceleration);
135125
break;
@@ -148,11 +138,6 @@ bool TrajectoryPointInterface::writeMotionPrimitive(const std::shared_ptr<contro
148138
{
149139
first_block = movep_primitive->target_joint_configuration;
150140
}
151-
else
152-
{
153-
throw InvalidData("Motion type " + motionTypeToString(movep_primitive->type) +
154-
" is not allowed in a MovePPrimitive.");
155-
}
156141
second_block.fill(primitive->velocity);
157142
third_block.fill(primitive->acceleration);
158143
break;
@@ -191,11 +176,6 @@ bool TrajectoryPointInterface::writeMotionPrimitive(const std::shared_ptr<contro
191176
movec_primitive->via_point_pose.z, movec_primitive->via_point_pose.rx,
192177
movec_primitive->via_point_pose.ry, movec_primitive->via_point_pose.rz };
193178
}
194-
else
195-
{
196-
throw InvalidData("Motion type " + motionTypeToString(movec_primitive->type) +
197-
" is not allowed in a MoveCPrimitive.");
198-
}
199179
third_block = {
200180
primitive->velocity, primitive->acceleration, static_cast<double>(movec_primitive->mode), 0, 0, 0
201181
};
@@ -226,11 +206,6 @@ bool TrajectoryPointInterface::writeMotionPrimitive(const std::shared_ptr<contro
226206
optimovej_primitive->target_pose.z, optimovej_primitive->target_pose.rx,
227207
optimovej_primitive->target_pose.ry, optimovej_primitive->target_pose.rz };
228208
}
229-
else
230-
{
231-
throw InvalidData("Motion type " + motionTypeToString(optimovej_primitive->type) +
232-
" is not allowed in an OptimoveJPrimitive.");
233-
}
234209
second_block.fill(primitive->velocity);
235210
third_block.fill(primitive->acceleration);
236211
break;
@@ -249,11 +224,6 @@ bool TrajectoryPointInterface::writeMotionPrimitive(const std::shared_ptr<contro
249224
{
250225
first_block = optimovel_primitive->target_joint_configuration;
251226
}
252-
else
253-
{
254-
throw InvalidData("Motion type " + motionTypeToString(optimovel_primitive->type) +
255-
" is not allowed in an OptimoveLPrimitive.");
256-
}
257227
second_block.fill(primitive->velocity);
258228
third_block.fill(primitive->acceleration);
259229
break;

0 commit comments

Comments
 (0)