4 #include <boost/lexical_cast.hpp> 5 #include <boost/algorithm/string/predicate.hpp> 6 #include <boost/container/static_vector.hpp> 7 #include <boost/range/algorithm/copy.hpp> 8 #include <boost/range/algorithm/transform.hpp> 9 #include <boost/exception/all.hpp> 22 namespace LBRCommand {
41 typedef boost::container::static_vector<double, KUKA::LBRState::NUM_DOF>
44 typedef std::chrono::time_point<std::chrono::high_resolution_clock>
103 externalTorque.clear();
104 externalForce.clear();
105 commandedPosition.clear();
106 commandedTorque.clear();
107 commandedCartesianWrenchFeedForward.clear();
108 ipoJointPosition.clear();
109 commandedPosition_goal.clear();
110 goal_position_command_time_duration = 0;
114 commandedPosition.clear();
115 commandedTorque.clear();
116 commandedCartesianWrenchFeedForward.clear();
117 commandedPosition_goal.clear();
129 template <
typename OutputIterator>
131 copy(std::string model, OutputIterator it,
133 if (boost::iequals(model, KUKA_LBR_IIWA_14_R820)) {
145 maxVel.push_back(1.483529864195);
146 maxVel.push_back(1.483529864195);
147 maxVel.push_back(1.745329251994);
148 maxVel.push_back(1.308996938996);
149 maxVel.push_back(2.268928027593);
150 maxVel.push_back(2.356194490192);
151 maxVel.push_back(2.356194490192);
154 }
else if (boost::iequals(model, KUKA_LBR_IIWA_7_R800)) {
169 maxVel.push_back(1.71042);
170 maxVel.push_back(1.71042);
171 maxVel.push_back(1.74533);
172 maxVel.push_back(2.26893);
173 maxVel.push_back(2.44346);
174 maxVel.push_back(3.14159);
175 maxVel.push_back(3.14159);
199 is_running_automatically
205 typedef std::tuple<std::string, std::string, std::string, std::string,
210 return std::make_tuple(KUKA_LBR_IIWA_14_R820, std::string(
"192.170.10.100"),
211 std::string(
"30200"), std::string(
"192.170.10.2"),
212 std::string(
"30200"), run_automatically);
216 template <
typename T>
217 static boost::asio::ip::udp::socket
218 connect(T ¶ms, boost::asio::io_service &io_service_,
219 boost::asio::ip::udp::endpoint &sender_endpoint) {
220 std::string localhost(std::get<localhost>(params));
221 std::string lp(std::get<localport>(params));
222 short localport = boost::lexical_cast<
short>(lp);
223 std::string remotehost(std::get<remotehost>(params));
224 std::string rp(std::get<remoteport>(params));
225 short remoteport = boost::lexical_cast<
short>(rp);
226 std::cout <<
"using: " 227 <<
" " << localhost <<
" " << localport <<
" " << remotehost
228 <<
" " << remoteport <<
"\n";
230 boost::asio::ip::udp::socket s(
232 boost::asio::ip::udp::endpoint(
233 boost::asio::ip::address::from_string(localhost), localport));
235 boost::asio::ip::udp::resolver resolver(io_service_);
237 *resolver.resolve({boost::asio::ip::udp::v4(), remotehost, rp});
238 s.connect(sender_endpoint);
246 "KukaUDP: Unable to connect to Kuka FRI Koni UDP device " 247 "using boost::asio::udp::socket configured with localhost:localport " 249 std::get<localhost>(params) +
":" + std::get<localport>(params) +
250 " and remotehost:remoteport @ " + std::get<remotehost>(params) +
":" +
251 std::get<remoteport>(params) +
"\n");
joint_state velocity_limits
cartesian_state externalForce
cartesian_state wrenchJava
joint velocity constraint (ex: max velocity)
flatbuffer::ESafetyState safetyState
joint_state commandedPosition
time_point_type timestamp
Internal implementation class for driver use only, stores all the kuka state data in a simple object...
std::chrono::time_point< std::chrono::high_resolution_clock > time_point_type
boost::container::static_vector< double, 7 > cartesian_state
cartesian_state commandedCartesianWrenchFeedForward
OutputIterator copy(std::string model, OutputIterator it, grl::revolute_joint_velocity_open_chain_state_constraint_tag)
copy vector of joint velocity limits in radians/s
double goal_position_command_time_duration
joint_state ipoJointPosition
static void add_details_to_connection_error(boost::exception &e, Params ¶ms)
constexpr auto KUKA_LBR_IIWA_14_R820
flatbuffer::EOperationMode operationMode
joint_state ipoJointPositionOffsets
boost::error_info< struct tag_errmsg, std::string > errmsg_info
constexpr auto KUKA_LBR_IIWA_7_R800
joint_state commandedPosition_goal
we need to mind arm constraints, so we set a goal then work towards it
const int LBRMONITORMESSAGEID
flatbuffer::EDriveState driveState
boost::container::static_vector< double, KUKA::LBRState::NUM_DOF > joint_state
flatbuffer::ESessionState sessionState
joint_state externalTorque
static boost::asio::ip::udp::socket connect(T ¶ms, boost::asio::io_service &io_service_, boost::asio::ip::udp::endpoint &sender_endpoint)
Advanced functionality, do not use without a great reason.
const int LBRCOMMANDMESSAGEID
std::tuple< std::string, std::string, std::string, std::string, std::string, ThreadingRunMode > Params
flatbuffer::EConnectionQuality connectionQuality
joint_state commandedTorque
static const Params defaultParams()
Internal class, defines some default status variables.
std::chrono::milliseconds sendPeriod