6ef86eea05
This language is used broadly to specify how to attach (and thus also how to detach) devices to/from Salmanoff. The next bit of work we'll do is split off the DSL parsing from the management of the list of parsed binary attached spec objects. We'll be creating a PipeDeviceAttachmentParser, and later on when we support URDF, we'll create a URDFDeviceAttachmentParser.
38 lines
943 B
C++
38 lines
943 B
C++
#include <iostream>
|
|
#include <fstream>
|
|
#include <stdexcept>
|
|
#include <string>
|
|
#include <vector>
|
|
#include <sstream>
|
|
#include <memory>
|
|
#include <opts.h>
|
|
#include <deviceManager/deviceManager.h>
|
|
|
|
namespace smo {
|
|
namespace device {
|
|
|
|
std::vector<std::shared_ptr<InteroceptorDevAttachmentSpec>>
|
|
DeviceManager::interoceptorDeviceSpecs;
|
|
std::vector<std::shared_ptr<ExtrospectorDevAttachmentSpec>>
|
|
DeviceManager::extrospectorDeviceSpecs;
|
|
std::vector<std::shared_ptr<DeviceAttachmentSpec>>
|
|
DeviceManager::senseDeviceSpecs;
|
|
|
|
const std::string DeviceManager::stringifyDeviceSpecs(void)
|
|
{
|
|
std::ostringstream oss;
|
|
|
|
for (const auto& spec : DeviceManager::interoceptorDeviceSpecs) {
|
|
oss << "Interoceptor " << spec->stringify();
|
|
}
|
|
|
|
for (const auto& spec : DeviceManager::extrospectorDeviceSpecs) {
|
|
oss << "Extrospector " << spec->stringify();
|
|
}
|
|
|
|
return oss.str();
|
|
}
|
|
|
|
} // namespace device
|
|
} // namespace smo
|