Commit 8f623786 authored by roangel's avatar roangel
Browse files

Added number to CF picture

parent b4731549
......@@ -2,6 +2,15 @@
<qresource>
<file>images/drone.png</file>
<file>images/drone.svg</file>
<file>images/drone_fixed.svg</file>
<file>images/drone_fixed_unk.svg</file>
<file>images/drone_fixed_01.svg</file>
<file>images/drone_fixed_02.svg</file>
<file>images/drone_fixed_03.svg</file>
<file>images/drone_fixed_04.svg</file>
<file>images/drone_fixed_05.svg</file>
<file>images/drone_fixed_06.svg</file>
<file>images/drone_fixed_07.svg</file>
<file>images/drone_fixed_08.svg</file>
<file>images/drone_fixed_09.svg</file>
</qresource>
</RCC>
......@@ -109,10 +109,10 @@
inkscape:window-height="1056"
id="namedview44"
showgrid="false"
inkscape:zoom="4"
inkscape:cx="833.67431"
inkscape:cy="492.65047"
inkscape:window-x="65"
inkscape:zoom="0.25"
inkscape:cx="-682.66486"
inkscape:cy="126.58059"
inkscape:window-x="1985"
inkscape:window-y="24"
inkscape:window-maximized="1"
inkscape:current-layer="g8" /><metadata
......@@ -212,4 +212,23 @@
inkscape:randomized="0"
d="m 9319.668,-309.50273 208.5907,361.289776 -417.1815,-1.1e-5 z"
transform="matrix(0,-1,-1,0,8848.5252,9443.3107)"
inkscape:transform-center-x="-6.0215077" /></g></g></svg>
\ No newline at end of file
inkscape:transform-center-x="-6.0215077" /><circle
style="fill:#000000;fill-opacity:1"
id="path4216"
cx="4997.9189"
cy="-124.28629"
r="1755"
transform="scale(1,-1)" /><text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:1195.98522949px;line-height:125%;font-family:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="3831.803"
y="1299.1415"
id="text3369"
sodipodi:linespacing="125%"
transform="scale(1,-1)"><tspan
sodipodi:role="line"
id="tspan3371"
x="3831.803"
y="1299.1415"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:4484.89257812px;line-height:125%;font-family:'Abyssinica SIL';-inkscape-font-specification:'Abyssinica SIL, Normal';text-align:start;writing-mode:lr-tb;text-anchor:start;fill:#f7fdfd;fill-opacity:1">3</tspan></text>
</g></g></svg>
\ No newline at end of file
......@@ -20,7 +20,7 @@ using namespace d_fall_pps;
class crazyFly : public QGraphicsSvgItem
{
public:
explicit crazyFly(const CrazyflieData* p_crazyfly_msg, QGraphicsItem * parent = 0);
explicit crazyFly(const CrazyflieData* p_crazyfly_msg, QString filename, QGraphicsItem * parent = 0);
~crazyFly();
QRectF boundingRect() const;
......
......@@ -4,10 +4,9 @@
#include <QBrush>
crazyFly::crazyFly(const CrazyflieData* p_crazyfly_msg, QGraphicsItem * parent)
: QGraphicsSvgItem(":/images/drone_fixed.svg")
crazyFly::crazyFly(const CrazyflieData* p_crazyfly_msg, QString filename, QGraphicsItem * parent)
: QGraphicsSvgItem(filename)
{
updateCF(p_crazyfly_msg);
m_width = DRONE_WIDTH;
m_height = DRONE_HEIGHT;
......
......@@ -320,7 +320,25 @@ void MainGUIWindow::updateNewViconData(const ptrToMessage& p_msg) //connected to
}
else //name not found, newly arrived, add it to the vector
{
crazyFly* tmp_p_crazyfly = new crazyFly(&(p_msg->crazyflies[i]));
// now, if name follows our format, put the corresponding number. If not, put the unknown image
std::string s = p_msg->crazyflies[i].crazyflieName;
std::smatch m;
std::regex e ("PPS_CF([0-9]{2})");
QString filename(":/images/drone_fixed_");
if(std::regex_search(s, m, e))
{
std::string found_string = m[1].str();
filename.append(QString::fromStdString(found_string));
filename.append(".svg");
}
else
{
filename.append("unk.svg");
}
crazyFly* tmp_p_crazyfly = new crazyFly(&(p_msg->crazyflies[i]), filename);
crazyflies_vector.push_back(tmp_p_crazyfly);
}
......@@ -330,7 +348,7 @@ void MainGUIWindow::updateNewViconData(const ptrToMessage& p_msg) //connected to
{
if(crazyflies_vector[i]->isOccluded())
{
ROS_INFO("===================OCCLUDED");
// ROS_INFO("===================OCCLUDED");
if(crazyflies_vector[i]->isAddedToScene())
{
scene->removeItem(crazyflies_vector[i]);
......
5,PPS_CF08,0/56/2M,1,0.165581,-0.217325,-0.2,0.755462,0.548486,2
6,PPS_CF04,0/24/2M,2,-0.476044,-0.910694,-0.2,0.051744,-0.217325,2
4,PPS_CF02,0/8/2M,0,-0.486393,-0.217325,-0.2,0.068015,0.337808,2
3,PPS_CF03,0/16/2M,3,0.0931391,-1.12802,-0.2,0.765811,-0.351859,2
4,PPS_CF05,0/32/2M,0,-0.18599,-0.308665,-0.2,0.736046,0.451125,2
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment