Support Topics
Support Themes / UC-win/Road Information regarding after-sales support services
City Design Tools Vol.4 (Total of 7 issues) ImageToCity

 I am Kobayashi from Arizona State University. Here, I will introduce the City Design tools that are publicly available on FORUM8.

 FORUM8's VR software, UC-win/Road, enables seamless city data generation and conversion between itself and other 3D/CG software; we developed this toolkit with that purpose in mind. While the code for the tools described here has been made public, please note that because specific support is not currently provided, we disclaim all responsibility for any issues or bugs that may arise. We ask for your understanding in advance.
 In addition, individuals involved in architecture and civil engineering who are reviewing this issue's coverage, and who may have a need for simple tools compatible with your company's systems, are encouraged to contact us.

 Procedural city generation
In the previous installments, we introduced several tools: PovrayToMax, ImageToTerrain, and AnimatedCharacter. This is the fourth installment, where we will introduce the ImageToCity tool, which automatically generates three-dimensional city data. Like the previously introduced tools, this one was developed as a plugin for Autodesk's 3dsMax. This tool, which forms the basis of CityDesign, was researched and developed by Arizona State University in fiscal year 2009. By preparing the following four files, buildings, roads, trees, and other elements within a 500-meter square area are generated as 3D data with textures applied, and can be imported into FORUM8's UC-win/Road for urban visualization.

  1. Exhibition road network AI format files.
  2. AI files containing closed spline curves representing urban planning boundary lines.
  3. An image file recording topographic uplift, represented as grayscale pixels
  4. Image files showing forest areas, residential areas, and commercial areas, color-coded for differentiation

First, I will provide a brief introduction to the background of procedural city generation.
Research on the automatic generation of cities is not a new concept. The first thing that needs to be introduced is Shape Grammar.
This is a method for recording the relationships between spatial elements, developed by Professor George Stiny (currently at MIT) in the 1970s.
Professor Stiny, who served as a professor in the architecture department at UCLA (University of California, Los Angeles) during the 1980s and 1990s, has published numerous papers and research findings related to Shape Grammar. Those interested can read the books listed below.
The first volume was written by the late Professor William Michael and summarizes the theories and methods of using Shape Grammar in the field of architecture.
The second book is an English-language textbook explaining Shape Grammars through mathematical explanations.
  • "Architectural Form Language: On Design, Calculation, and Cognition," authored by William Mitchell and Takeshi Nagura
  • "Shape: Talking About Seeing and Doing" by George Stiny
I myself attended UCLA in the 1990s and was one of the students who took Professor Stiny's and his wife, Professor Terry Knight (who is now a professor at MIT), course on Color Grammar.
However, shape grammars are primarily used as analytical tools in the field of architecture, and their general application is not very common.
The situation changed in 2001 with the publication of a paper titled "Procedural Modeling of Cities" at Siggraph, the largest academic conference in the field of Computer Graphics.
According to a paper published by Yoav Parish and Pascal Muller of ETH (Swiss Federal Institute of Technology)*, shape grammars can be used to automatically generate high-quality three-dimensional urban data suitable for use in Hollywood productions through scripting (CGA).

Technologically, it can generate complex data with minimal input, which amazes and impresses people in terms of its applications.
Subsequently, Mr. Pascal Muller developed numerous automated generation tools and now runs a company called Procedural Inc., which sells software named CityEngine.
The tool was used for city generation in the recently released Hollywood movie "Cars2." Peter Wonka, a co-researcher who studied using CGA to automatically generate buildings (currently a professor at Arizona State University), is now my co-researcher.
(*)Yoav I. H. Parish, Pascal Muller , "Procedural modeling of cities", Proceedings of SIGGRAPH '01
By searching for "Procedural Modeling" within the SIGGRAPH conference paper collections, you can find a range of research results.

So, can anyone easily create city data like in Hollywood movies using these tools? The answer is no. "Automatically generating cities using generative tools" and "automatically extracting building information using generative tools" are completely different concepts. The tools developed by Mr. Pascal were indeed designed for the former purpose, while the latter remains a research topic.

