37 #include <QFontDatabase>
46 #include "Entypo_Social.dat"
47 #include "fontawesome.dat"
53 int addFont(
unsigned char* data,
unsigned int data_len)
57 QByteArray::fromRawData(
58 reinterpret_cast<const char*
>(data), data_len);
60 QFontDatabase::addApplicationFontFromData(entypo);
69 return (std::abs(a -
b) < 0.01);
86 return QFont(
"Entypo Social");
90 return QFont(
"Entypo");
93 return QFont(
"Font Awesome 5 Free");
127 Ogre::SceneNode* parent,
130 need_to_update_(false),
134 square_object_->rebuildPolygon();
170 const std::string& frame_id)
194 if (
action_ == jsk_rviz_plugins::Pictogram::DELETE) {
204 Ogre::Vector3 position;
205 Ogre::Quaternion quaternion;
212 ROS_ERROR(
"Error transforming pose from frame '%s'",
217 if (
action_ == jsk_rviz_plugins::Pictogram::ADD) {
221 else if (
action_ == jsk_rviz_plugins::Pictogram::ROTATE_Z ||
222 action_ == jsk_rviz_plugins::Pictogram::ROTATE_X ||
223 action_ == jsk_rviz_plugins::Pictogram::ROTATE_Y) {
225 if (
action_ == jsk_rviz_plugins::Pictogram::ROTATE_Z) {
226 axis = Ogre::Vector3(0, 0, 1);
228 else if (
action_ == jsk_rviz_plugins::Pictogram::ROTATE_X) {
229 axis = Ogre::Vector3(1, 0, 0);
231 else if (
action_ == jsk_rviz_plugins::Pictogram::ROTATE_Y) {
232 axis = Ogre::Vector3(0, 1, 0);
238 Ogre::Quaternion offset;
239 offset.FromAngleAxis(
theta, axis);
240 Ogre::Quaternion final_rot = quaternion * offset;
244 else if (
action_ == jsk_rviz_plugins::Pictogram::JUMP ||
245 action_ == jsk_rviz_plugins::Pictogram::JUMP_ONCE) {
246 bool jumpingp =
false;
247 if (
action_ == jsk_rviz_plugins::Pictogram::JUMP) {
250 else if (
action_ == jsk_rviz_plugins::Pictogram::JUMP_ONCE &&
262 Ogre::Vector3 new_pos = position + quaternion * Ogre::Vector3(height, 0, 0);
268 double exceeded_time;
272 setAction(jsk_rviz_plugins::Pictogram::DELETE);
292 QColor transparent(255, 255, 255, 0);
293 QImage Hud = buffer.getQImage(128, 128, transparent);
294 QPainter painter( &Hud );
295 painter.setRenderHint(QPainter::Antialiasing,
true);
297 painter.setPen(QPen(foreground, 5, Qt::SolidLine));
303 font.setPointSize(100);
306 font.setPointSize(45);
309 painter.drawText(0, 0, 128, 128,
310 Qt::AlignHCenter | Qt::AlignVCenter,
313 }
else if(
mode_ == jsk_rviz_plugins::Pictogram::STRING_MODE){
314 QFont
font(
"Liberation Sans");
315 font.setPointSize(32);
317 painter.setFont(
font);
318 painter.drawText(0, 0, 128, 128,
319 Qt::TextWordWrap | Qt::AlignHCenter | Qt::AlignVCenter,
414 if (
msg->action == jsk_rviz_plugins::Pictogram::DELETE) {
418 if (
msg->size <= 0.0) {
426 msg->color.b * 255));