Interaction between electronic devices and their users has become more advanced with the adoption of new display technologies and new ways of receiving input from the user. Touch screens enable the user to give input to the device by directly interacting with the user interface. Haptic technology even enables the user of an electronic device to feel the elements in the user interface. For example, the device may react to a push of a button with a short vibrating feedback, whereby the user feels that the device responds to touch. At the same time, the display of the user interface is more often a high-resolution screen enabling the display of complex and detailed information. This makes the implementation of the haptic feedback in the device more challenging.
Now there has been invented an improved method and technical equipment implementing the method, by which the above problem is alleviated. Various aspects of the invention include a method, an apparatus, a module and a computer readable medium comprising a computer program stored therein, which are characterized by what is stated in the independent claims. Various embodiments of the invention are disclosed in the dependent claims.
In the different aspects and embodiments, the spatial information on haptic elements on the user interface is used to create haptic feedback relating to the user interface elements. The spatial information resides in a memory in compressed and/or coded form e.g. in order to save memory and to improve operating speed. The spatial information is decoded or decompressed when needed, and in addition, a haptic cache is arranged where the spatial information likely to be needed soon is decompressed ahead of time. This predictive decompression is arranged to be done based on the movement of the user's input on the user interface. For example, the blocks that the user is likely to touch soon are decompressed to the haptic cache.
According to a first aspect, there is provided a method for providing haptic feedback, comprising automatically determining information on a position and a movement of user input, retrieving current haptic data based on the position information to a memory, automatically predicting a future position of the user input based on the information on a position and a movement, retrieving future haptic data related to the future position to the memory, and automatically producing haptic feedback based on the retrieved current and future haptic data.
According to an embodiment, the method further comprises compressing the haptic data to a memory, and decompressing the compressed haptic data based on the predicted future position for retrieving the future haptic data to memory. According to an embodiment, the method further comprises predicting the future position based on a current position, at least one past position, distance of the current position and the at least one past position and direction from the at least one past position to the current position. According to an embodiment, the method further comprises compressing the haptic data to a memory, wherein the compressing is carried out with at least one of the group of run-length encoding, scan-line encoding, block-based encoding, multi-pass encoding, low-pass filtering, downscaling and decimation. According to an embodiment, the method further comprises removing the haptic data from the memory in response to the haptic data not being used in the past or in response to the haptic data not predicted to be used in the future. According to an embodiment, the method further comprises generating the haptic data by using hardware adapted for graphics rendering. According to an embodiment, the method further comprises generating the haptic data in response to a change in the user interface, and updating the haptic data to the memory. According to an embodiment, the method further comprises determining texture information from the haptic data, wherein the texture information is at least one of the group of texture pixels, parameters for the use of actuators and program code for driving actuators. According to an embodiment, the method further comprises producing the haptic feedback by driving an actuator in response to the haptic data, wherein the haptic data is indicative of material properties such as softness, pattern and flexibility. According to an embodiment, the method further comprises producing the haptic feedback based on a distance calculation using the position information and haptic data, wherein the distance calculation is first carried out using blocks of haptic data, and subsequently using pixels of haptic data.
According to a second aspect, there is provided an apparatus comprising at least one processor, at least one memory, the memory including computer program code, the at least one memory and the computer program code configured to, with the at least one processor, cause the apparatus to determine information on a position and a movement of user input, retrieve current haptic data based on the position information to the memory, predict a future position of the user input based on the information on a position and a movement, retrieve future haptic data related to the future position to the memory, and produce haptic feedback based on the retrieved current and future haptic data.
According to an embodiment, the apparatus further comprises computer program code to compress the haptic data to a memory, and decompress the compressed haptic data based on the predicted future position for retrieving the future haptic data to memory. According to an embodiment, the apparatus further comprises computer program code to predict the future position based on a current position, at least one past position, distance of the current position and the at least one past position and direction from the at least one past position to the current position. According to an embodiment, the apparatus further comprises computer program code to compress the haptic data to a memory, wherein the compressing is carried out with at least one of the group of run-length encoding, scan-line encoding, block-based encoding, multi-pass encoding, low-pass filtering, downscaling and decimation. According to an embodiment, the apparatus further comprises computer program code to remove the haptic data from the memory in response to the haptic data not being used in the past or in response to the haptic data not predicted to be used in the future. According to an embodiment, the apparatus further comprises computer program code to generate the haptic data by using hardware adapted for graphics rendering. According to an embodiment, the apparatus further comprises computer program code to generate the haptic data in response to a change in the user interface, and update the haptic data to the memory. According to an embodiment, the apparatus further comprises computer program code to determine texture information from the haptic data, wherein the texture information is at least one of the group of texture pixels, parameters for the use of actuators and program code for driving actuators. According to an embodiment, the apparatus further comprises computer program code to produce the haptic feedback by driving an actuator in response to the haptic data, wherein the haptic data is indicative of material properties such as softness, pattern and flexibility. According to an embodiment, the apparatus further comprises computer program code to produce the haptic feedback based on a distance calculation using the position information and haptic data, wherein the distance calculation is first carried out using blocks of haptic data, and subsequently using pixels of haptic data.
According to an embodiment, the apparatus further comprises a main processor and system memory operatively connected to the main processor, a haptic processor and local memory operatively connected to the haptic processor, a data bus between the main processor and the haptic processor and/or the system memory and the local memory, and computer program code configured to, with the at least one processor, cause the apparatus to retrieve the haptic data and the future haptic data into the local memory. According to an embodiment, the apparatus further comprises computer program code to update the haptic data in response to a change in the user interface into the local memory, and decompress the future haptic data into the local memory.
According to a third aspect, there is provided a system comprising at least one processor, at least one memory, the memory including computer program code, the at least one memory and the computer program code configured to, with the at least one processor, cause the system to determine information on a position and a movement of user input, retrieve current haptic data based on the position information to the memory, predict a future position of the user input based on the information on a position and a movement, retrieve future haptic data related to the future position to the memory, and produce haptic feedback based on the retrieved current and future haptic data.
According to an embodiment the system further comprises a main processor and system memory operatively connected to the main processor, a haptic processor and local memory operatively connected to the haptic processor, a data connection between the main processor and the haptic processor and/or the system memory and the local memory, and computer program code configured to, with the at least one processor, cause the system to retrieve the haptic data and the future haptic data into the local memory.
According to a fourth aspect, there is provided a module such as a chip or standalone module comprising a processor, memory including computer program code, the memory and the computer program code configured to, with the processor, cause the module to form information on a position and a movement of user input, retrieve current haptic data based on the position information to the memory, form a future position of the user input, the future position being based on the information on a position and a movement, retrieve future haptic data related to the future position to the memory, and provide a signal for producing haptic feedback based on the retrieved current and future haptic data. According to an embodiment, the module may be such that it is arranged to operate as a part of the apparatus and/or the system, and the module may operate as one module of a plurality of similar modules.
According to a fifth aspect, there is provided a computer program product stored on a non-transitory computer readable medium and executable in a data processing device, the computer program product comprising a computer program code section for determining information on a position and a movement of user input, a computer program code section for retrieving current haptic data based on the position information to a memory, a computer program code section for predicting a future position of the user input based on the information on a position and a movement, a computer program code section for retrieving future haptic data related to the future position to the memory, and a computer program code section for producing haptic feedback based on the retrieved current and future haptic data.
According to a sixth aspect, there is provided an apparatus comprising a processor for processing data and computer program code, means for determining information on a position and a movement of user input, means for retrieving current haptic data based on the position information to a memory, means for predicting a future position of the user input based on the information on a position and a movement, means for retrieving future haptic data related to the future position to the memory, and means for producing haptic feedback based on the retrieved current and future haptic data.
In the following, various embodiments of the invention will be described in more detail with reference to the appended drawings, in which
a shows a block diagram of a haptic feedback system and modules according to an example embodiment;
b shows a block diagram of an apparatus for haptic feedback according to an example embodiment.
a and 3b illustrate the use of haptic feedback related to user interface elements according to an example embodiment;
a, 4b and 4c illustrate a compression and decompression method for spatial haptic information according to an example embodiment;
a, 5b and 5c illustrate a compression and decompression method for spatial haptic information with a collapsed scan-line reference table according to an example embodiment;
a, 6b and 6c illustrate a block-based compression and decompression method for spatial haptic information according to an example embodiment;
a, 7b, 7c and 7d show a method for calculating a distance for haptic feedback according to an example embodiment;
a and 8b show the operation of predictive decompression of spatial haptic information according to an example embodiment;
In the following, several embodiments of the invention will be described in the context of a portable electronic device. It is to be noted, however, that the invention is not limited to portable electronic devices. In fact, the different embodiments have applications widely in any environment where giving haptic feedback to the user is required. For example, control systems of vehicles like cars, planes and boats may benefit from the use of different embodiments described below. Furthermore, larger objects like intelligent buildings and various home appliances like televisions, kitchen appliances, washing machines and the like may have a user interface enhanced with haptic feedback according to the different embodiments. The various embodiments may also be realized as modules like chips and haptic feedback modules or as computer program products capable of steering haptic feedback when run on a processor.
The spatial prediction described above may be used to optimize speed and usage of memory. Using this method, less local memory may be used for the haptic data, and since the haptic data is already in the local memory, it may be retrieved faster. In some cases, the prediction may be turned off if it is determined that the prediction does not work well enough for a particular user interface layout. The predictive haptic data retrieval may work well for continuous movement such as panning, scrolling and scroll bars, and feeling a picture. Visually challenged persons may find the generation of the haptic feedback especially useful, since while they may not see the user interface, they may feel it.
The above solution may further comprise the following features. The haptic data (haptic surface identifiers (IDs)) may be rendered with the existing graphics hardware. If no graphics hardware is available the user interface may be represented with geometrical shapes like rectangles, circles, polygons etc. and these shapes may be converted to scan-line format. A haptic co-processor may be used. The haptic data may be compressed so that it fits inside a haptic co-processor's local memory. This step may comprise downscaling of the original haptic data and multiple compression rounds so that small enough compressed data is found. The haptic data in the local memory and the new haptic data may be compared, and only the modified compressed data may be transferred to the haptic co-processor's local memory (e.g. via an I2C bus or any other bus used to connect the haptic processor and the main processor). If the user interface remains static no data may be sent to the haptic co-processor. Haptic algorithm may read user touch input and checks whether the corresponding part of the screen has some haptic material associated to it. Feedback for the user may be provided based on the haptic data's material ID for the touched point using simple predefined haptic image patterns or predefined feedback parameters, or by executing a section of haptic feedback code associated with the ID. Depending on the haptic algorithm, distance to the closest user interface element may also be calculated for generating the feedback.
a shows a block diagram of a haptic feedback system and modules according to an example embodiment. In
To be fast enough for feedback to feel right, the haptic feedback loop may run at e.g. 1000 Hz or more and therefore special type of processors may be needed to keep the latency low from user input to haptic feedback (vibra, actuator). Programmable haptic co-processors may have limited processing power (e.g. 2 MHz) and a small memory footprint (e.g. 4-32 kB). Haptic co-processors may also not be able to access the system memory. The haptic feedback program code running inside the haptic co-processor needs information where user interface windows and elements are located and what their material properties are. User interface windows and elements may be any shape and form and it may not be sufficient to send mere window rectangle coordinates to the haptic co-processor. Here, it has been realized that the existing graphics hardware may be used to render haptic data as well as regular graphics. For example, the haptic data (haptic surface) may comprise 8-bit identifier values to represent different surface materials. The alpha color channel of the graphics processor may be used in case it is otherwise unused by the system. Furthermore, the stencil buffer of the graphics processor may be used. Yet further, a separate image for haptics, possibly with a lower resolution, may be rendered.
Raw presentation of haptic surface may not fit inside the haptic processor's memory of e.g. 4 kB, since the haptic data may take e.g. 307 kB (640*480*8 bits) of space. Also, there may not be enough bandwidth between the host central processing unit (CPU) and the haptic processor (25 fps VGA haptic surface needs 7.7 MB/s, and e.g. the I2C bus bandwidth has traditionally been 0.46 MB/s). These problems may be alleviated or over come with fast compression and decompression to transfer haptic surface to the haptic processor.
b shows a block diagram of an apparatus for haptic feedback according to an example embodiment. The apparatus may have various user interaction modules operatively connected, e.g. embedded in the device or connected wiredly or wirelessly to the apparatus. There may be a loudspeaker 210 and a microphone 212 for audio-based input/output e.g. for giving voice commands and hearing audio feedback. There may also be a display 211, e.g. a touch screen capable of receiving user touch input. The apparatus may also have a keyboard KEYB, and other input devices such as a camera, a mouse, a pen and so on. The apparatus or system of
a and 3b illustrate the use of haptic feedback related to user interface elements according to an example embodiment. As shown in
As shown in
Various compression methods may be used to compress the haptic data. Scan-line encoding with a reference table may be used. The reference table may be created to point to just a few of the scan-lines in the encoded data. Alternatively, a reference table may contain indexes to the beginnings of each scan line, naturally requiring more space. Further, the encoding of the scan-lines may be collapsed to save space. A block-based compression may also be used.
a, 4b and 4c illustrate a compression and decompression method for spatial haptic information according to an example embodiment. In
If the user interface changes, the haptic data may need to be recompressed. It may be done so that only the changed data is compressed and inserted at the correct location. However, the new data may be different in size compared to the old data. The data may be arranged in order so that a separate index table does not need to be maintained. In practice, two haptic data buffers may be used so that data can be sent to the other buffer while the other one is being used by the haptic processor. Therefore, updating may be done so that unchanged data is copied from the other buffer being used and only changed data is received from outside via the data bus. This may make the updating faster.
In decompressing, the haptic data value for a certain touch position (X,Y) may be used, and all data may not need to be decompressed. There may even not be enough memory for the whole uncompressed haptic data image in the haptic accelerator memory. In decompression, the closed starting offset from offset table is fetched based on the Y-position. After this we have 4 scan-lines of data and one of these scanlines is the wanted scan-line based on the Y-position. Decompressing of the scan-line data is done by browsing through the encoded scan-line data (color, length pairs) by adding the length data. The haptic data ID value in the X position is thereby found.
With reference to
a, 5b and 5c illustrate a compression and decompression method for spatial haptic information with a collapsed scan-line reference table according to an example embodiment. The collapsing may be done during compression or afterwards. Collapsing does not need to be complete, i.e. there may be multiple lines with the same content. Comparing
a, 6b and 6c illustrate a block-based compression and decompression method for spatial haptic information according to an example embodiment. In a block-based compression method, the image is divided into several blocks (in the example, 32×16 pixels->4 blocks each 16×8 pixels, blocks 620, 621, 622 and 623). Each block is compressed separately, and the compressed data comprises the compressed block data 610, 611, 612 and 613 one block after another. The compression happens in similar run-length manner as before, but the whole block is compressed in one scan wrapping around at the edge to the next line. The offset table in
It is appreciated that the haptic data compression algorithm (such as the previously described scan-line, block based, reference table algorithms) may be changed according to the user interface, the changes in the user interface, the used haptic feedback algorithm, the need for carrying out distance calculations and so on. For example, if the haptic feedback algorithm needs to determine distances, a block-based compression may be used, and otherwise a scan-line compression with a collapsed reference table may be used. Furthermore, the different compression algorithms may be run on the data and the most efficient algorithm may be chosen.
a, 7b, 7c and 7d show a method for calculating a distance for haptic feedback according to an example embodiment. Some haptics algorithms may utilize knowledge of the distance to the closest shape. For block based run-length compression the determination of the shortest distance is done as follows. First, the distance 711 to the closest block that is not empty is found. In
Alternatively, the start, end and middle points' distance may be computed and the shortest distance found by comparison. In
a and 8b show the operation of predictive decompression of spatial haptic information according to an example embodiment. Predictive decompression may utilize information on the movement of the point of touch by the user. The movement may have characteristics such as position, speed, direction, acceleration (or deceleration) and curvature. All or some of the characteristics may be measured and/or computed to predict where the point of touch will be in the future. For example, a touch point moving fast may result in a prediction that the next touch point is relatively far away from the current point. A curving movement may result in a prediction that the future point is off to one side of the current line of movement. Multiple future points may be predicted, and/or a span of the future points may be determined. The predicted future points and/or the determined span may then be used to determine the blocks or scan-lines that are fetched from memory to a local cache memory and/or decoded.
To speed up processing, some areas of the compressed haptic data can be in uncompressed form in the haptic processor's local memory. This may be advantageous e.g. in the case that the haptic feedback algorithm requires a high number of points to be retrieved per haptic cycle. In such a situation, not needing to find or decompress the data on the fly may speed up the operations and improve the functioning of the haptic feedback. For example, the decompressed areas in the local memory may be several 8×8 blocks of the ID surface depending on how much memory is available. Quick data fetches may thus be facilitated if the user interface remains relatively static and the user interface elements include little animation or movement. Blocks in the areas where the user interface is not static may be removed from the cache or uncompressed with new data. Based on the touch X,Y positions it may be predicted what parts of compressed surface need to be uncompressed and what uncompressed data can be removed from memory.
In
In
The predicted points NP and NA may be calculated as follows using the points C, P and A. The speed of the movement determines the size of the look-ahead triangle defined by the points C, NP and NA. In practice, the distances from C to NA and from C to NP may be set to equal the distance from the current point C 810 to the “previous” point P. The angle from C to the points NA and NP may be set to be equal but on the opposite side compared to the angle from C to the points A and P. In other words, the mirror image of point P with respect to point C defines point NP. Point NA is then projected from point A with respect to point C to be on the extension of line A-C and to be at the same distance from C than point NP is from point C. This makes the prediction to be based on the current position, the speed and direction of the movement and the curvature of the movement.
The haptic data block cache may contain an index table to the blocks so that blocks can be found quickly from the memory and then the decompressed block data can be used directly. The index table may be created because the blocks may not be in order in the cache.
Below, pseudo code for an example embodiment of the block cache is provided. First, the current touch location is determined. Then the “previous point”, that is, a trace point in the past is computed as a weighted average of the current point (5%) and the earlier previous point (95%). In other words, the previous point comes closer to the current point as the current point stays in the same place, but the change is not abrupt. The previous point is not allowed to be too far, and if it is, the cache is reset—it is interpreted that a jump took place. Next, the current point is added to the point cache. Then, the mean (average) coordinate point from the point cache is calculated. Next, the look-ahead angle is calculated using the dot product of two vectors formed from the previous and current points. This angle also demonstrates a smooth behavior over time, that is, it is updated slowly. Next, two look-ahead points at the edges of the angle are determined: first, point NP is obtained by mirroring with respect to point C, and then point NA is defined to be at the same distance from C and in the computed look-ahead angle from line C-NA. The blocks in the rectangle defined by the three points (two look-ahead points and the current point) are then decompressed.
The various embodiments described above may have advantages. For example, low latency haptic feedback may be generated by using an external co-processor. The embodiments may work with all kinds of user interface content. The haptic data generation may be fast due to hardware acceleration. The approach may also work with geometrical shapes if hardware acceleration is not available. Memory efficiency may be improved due to good compression ratios for large haptic ID surfaces. Downscaling may speed up compression, and due to the used algorithms, decompression and data search may be fast. The whole haptic data image does not need to be decompressed. Using the scan-line offset table it may be fast to find the correct scan-line and data needed. Block based compression may be optimal if distance calculation is needed by the haptic algorithm. Support of different haptic texture patterns may give the material a specific feeling to the touch.
The various embodiments of the invention may be implemented with the help of computer program code that resides in a memory and causes the relevant apparatuses, modules or systems to carry out the invention. For example, a terminal device may comprise circuitry and electronics for handling, receiving and transmitting data, computer program code in a memory, and a processor that, when running the computer program code, causes the terminal device to carry out the features of an embodiment. Yet further, a chip or a module device may comprise circuitry and electronics for handling, receiving and transmitting data, computer program code e.g. as microcode or low-level code in a memory, and a processor that, when running the computer program code, causes the chip or the module to carry out the features of an embodiment.
It is obvious that the present invention is not limited solely to the above-presented embodiments, but it can be modified within the scope of the appended claims.
Filing Document | Filing Date | Country | Kind | 371c Date |
---|---|---|---|---|
PCT/FI2010/050552 | 6/28/2010 | WO | 00 | 5/14/2013 |