最終更新:ID:0HPzSZwi0g 2017年03月24日(金) 17:48:08履歴
概要> | API>? | Advanced>?
The DCM is a software module, part of NAOqi, in charge of the communication with almost every electronic device in robots (boards, sensors, actuators ...), excepting sound (in or out) and cameras.
It manages the main communication buses between the head and the body, and also the communication inside the head. The DCM is thus the link between the “upper level” software (others naoqi modules) and the “lower level” software (soft in electronic boards). Modules like ALMotion and ALLeds directly send commands to Actuators using the DCM, while extractors and other modules use sensor results returned by the DCM in ALMemory.
The DCM is the NAOqi module part of another software named HAL – i.e. Hardware Abstraction Layer.
As the DCM runs some software security, its use is mandatory to access the robot hardware.
The DCM runs in constant-time cycle, typically between 1 and 10 ms, depending the robot.
The DCM has two main purposes:
Send commands to Actuators,
Update Actuator and Sensor values.
For further details, see: nao Actuator & Sensor list or pepp Actuator & Sensor list.
- The DCM API allows sending commands to Actuators. You can update, with one call, one or more Actuator(s). Commands include a time information of when the Actuator needs to receive the value.
- To get Actuator and Sensors values, you need to read them in the ALMemory. The DCM updates them as far as they change.
A | A NAOqi module or your code sends a request, listing timed commands to apply to one or more Actuator(s). For further details, see: Building and sending requests. |
B | Timed commands are stored in a buffer. At each cycle, DCM engine analyzes, for each Actuator, the previous and the next order (if there are some) based on the current time and computes the appropriate command to send using a linear interpolation. For further details, see: Learning more about timed commands treatment. |
C | Computed value is sent to the Electronic devices. The Actuator value is also updated in ALMemory with the sent command. |
D | DCM reads the updated Sensor values and updates them in ALMemory. |
In many cases, they may be slightly different: command out of possible range, obstacle...
The DCM has no priority or blocking system to avoid concurrency access on Actuator. It will apply all order, and if there is conflict, the last one will be applied.
NAOqi modules, like ALMotion or ALLeds send new order continuously, and may prevent you to access Actuators. So you need either to deactivate these modules, or to look in their API how to prevent them to access the Actuator you need.
Use ... | To update ... |
DCMProxy::set | one Actuator or a list of Actuators (through an Alias) with one unique list of timed commands. Examples -Make one LED or a group of LEDs blinks twice. -Set the Stiffness of all joints, or of the head joints. |
DCMProxy::setAlias | a list of Actuators (through an Alias) with a specific list of timed command for each Actuator. Example Make a group of LEDs blink twice while others fade out slowly and the left arm moves as if to say goodbye. Benefit You could obtain the same result by sending several DCMProxy::set, nevertheless DCMProxy::setAlias saves communication time by grouping commands in one request. |
[‘order’, ‘time’]
Where:
- ‘order’ is one float number, it is the value to be sent to the Actuator.
The meaning of the value may be, according to the Actuator nature, a joint position to reach in rad, a LED intensity value in 0-1.0 range, etc. - ‘time’ is a 4 bytes integer, it is an absolute value based on the system time in milliseconds.
You can send a request to the DCM to get the current time, or read it directly if you have a module on the robot motherboard.
For further details, see: Learning more about timed commands treatment.
コメントをかく