| Support Topics |
|
|
Support Topics / UC-win/Road |
 |
UC-win/Road SDK (development kit)
FAQ: Frequently Asked Questions |
|
|
|
The UC-win/Road SDK is a software development kit that provides libraries and APIs for developing plugins that run on UC-win/Road. It is used by universities, automotive companies, and various users for research and development, as well as for customizing features. In this session, we will pick up frequently asked questions and functions for utilizing the SDK, and introduce them in a Q&A format based on inquiries received by our company.
|
When I developed and executed a plugin using the SDK, the following error occurred, and the system does not recognize the plugin. What is the reason for this?
 |
| ■ Figure 1: Error messages displayed during execution |
The error you are encountering occurs because the versions of the UC-win/Road software and the UC-win/Road SDK are different. The versions of both products must be exactly the same; even a slight difference will prevent them from working correctly. For example, if the UC-win/Road software is version 7.1.0 and the SDK is version 7.1.1, an error will occur. If you encounter this error, please check the versions of both products.
|
| Regarding Delphi versions |
Does the current UC-win/Road SDK only support Delphi 2010?
The UC-win/Road SDK is developed using Embarcadero's Delphi, but the required version of Delphi varies depending on the version. Specifically, Version 8 requires Delphi XE2, while versions 7 and earlier require Delphi 2010. If the version of Delphi is different, you will not be able to build or run the plugins, so please ensure you have the correct version as specified above. If you have Delphi XE2 or XE3, it may also be possible to use older versions of Delphi. For more details, please contact Embarcadero directly.
|
Is there a Japanese help file available for the UC-win/Road SDK?
When you install the UC-win/Road SDK, a help file named "UC-winRoad_SDK_x.xx.xx.chm" is saved in the installation folder; however, currently, only English help is available. We apologize, but Japanese help is not yet provided.
|
| How to use the log function |
Is it possible to save detailed information about the vehicle's behavior during driving simulations?
This is possible. The UC-win/Road SDK includes a logging output function called LogServer. By accessing the LogServer, you can obtain information not only about your own vehicle but also about all vehicles, including those generated by traffic flow or scenarios, as well as character data.
The following describes the approach for performing log output using LogServer (Figure 2). First, a function (callback function) created in the plugin is registered in advance with UC-win/Road. When the simulation is executed in this state, after calculations related to the environment, traffic flow, characters, and rendering of the 3-dimensional space, the callback function is called for all target models. Within the callback function, it is possible to access various data specific to each target model, as shown in Table 1, allowing these data to be outputted to files in CSV format or transmitted to other applications.
 |
| ■ Figure 2: The concept of LogServer |
| Examples of data accessible through LogServer |
| Basic data |
Simulation time, model name, model ID, and model type |
| Coordinates, orientation |
X coordinate, Y coordinate, Z coordinate, pitch angle, yaw angle, roll angle, vector |
| Power, speed |
Engine speed, gear number, vehicle speed (km/h, m/s), and speed limit |
| Input |
Handle angle, accelerator pedal opening, brake pressure, and whether or not it's in autonomous driving mode |
| Distance |
Distance traveled, distance from the starting point of the road, and distance from the edge of the road |
|
| ■ Table 1: Examples of data that can be referenced |
Please note that among the sample plugins included with the UC-win/Road SDK, the following utilize the LogServer functionality. Please refer to these as a reference for your development efforts.
- ControlVehicleInFrontPlugin
- InteractionSample
- LogExportPlugin
|
| How to control the steering wheel, accelerator, and brakes of your own car |
Can UC-win/Road vehicles be controlled using steering, accelerator, and brake detection values from external controllers?
This is possible. The SDK provides an interface called IF8MainDriver, which serves as a control for the vehicle during driving simulations. IF8MainDriver can obtain various information, such as the interface and lane number of the currently driven road. It also offers functionality to modify steering, acceleration, and brake values with arbitrary settings (see Table 2). Sample code is provided below for your reference. Please note that these controls are implemented either by registering a callback function of type TransientWorldMoveProc() using _plgTransientWorldMove, or by utilizing the standard Delphi timer function (TTimer).
| Vehicle control functions |
| SetSteering |
Specify the steering angle. A value of 0.0 indicates straight driving; -1.0 represents the maximum left turning angle, and 1.0 represents the maximum right turning angle |
| SetThrottle |
Specify the accelerator pedal opening within the range of 0.0 to 1.0, where 1.0 represents full throttle |
| SetBrake |
Specify the braking force within a range of 0.0 to 1.0, where 1.0 represents maximum braking force |
|
| ■Table 2: Vehicle control functions of IF8MainDriver |
var
appService : IF8ApplicationService;
driver : IF8MainDriver;
begin
Supports(ApplicationService, IF8ApplicationService, appSerice);
driver := appService.MainForm.driver;
if Assigned(driver) then
begin
driver.SetSteering(SteeringValue);
driver.SetThrottle(Accelvalue);
driver.SetBrake(Brakevalue);
end;
end; |
|
|
| How to draw strings on the main screen |
Is it possible to display arbitrary text on the main screen of UC-win/Road?
It is possible. The UC-win/Road SDK provides a function called PaintHUD, which allows for various drawing operations using OpenGL on the main screen display. Within this function, you can display text by calling the functions of the SDK's text rendering library. The code for this is shown below. For details on how to use PaintHUD, please refer to the SpeedMeterPlugin sample plugin included with the SDK.
procedure ????.PaintHUD;
var
sp : TPoint3D;
wp : TPoint3D;
cw : Integer;
ch : Integer;
begin
cw := winRoadApplication.mainForm.openGL.Width;
ch := winRoadApplication.mainForm.openGL.Height;
F8TextResetSettings;
F8TextSetFontName('MSP Gothic');
F8TextSetFontSize(40); // in pixels
F8TextSetFontColor( clRed );
F8Text2DModeBegin(cw, ch); // Specifies the screen size
F8TextSetAlignment(_alignCenter); // Sets the baseline position of the string
F8TextStartFrom(0.5 * cw, 5); // Specifies the starting position for text output
glDisable( GL_LIGHTING );
glEnable( GL_BLEND );
glBlendFunc( GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA );
glColor4d( 0.0, 0.5, 1.0, 0.5 );
glBegin( GL_QUADS );
glVertex3f( 0.0, 0.0, -1.0 );
glVertex3f( 0.0, 2 * 40 + 10, -1.0 );
glVertex3f( cw, 2 * 40 + 10, -1.0 );
glVertex3f( cw, 0.0, -1.0 );
glEnd;
F8TextOut('Message Test'); // Draw
F8Text2DModeEnd; // Terminates the mode
glEnable( GL_LIGHTING );
glDisable( GL_COLOR_MATERIAL );
end; |
|
|
In this support topic section, we have introduced frequently asked questions and various features for utilizing the SDK. We plan to continue providing information in various ways going forward.
Please note that due to space limitations, detailed explanations have been omitted. However, the sample code included with the product offers a wide range of features and will undoubtedly be helpful, so please make use of these samples. Additionally, the following books published by our company contain various examples for developing applications using the SDK, so we encourage you to utilize them.
 |
|
| (Featured in the Autumn issue of Up&Coming '12) |
 |
|







>> Product comprehensive catalog

>> Premium membership services
>> Financial support
| Recently released products |
|
|
|