Find the complete device's name and use it with MODA.
This section describes how to find the name (path) of a device. The path of a device is its relative name "mymotor" prefixed with the path of its parent entity.
(Exemple 1): For exemple, the path of a motor named "mymotor", attached on an axis named "axisred", owned by a joint named "myjoint" placed in the world, is : "/myjoint/axisred/mymotor".
(Exemple 2) If this joint is inside a PHX, and the PHX is imported in the world as "/Robot1", the motor path is "/Robot1/myjoint/axisred/mymotor".
A device query (using QueryDevicexxxxx) is always done from a PHX (startup point). The higher level PHX is the world and is named "/". Using MODA, we can find and use the device using several methods:
(1) : The joint is inside the world:
//Get the higher level PHX ModaCPP::RobotPHX *phx=connection->QueryRobotPHX("/"); //Query the device using relative name ModaCPP::DeviceMotor *mymotor=phx->QueryDeviceMotor("myjoint/axisred/mymotor");
(2) : If the joint is inside a PHX, imported as "/Robot1":
ModaCPP::RobotPHX *phx=connection->QueryRobotPHX("/Robot1"); ModaCPP::DeviceMotor *mymotor=phx->QueryDeviceMotor("myjoint/axisred/mymotor"); //Is the same than: ModaCPP::RobotPHX *phx=connection->QueryRobotPHX("/"); ModaCPP::DeviceMotor *mymotor=phx->QueryDeviceMotor("Robot1/myjoint/axisred/mymotor");
Devices Explorer tool can connect to a running simulation and enum devices. The devices names are relative to the PHX startup point. Also, Devices Explorer generates C++ or C# code that shows how to use devices using MODA.
|
|
Marilou-Exec displays in a debug console the entities, devices and PHX that are used for creating complete simulation. To activate the debug console, open the Options panel:
Menu Options->Settings->Options: check the "Allocate DOS console at Exec startup" checkbox. The console will be available at the next Exec startup. See the "MODA enums" text section.
Your easily create your robot's class using the Class Creator tool: the generated class contains all the devices names, relative from a startup point.
Documentation v4.7 (18/01/2015), Copyright (c) 2015 anyKode. All rights reserved.
|
What do you think about this topic? Send feedback!
|