15 #include "ui_jointpanel.h" 17 using namespace se2ez;
27 for (
const auto &name :
robot_->getFrameNames())
29 const auto &data =
robot_->getFrameDataConst(name);
31 ui_->ees->addItem(QString(name.
c_str()));
34 ui_->ees->setCurrentIndex(
ui_->ees->count() - 1);
36 cm_ = std::make_shared<Box2DCollisionManager>(
robot_);
37 for (
const auto &name :
robot_->getFrameNames())
44 ui_->vbox->insertWidget(0, jw);
51 connect(
ui_->reset, SIGNAL(clicked()),
this, SLOT(
reset()));
52 connect(
ui_->random, SIGNAL(clicked()),
this, SLOT(
random()));
59 connect(
ui_->ees, SIGNAL(currentIndexChanged(
const QString &)),
this, SLOT(
updateIK()));
69 ee_ =
ui_->ees->currentText().toStdString();
70 if (
ui_->aware->isChecked())
71 ik_ = std::make_shared<CollisionAwareChainIK>(
robot_,
ee_);
80 if (
ui_->geometry->isChecked())
82 if (
ui_->sd->isChecked())
85 else if (
ui_->collide->isChecked())
97 for (
const auto &joint :
joints_)
125 return robot_->getSignature();
132 for (
const auto &joint :
joints_)
142 for (
const auto &joint :
joints_)
150 unsigned int tries = 0;
157 }
while ((tries++ < 50) && inCollision);
160 for (
const auto &joint :
joints_)
171 bool geo =
ui_->geometry->isChecked();
174 if (
ui_->sd->isChecked())
176 std::make_shared<RenderArea::SignedDistanceDrawer>(
177 ui_->collide->isChecked(),
ui_->sd->checkState() == Qt::PartiallyChecked,
181 std::make_shared<RenderArea::CollideDrawer>(
ui_->collide->isChecked(),
185 bool frames =
ui_->frames->isChecked();
192 painter.resetTransform();
195 canvas->
toScreen(pose[0], pose[1], ax, ay);
196 painter.drawText(ax + 5, ay - 5,
name);
208 for (
const auto &joint :
joints_)
X- and Y-axis components.
void randomCollisionFree()
A shared pointer wrapper for se2ez::State.
Eigen::Vector3d flattenIsometry(const Eigen::Isometry2d &frame)
Converts a transformation frame into a vector [x, y, t] composed of a translation (x...
std::recursive_mutex mutex_
void setState(const StatePtr &state)
void update(boost::posix_time::ptime last, boost::posix_time::ptime current) override
std::set< std::string > colliding_
bool click(QMouseEvent *event, double x, double y, int sx, int sy) override
Fixed joint, just a rigid transformation.
void drawGeometry(QPainter &painter, RobotPtr robot, StatePtr state, GeometryDrawerPtr drawer=nullptr)
std::string getSignature()
const std::string & getEE()
void toScreen(double xin, double yin, int &xout, int &yout)
CollisionManager::SignedDistance minimum_
CollisionManager::SignedDistanceMap distances_
JointPanel(RobotPtr robot, std::string name, QWidget *parent=0)
std::vector< JointWidget * > joints_
void drawAllFrames(QPainter &painter, RobotPtr robot, StatePtr state)
A shared pointer wrapper for se2ez::Robot.
void draw(QPainter &painter, RenderArea *canvas) override
The canvas widget. It contains all the drawing functions as well as all the general settings for draw...
const RobotPtr & getRobot()
const StatePtr & getState()