In addition, regarding the creation of city and building data, similar to geometric data, it plays a very important role in the creation of material data.
Material settings require extensive experience in computer graphics art; they demand more time and effort compared to creating geometric data.
Mr. Pascal himself, possessing these technical skills, can use developed tools to better present the created data.
Generating rule descriptions is not a typical task. Arizona State University also hired several doctoral students to create data as part of their coursework, and one colleague, Peter, commented that it was "completely useless." Against this backdrop, this tool (ImageToCity) was developed with a purpose different from existing tools. Initially, this tool was developed for use as a learning material for scripting.
While it's possible to automatically generate city data, when customization is required, modifications must be made to the source code.
This tool itself serves as a textbook and aims to facilitate learning about "extracting generative rules from buildings."
In addition, to simplify material setup and other processes, it was developed as a plugin for 3ds Max.
If 3ds Max can be used, its knowledge can be applied during material settings. The ultimate goal is to divide the automated building generation process into smaller tasks.
Geometric data creators, material creators, and building code developers: if the entire workflow can be divided into 3 separate teams, the efficiency of data creation can be quantified. Due to the nature of the drawings, this explanation only covers automated generation methods. Please contact us for more detailed information and educational materials.
We have prepared textbooks consisting of over 200 pages, divided into 10 lectures.

■ Figure 1: The GUI of the Animated Character tool

 Automatically generated pipelines by ImageToCity
 The following train schedule is a diagrammatic representation of the ImageToCity pipeline.

The land area enclosed by the road network is first subdivided into smaller plots using 4 input files. Then, building geometry data is generated for specific buildings within each plot using a pre-existing tool that allows for easy creation of buildings (with features like height and window placement randomly distributed within defined ranges) (5).
At this point, material IDs are automatically assigned to each face (the smallest polygon that makes up the mesh) of the generated mesh object: for example, ID 1 represents grass, ID 2 represents asphalt, ID 3 represents wall 1, and ID 4 represents a frame.
Next, select one of the 24 pre-prepared building materials at random and assign it to each building (6).
A building's material is derived from a group of 10 material IDs. Based on this structure, other people can create materials before the building data is finalized. Then, to ensure that the data within a single building zone corresponds to a single grid data set, trees, sidewalks, and lawns are pasted and integrated (7).
Finally, using the texture baking feature in 3dsMax, 1 3DS file and its associated texture images are saved to a specific folder for each building site. When buildings like these are generated, for example, 10 of them, then 10 3DS files and 10 image files are created accordingly.
At the same time, location information for 10 data points was recorded to generate 1 raw dataset (8, 9).
When importing data using UCwin/Road, all building data associated with the original data can be automatically imported by specifying it during the import process.

   
■ Figure 3: The GUI for file output
■ Figure 2: The GUI for file import ■ Figure 4: Building data generated using 3ds Max.

 Solutions
 Next, I will explain how to use each tool step by step.

  1. First, prepare 4 files.

  2. Open 3dsMax and select "MAXScript RunScript" from the menu, then specify the "GUI.ms" file.
    The process is the same as with typical MaxScript execution; select "DesignCity" from the Utilities dropdown menu in the Utility tab to add the tool.

  3. The files prepared according to the GUI steps in Figure 2 should be specified one by one.
    ("GetRoadFile", "GetSiteFile", "GetZoningFile", "GetDEMFile" buttons)

  4. Using the GUI shown in Figure 3, select the options in order from 1 to 4.
    ("1: Register Component", "2: Generate Buildings", "3: Bake Texture", "4: Output File" buttons)

  5. The specifics vary depending on the data, and what remains is simply waiting for the data to be generated.
    Generate data as shown in Figure 4 (without generating road and terrain data).

The processing time for each building's zoning data is approximately 5 minutes.
For viewing 10 buildings, it is estimated to take approximately 50 minutes. Efforts are currently underway to improve this.
In addition, when using the generated data in UC-win/Road, it is necessary to regenerate the road network and land use.

 Concluding remarks
In this presentation, we will introduce ImageToCity, a tool for automatically generating three-dimensional city data, focusing on its capabilities using AI (Line data) files and image files (BMP).
The generated data can be directly imported into UC-win/Road by specifying the folder.
Next, we will introduce ImageToFacade, a tool that generates building models from a collection of image files.



Support Themes / UC-win/Road Information regarding maintenance and support services
UC-win/Road SDK Automatic steering control

With the release of UC-win/Road V5.2, modifications were made to the driving simulation plugin.
In the UC-win/Road driving simulator, using the active force steering option allows the active force steering axis to be controlled externally. Here, "control" refers to the open-loop input torque of the steering wheel control unit.
As the primary interface currently used to provide services from UC-win/Road to external programs, it controls the steering wheel angle (position), and also includes interfaces for inputting and outputting necessary information for vehicle automatic control research.
Research on vehicle automatic control, accident prevention systems, and driver interaction can be applied to experiments under various road conditions and traffic situations.

■ Direction of the UC-win/Road driving simulator

