It included subscription support for pedestrians. It seemed to
have worked, yet was to complex to get merged into Veins. But you
may be able to gain some ideas or salvage some code.
On 22.04.22 10:05, Jakob Erdmann wrote:
You'll have to patch TraCICommandInterface to add this
method. The code is easily adaptable from other entities that
provide a position (i.e. Poi)
On the implementation side, it should look like this:
I found a quick hack to get coordinates of all
pedestrians in personFlow.
In the source code of SUMO, edit the file:
GUIEdge.cpp. More specifically, find the
statement:
person->drawGL(s);
and then write a new line:
std::cout<<person->getPosition()<<std::endl;
It works, the position will be printed as
sumo-gui runs alone.
However, a new problem arises: My project needs
positions to be available while the simulation is
running. But the data of position is not printed
as choosing "Run as Omnet++ simulation". The
simulation should end and a user should close the
Qtenv, the data would be available in the
terminal. I tried other ways (such as writing a
file) but it doesn't change: data only is printed
after a user closes Qtenv.
--
Dominik S. Buse M.Sc.
PhD Candidate at Data Communications and Networking Group (TKN), TU Berlin, Germany
Researcher at Software Innovation Campus Paderborn, Paderborn University, Germany
http://www.tkn.tu-berlin.de/team/buse/
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#include "VeinsInetPerson.h"
using namespace veins;
//namespace veins {
Register_Class(VeinsInetPerson);
VeinsInetPerson::VeinsInetPerson() {
// TODO Auto-generated constructor stub
}
VeinsInetPerson::~VeinsInetPerson() {
// TODO Auto-generated destructor stub
}
//} // namespace veins
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
#ifndef VEINS_INET_VEINSINETPERSON_H_
#define VEINS_INET_VEINSINETPERSON_H_
#pragma once
#include "veins_inet/veins_inet.h"
#include "veins_inet/VeinsInetApplicationBase.h"
using namespace omnetpp;
namespace veins {
class VeinsInetPerson {
protected:
bool haveForwarded = false;
public:
VeinsInetPerson();
~VeinsInetPerson();
};
}
#endif /* VEINS_INET_VEINSINETPERSON_H_ */