This feature primarily consists of 3 elements.
  1. The connection function of the UC-win/Road SDK, sample plugins for the SDK's connection function
  2. Through the connection function provided by the UPD network interface
  3. Settings for driving simulation plugins

 Regarding steering wheel control
 The system uses an electric motor to apply torque to the steering wheel while simultaneously controlling the amount of movement.
In the UC-win/Road system, torque commands are directly sent to the hardware at a frequency of 50Hz, and the current angle of the steering wheel is obtained.
Through repeated processing at a frequency of 50 Hz, the next torque value to be applied is calculated based on the obtained steering wheel angle and its rate of change.
Because the rotational axis of the steering wheel and the center of gravity of the steering wheel are separated, a torque occurs due to gravity when the steering wheel is tilted.
Consider controlling this torque.

Additionally, by considering the frictional force of the steering wheel, more accurate control can be achieved.


 SDK API
The "IF8DSPlugin" is used within the SDK's API and can be controlled using the functions listed below.

SetDirectTorqueControl
Function for enabling or disabling steering wheel control.
If it is invalid, control is impossible, and it operates under normal conditions.
When applicable, use the SetHardwareSteeringWheelAngle function to control the steering wheel angle.

SetHardwareSteeringWheelAngle

A function used for controlling steering wheel angle.
Here, this specifies the maximum torque used for rotation around the target angle.
When controlling the steering wheel, the maximum torque that can be set is 8 Nm; however, a very powerful action often uses a torque of 1.5 to 2 Nm.
The angle unit ranges from -360 to +360 degrees. Several functions are available, similar to those controlled by a steering wheel.
In addition, it's possible to replace not only the steering wheel controls but also the input values used in driving simulators.

GetBrakeHardwareValue  GetThrottleHardwareValue  GetWheelAngleHardwareValue
These 3 functions measure the operation amounts of the brake pedal, accelerator pedal, and steering wheel of the current hardware. These functions can be called at any time, and their values are actually updated when they are at a frequency of 50Hz.

OverrideAppliedBrake  OverrideAppliedSteering  OverrideAppliedThrottle
Within UC-win/Road, functions that cover the amount of operation used to calculate vehicle behavior in a VR space are implemented. After each call to these functions, subsequent hardware operations are ignored, and the "StopApplied***Override" function is called to terminate the coverage process.

StopAppliedBrakeOverride  StopAppliedSteeringOverride  StopAppliedThrottleOverride
This function stops the processing of input values that started at Override-Applied.

GetAppliedBrakeValue  GetAppliedSteeringValue  GetAppliedThrottleValue
The function is used to obtain the actual amount of operations performed within UC-win/Road and process those values internally.
When an input value is masked, the masked value is obtained. When masking is released, the value obtained from the hardware is used.

 Sample plugin
 The SDK includes a sample plugin that provides control of the driving simulator steering wheel. This sample is intended for use when sitting in the passenger seat.
UC-win/Road performs autonomous driving by calculating steering wheel rotation angles and applying a torque of 1.5 Nm to the steering wheel.
When switching to autonomous driving mode in UC-win/Road, perform the following operations.

  1. Boarding
  2. Disconnect the ignition key on the emulator
  3. In the UC-win/Road keyboard, pressing the Enter key moves the cursor to the passenger seat

To enable steering wheel control, select "Start Steering Wheel Control Demo..." from the "Tools" menu.
When stopping the control, select "Stop Steering Wheel Control Demo" from the "Tools" menu.


 Steering wheel control parameters
In the options screen of the DS plugin, you can set physical parameters for the steering wheel to improve the accuracy of torque control.
The parameters are accessible in the "UC-win/Road → Drive Simulator" tab of the driving simulator options screen within UC-win/Road.
The following parameters can be changed. The default values are based on the UC-win/Road driving simulator at FORUM8's Tokyo headquarters.

Delay
The time delay, in seconds, from when a new torque command is sent to when it is reflected in the steering wheel response. The expected range is 0.1 to 0.3 seconds.

Inertia movement
The moment of inertia of the wheel is used in calculating the angular acceleration based on the applied torque.
In cases where the value exceeds the allowable range, the wheel will deviate significantly from the intended rotation and angle. To correct this before it converges to the proper angle, forced values are applied both before and after the deviation.

Shift moment
When the wheel is not in its balanced (0.0 degree) position, the gravitational force acting on the wheel can be considered as a cause of the torque.
The center of gravity of the wheel is not located on the rotational axis of the wheel, and when the center of gravity is not perpendicular to the rotational axis, a torque will be generated.
To confirm this value, the "Angle control test" option on the settings screen allows you to check how the angle of the wheels during movement affects acceleration by applying a small torque at different angles.
Regardless of the wheel angle, "Shiftmovement" will become the correct value when a certain amount of acceleration is achieved.

Resistive movement
To maintain a specific angular velocity of the wheels, a necessary minimum torque value is set. This value is used for measuring friction on the wheels.


 Network UDP port control
This communication function allows for monitoring and controlling driving simulation operations through other applications.
The application requires a system with UDP server and client functionality to be installed on the PC running UC-win/Road, or on other PCs within the same network, as it needs to send and receive information with UC-win/Road.
The final train schedule is shown in the figure below.


In driving simulation plugins, the following functions can be remotely accessed via UDP protocol, just like through the SDK's API, allowing access to hardware.

  1. The purpose of this action is to control the steering wheel by specifying an angle and torque
  2. The actual steering wheel angle and pedal input values can be obtained from the hardware
  3. Acquire the steering wheel, throttle valve, and brake values applicable to the vehicle mechanics being studied
  4. To ensure that other values also apply to vehicle mechanics and cover values originating from hardware

The parameters for remote access can be specified in the [UC-win/Road → Drive Simulator] tab of the options screen.
  • The UDP server for UC-win/Road is active and waits for commands from any IP address. In the driving simulator plugin's settings screen, you can specify the UDP port for functions 1 and 4.
  • The UDP client refers to the IP address configured in the options screen of the driving simulator, and it continuously transmits data while performing actions related to functions 2 and 3.
  • The option screen allows you to enable or disable the functionality for both the client and server sides.
  • When starting UC-win/Road, you can set the "Activate communication by default" option to automatically enable communication.

Regarding the agreement
All commands are sent as ANSI strings.
The UDP server for UC-win/Road receives the following command information.

SetDirectTorque
Control=-1
Torque control effective
SetDirectTorque
Control=0
Torque control disabled
SetHardwareSteeringWheelAngle
=ANGLE,TORQUE
The wheel angle commands, ANGLE and TORQUE, are floating-point numerical values represented as strings.
ANGLE is the definition of a unit of measurement for angles
TORQUE is defined as a unit with the measurement of Nm
Example: SetHardwareSteeringWheelAngle=180,1.5
OverrideAppliedSteering
=STEERING
Vehicle dynamics parameters applicable to UC-win/Road steering wheel values
STEERING represents a dimensionless value between -1 and 1
Example: OverrideAppliedSteering = 0.5
StopAppliedSteeringOverride Override the steering wheel value to stop, and then return to normal operation.
OverrideAppliedThrottle
=THROTTLE
Throttle values applicable to vehicle dynamics simulations covered by UC-win/Road.
THROTTLE is a dimensionless value between 0 and 1
Example: OverrideAppliedThrottle = 0.5
StopAppliedThrottleOverride Resume normal operation by adjusting the stop oil valve settings to their appropriate values.
OverrideAppliedBrake
=BRAKE
Brake values applicable to vehicle dynamics simulations covered by UC-win/Road
BRAKE represents a dimensionless value between 0 and 1
Example: OverrideAppliedBrake = 0.5
StopAppliedBrake
Override
Stop brake value coverage and return to normal operation.

In addition, the UDP client of UC-win/Road transmits the following data to the specified IP address and port.

WheelAngleHardwareValue
=ANGLE
The actual angle value of the steering wheel
ANGLE represents a value in degrees within the range of -360 to 360
Example: WheelAngleHardwareValue = -100
AppliedSteeringValue
=STEERING
Applicable steering wheel values in vehicle dynamics
STEERING represents a dimensionless value between -1 and 1
Example: AppliedSteeringValue = -1
ThrottleHardwareValue
=THROTTLE
The actual input value of the accelerator pedal
THROTTLE is a dimensionless value between 0 and 1
Example: ThrottleHardwareValue=1
AppliedThrottleValue
=THROTTLE
Throttle values applicable in vehicle dynamics
THROTTLE is a dimensionless value between 0 and 1
Example: AppliedThrottleValue = 0
BrakeHardwareValue
=BRAKE
Actual brake pedal input values
BRAKE represents a dimensionless value between 0 and 1
Example: BrakeHardwareValue = 1
AppliedBrakeValue
=BRAKE
Applicable braking values in vehicle mechanics
BRAKE represents a dimensionless value between 0 and 1
Example: AppliedBrakeValue = 0

Up&Coming '11, autumn issue, published
Return
Up&Coming

FORUM8