JP5630969B2 - Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method - Google Patents

Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method Download PDF

Info

Publication number
JP5630969B2
JP5630969B2 JP2009115156A JP2009115156A JP5630969B2 JP 5630969 B2 JP5630969 B2 JP 5630969B2 JP 2009115156 A JP2009115156 A JP 2009115156A JP 2009115156 A JP2009115156 A JP 2009115156A JP 5630969 B2 JP5630969 B2 JP 5630969B2
Authority
JP
Japan
Prior art keywords
vector
acceleration
data
angular velocity
correction
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
JP2009115156A
Other languages
Japanese (ja)
Other versions
JP2010263930A (en
Inventor
鈴木 一郎
一郎 鈴木
敬三 太田
敬三 太田
賢太 佐藤
賢太 佐藤
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Nintendo Co Ltd
Original Assignee
Nintendo Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nintendo Co Ltd filed Critical Nintendo Co Ltd
Priority to JP2009115156A priority Critical patent/JP5630969B2/en
Priority to EP09163725.6A priority patent/EP2140917B1/en
Priority to US12/493,434 priority patent/US8219347B2/en
Publication of JP2010263930A publication Critical patent/JP2010263930A/en
Application granted granted Critical
Publication of JP5630969B2 publication Critical patent/JP5630969B2/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Gyroscopes (AREA)

Description

本発明は、姿勢算出装置または姿勢算出プログラムに関し、より特定的には、入力装置の姿勢(重力方向)を算出する姿勢算出装置姿勢算出プログラム、姿勢算出システム、および、姿勢算出方法に関する。 The present invention relates to a posture calculation device or a posture calculation program, and more specifically, relates to a posture calculation device , a posture calculation program , a posture calculation system, and a posture calculation method for calculating a posture (gravity direction) of an input device.

従来、加速度センサおよびジャイロセンサを用いて入力装置の姿勢を算出する技術が考えられている。例えば、特許文献1には、加速度センサおよびジャイロセンサを備えた入力制御装置を使用するゲーム装置が記載されている。このゲーム装置は、ゲームキャラクタが持つ刀を入力制御装置の動きに応じて制御するものである。具体的には、加速度センサの出力に基づいて刀を振る動作のデータが作成され、ジャイロセンサの出力に基づいて刀の姿勢のデータが作成される。   Conventionally, techniques for calculating the attitude of an input device using an acceleration sensor and a gyro sensor have been considered. For example, Patent Document 1 describes a game device that uses an input control device including an acceleration sensor and a gyro sensor. This game device controls a sword possessed by a game character in accordance with the movement of an input control device. Specifically, data on the motion of swinging the sword is created based on the output of the acceleration sensor, and data on the posture of the sword is created based on the output of the gyro sensor.

特開2000−308756号公報JP 2000-308756 A

上記特許文献1のようにジャイロセンサを用いて姿勢を算出する場合、算出される姿勢と入力制御装置の実際の姿勢との間に誤差が生じる。入力制御装置の動きが遅い場合に入力制御装置の角速度がジャイロセンサによって検知されなかったり、逆に、入力制御装置の動きが激しい場合に入力制御装置の角速度がジャイロセンサの検知可能な範囲を超えてしまったりすること等が生じる場合があるからである。また、角速度データの出力の間隔よりも短い期間中に角速度が急激に変化するような場合にも、誤差が発生する可能性がある。また、ジャイロセンサは温度等の要因によりセンサの出力にドリフトと呼ばれる誤差が発生することもある。そして、角速度から算出される姿勢には、時間とともに角速度の誤差が蓄積されていくことになるので姿勢の誤差が大きくなっていくことになる。特許文献1では、ジャイロセンサから算出される姿勢の誤差を想定していないために、姿勢を正確に算出することができないおそれがある。   When the attitude is calculated using a gyro sensor as in Patent Document 1, an error occurs between the calculated attitude and the actual attitude of the input control device. When the input control device moves slowly, the input controller's angular velocity is not detected by the gyro sensor. Conversely, when the input controller moves excessively, the input controller's angular velocity exceeds the detectable range of the gyro sensor. This is because there is a case where it may occur. An error may also occur when the angular velocity changes suddenly during a period shorter than the output interval of the angular velocity data. Also, an error called drift may occur in the output of the gyro sensor due to factors such as temperature. Then, since the angular velocity error is accumulated with time in the posture calculated from the angular velocity, the posture error becomes large. In Patent Document 1, since the posture error calculated from the gyro sensor is not assumed, the posture may not be accurately calculated.

それ故、本発明の目的は、ジャイロセンサ等の角速度センサを用いて入力装置の姿勢を正確に算出することができる姿勢算出装置姿勢算出プログラム、姿勢算出システム、および、姿勢算出方法を提供することである。 Therefore, an object of the present invention is to provide an attitude calculation device , an attitude calculation program , an attitude calculation system, and an attitude calculation method that can accurately calculate the attitude of an input device using an angular velocity sensor such as a gyro sensor. That is.

本発明は、上記の課題を解決するために、以下の構成を採用した。なお、本欄における括弧内の参照符号および補足説明等は、本発明の理解を助けるために後述する実施形態との対応関係を示したものであって、本発明を何ら限定するものではない。   The present invention employs the following configuration in order to solve the above problems. Note that the reference numerals in parentheses and supplementary explanations in this section show the correspondence with the embodiments described later in order to help understanding of the present invention, and do not limit the present invention.

本発明は、角速度センサ(ジャイロセンサ55および56)と加速度センサ(37)とを少なくとも備えた入力装置(8)から角速度データ(63)と加速度データ(64)とを逐次取得し、当該入力装置から見た重力方向を表す重力ベクトル(Vg)を逐次算出する姿勢算出装置(ゲーム装置3)である。姿勢算出装置は、重力ベクトル算出手段(ステップS11を実行するCPU10。以下、単にステップ番号のみを記載する。)と、第1補正手段(S12)と、第2補正手段(S13)と、第3補正手段(S14)とを備えている。重力ベクトル算出手段は、角速度データが示す角速度に基づいて重力ベクトルを算出する。第1補正手段は、加速度データが示す加速度ベクトルの方向へ第1の度合(第1補正度A)で近づくように重力ベクトルを補正する。第2補正手段は、入力装置が所定の回転運動を行う場合において、加速度データに基づいて得られる運動加速度ベクトルと角速度データに基づいて得られる角速度ベクトルが垂直になる関係(式(7)または(15))から推定される重力方向へ第2の度合(第2補正度B)で近づくように重力ベクトルを補正する。第3補正手段は、所定期間における加速度ベクトルの平均の方向へ第3の度合(第3補正度C3)で近づくように重力ベクトルを補正する。 The present invention sequentially acquires angular velocity data (63) and acceleration data (64) from an input device (8) having at least an angular velocity sensor (gyro sensors 55 and 56) and an acceleration sensor (37). This is a posture calculation device (game device 3) that sequentially calculates a gravity vector (Vg) that represents the direction of gravity as viewed from above. The posture calculation apparatus includes a gravity vector calculation means (CPU 10 that executes step S11; hereinafter, only the step number is described), a first correction means (S12), a second correction means (S13), and a third Correction means (S14). The gravity vector calculation means calculates the gravity vector based on the angular velocity indicated by the angular velocity data. The first correction unit corrects the gravity vector so as to approach the direction of the acceleration vector indicated by the acceleration data at a first degree (first correction degree A). Second correction means, In no event the input device performs a predetermined rotary motion, the angular velocity vector obtained based on the motion acceleration vector and the angular velocity data obtained based on the acceleration data are perpendicular relationship (Equation (7 ) Or (15)), the gravity vector is corrected so as to approach the gravity direction estimated from the second degree (second correction degree B). The third correction means corrects the gravity vector so as to approach the average direction of the acceleration vector in a predetermined period at a third degree (third correction degree C3).

本発明によれば、姿勢算出装置は、角速度データに基づいて算出される重力ベクトルを、異なる3種類の方法で補正する。これによって、重力ベクトルを正確に算出することができ、その結果、入力装置の姿勢をより正確に算出することができる。   According to the present invention, the posture calculation device corrects the gravity vector calculated based on the angular velocity data by three different methods. As a result, the gravity vector can be calculated accurately, and as a result, the attitude of the input device can be calculated more accurately.

また、第1補正手段は、加速度データが示す加速度の大きさが重力加速度の大きさに近いほど高くなるように第1の度合を設定してもよい(S22)。   Further, the first correction means may set the first degree so that the magnitude of the acceleration indicated by the acceleration data becomes higher as the magnitude of the gravitational acceleration is closer (S22).

上記の構成によれば、加速度の大きさと重力加速度の大きさとの差分に応じて第1の度合が設定される。上記差分を参照することによって、入力装置が動いている度合を推測することができ、加速度データにより示される加速度の信頼度(加速度が重力方向を表すものとして信頼できるか否かを表す度合)を判断することができる。したがって、上記差分に応じて第1の度合を算出することによって、第1の度合を適切に設定することができ、ひいては、入力装置の姿勢を正確に算出することができる。   According to the above configuration, the first degree is set according to the difference between the magnitude of acceleration and the magnitude of gravitational acceleration. By referring to the above difference, the degree of movement of the input device can be estimated, and the reliability of the acceleration indicated by the acceleration data (the degree indicating whether the acceleration is reliable as representing the direction of gravity) is determined. Judgment can be made. Therefore, by calculating the first degree according to the difference, the first degree can be set appropriately, and thus the attitude of the input device can be accurately calculated.

また、姿勢算出装置は、入力装置の運動による加速度を表す運動加速度ベクトルを加速度データと重力ベクトルとに基づいて算出する運動加速度算出手段(S24)をさらに備えていてもよい。このとき、第2補正手段は、角速度データが示す角速度と運動加速度ベクトルとが上記関係を満たす状態に対応する重力ベクトルへ第2の度合で近づくように重力ベクトルを補正する。   In addition, the posture calculation device may further include a motion acceleration calculation unit (S24) that calculates a motion acceleration vector representing acceleration due to the motion of the input device based on the acceleration data and the gravity vector. At this time, the second correction means corrects the gravity vector so that the angular velocity indicated by the angular velocity data and the motion acceleration vector approach the gravity vector corresponding to the state satisfying the above relationship in the second degree.

上記の構成によれば、姿勢算出装置は、入力装置が所定の運動を行う場合における角速度と運動加速度との関係を用いて、運動加速度ベクトルが当該関係を満たすように、運動加速度ベクトルの算出元である重力ベクトルを補正する。これによって、入力装置が動かされている場合であっても、加速度データと角速度データとを用いて、重力ベクトルを正しく補正することができる。その結果、入力装置の姿勢を正確に算出することができる。   According to the above configuration, the posture calculation device uses the relationship between the angular velocity and the motion acceleration when the input device performs a predetermined motion, so that the motion acceleration vector is calculated so that the motion acceleration vector satisfies the relationship. To correct the gravity vector. Thereby, even when the input device is moved, the gravity vector can be corrected correctly using the acceleration data and the angular velocity data. As a result, the attitude of the input device can be accurately calculated.

また、第3補正手段は、第1の度合の最大値(0.03)および第2の度合の最大値(0.03)よりも低い値に第3の度合(0.001)を設定してもよい。   In addition, the third correction means sets the third degree (0.001) to a value lower than the maximum value (0.03) of the first degree and the maximum value (0.03) of the second degree. May be.

上記の構成によれば、第1補正手段および第2補正手段による補正に比べて、第3補正手段による補正の度合は小さく設定される。第3補正手段による補正は、入力装置の運動状態に依らずに行うことができる補正である一方、平均を算出する期間において発生する加速度センサの検出誤差等が原因で当該期間内における運動加速度が正確に相殺されず、補正が正確でない場合がある。これに対して、上記の構成では、第1および第2の度合よりも第3の度合を小さく設定することによって、第1補正手段および第2補正手段による補正に対して第3補正手段による補正を補助的に用いる。これによって、姿勢算出装置は、第3補正手段による補正が不正確である場合に、当該補正が入力装置の姿勢に大きく反映されることを防止することができ、結果として入力装置の姿勢を正確に算出することができる。   According to the above configuration, the degree of correction by the third correction unit is set smaller than that by the first correction unit and the second correction unit. The correction by the third correction means is correction that can be performed without depending on the motion state of the input device. On the other hand, the motion acceleration in the period is caused by a detection error of the acceleration sensor that occurs in the period for calculating the average. There is a case that the correction is not accurate and the correction is not accurate. On the other hand, in the above configuration, by setting the third degree smaller than the first and second degrees, the correction by the third correction unit is corrected with respect to the correction by the first correction unit and the second correction unit. Is used as an auxiliary. Thus, when the correction by the third correction unit is inaccurate, the posture calculation device can prevent the correction from being largely reflected in the posture of the input device. As a result, the posture of the input device can be accurately determined. Can be calculated.

また、第1補正手段は、加速度データおよび角速度データの少なくとも1つに応じて第1の度合を変化させ(S22,S23,S25)、第2補正手段は、加速度データおよび角速度データの少なくとも1つに応じて第2の度合を変化させてもよい(S32,S33)。このとき、第3補正手段は、第3の度合を固定値として設定する(S57)。   The first correction means changes the first degree according to at least one of the acceleration data and the angular velocity data (S22, S23, S25), and the second correction means has at least one of the acceleration data and the angular velocity data. The second degree may be changed according to (S32, S33). At this time, the third correction means sets the third degree as a fixed value (S57).

上記の構成によれば、第1補正手段および第2補正手段による補正は、加速度データおよび/または角速度データに応じて、すなわち、入力装置の運動状態(例えば、静止しているのか、動いているのか等)に応じて補正の度合が変化される。ここで、第1補正手段および第2補正手段による補正に関しては、入力装置の運動状態(例えば、静止しているのか、動いているのか等)に応じて補正の正確さが変化する。したがって、姿勢算出装置は、入力装置の運動状態に応じて補正の度合を変化することによって、補正を適切に行うことができる。ただし、入力装置の運動状態によっては第1および第2の度合がともに小さく設定され、その結果、第1補正手段および第2補正手段による補正がほとんど行われないおそれがある。これに対して、第3補正手段による補正は、入力装置の運動状態によって補正の正確さが変化するものではない。そのため、第3の度合を固定値とすることによって、姿勢算出装置は、第3補正手段による補正を常に行うようにすることができる。つまり、姿勢算出装置は、第1補正手段および第2補正手段による補正が行われない場合であっても、第3補正手段によって重力ベクトルを確実に補正することができる。   According to the above configuration, the correction by the first correction unit and the second correction unit is performed according to the acceleration data and / or angular velocity data, that is, the motion state of the input device (for example, whether it is stationary or moving). The degree of correction is changed according to whether or not. Here, regarding the correction by the first correction unit and the second correction unit, the accuracy of the correction varies depending on the movement state of the input device (for example, whether it is stationary or moving). Therefore, the posture calculation device can appropriately perform the correction by changing the correction degree according to the motion state of the input device. However, depending on the motion state of the input device, both the first and second degrees are set to be small, and as a result, there is a possibility that the correction by the first correction unit and the second correction unit is hardly performed. On the other hand, the correction by the third correction means does not change the correction accuracy depending on the motion state of the input device. Therefore, by setting the third degree as a fixed value, the posture calculation apparatus can always perform correction by the third correction unit. That is, the posture calculation apparatus can reliably correct the gravity vector by the third correction unit even when the correction by the first correction unit and the second correction unit is not performed.

また、姿勢算出装置は、加速度データ記憶手段(メインメモリ)と、ブロック平均算出手段(S52)をさらに備えていてもよい。加速度データ記憶手段は、取得された加速度データを逐次記憶する。ブロック平均算出手段は、複数の加速度データを1つのブロックとして、ブロックに含まれる各加速度データが示す加速度ベクトルの平均となるブロック平均ベクトルを算出する。このとき、第3補正手段は、新しいものから順に所定数のブロックのブロック平均ベクトルの平均となる全平均ベクトルの方向へ前記第3の度合で近づくように前記重力ベクトルを補正する(S57)。   In addition, the posture calculation apparatus may further include acceleration data storage means (main memory) and block average calculation means (S52). The acceleration data storage means sequentially stores the acquired acceleration data. The block average calculating means calculates a block average vector that is an average of acceleration vectors indicated by the acceleration data included in the block, with a plurality of acceleration data as one block. At this time, the third correction means corrects the gravity vector so as to approach the third average in the direction of the total average vector that is the average of the block average vectors of a predetermined number of blocks in order from the newest one (S57).

上記の構成によれば、姿勢算出装置は、所定数の加速度データを1つのブロックとしてまとめて、ブロック平均ベクトルを算出する。そして、所定期間における加速度ベクトルの平均として、ブロック平均ベクトルの平均を用いる。これによれば、姿勢算出装置は、所定期間内の全ての加速度データを記憶しておく必要がなく、所定数の加速度データと各ブロック平均ベクトルを示すデータとを記憶しておけばよい。したがって、上記の構成によれば、第3補正手段による補正処理に必要なメモリ量を低減することができる。   According to the above configuration, the posture calculation apparatus calculates a block average vector by collecting a predetermined number of acceleration data as one block. And the average of a block average vector is used as an average of the acceleration vector in a predetermined period. According to this, it is not necessary for the posture calculation device to store all acceleration data within a predetermined period, and it is sufficient to store a predetermined number of acceleration data and data indicating each block average vector. Therefore, according to the above configuration, it is possible to reduce the amount of memory necessary for the correction process by the third correction unit.

また、姿勢算出装置は、ブロック平均ベクトルそれぞれに対して、角速度データが示す角速度と逆方向の回転を加える補正を行うベクトル補正手段(S55)をさらに備えていてもよい。このとき、第3補正手段は、ベクトル補正手段による補正後のブロック平均ベクトルを用いて全平均ベクトルを算出する。   In addition, the posture calculation apparatus may further include a vector correction unit (S55) that performs correction by adding rotation in the direction opposite to the angular velocity indicated by the angular velocity data for each block average vector. At this time, the third correction unit calculates the total average vector using the block average vector corrected by the vector correction unit.

上記の構成によれば、ブロック平均ベクトルは、角速度データが示す角速度に応じて補正が行われる。この補正は、入力装置を基準として表されるブロック平均ベクトル(加速度ベクトル)を、空間に対して固定とする(すなわち、空間における方向が変化しないようにする)ための処理である。ここで、上記の構成によれば、姿勢算出装置は、ブロック平均ベクトルを算出するための各加速度ベクトルに対して上記の補正を行うのではなく、ブロック平均ベクトルに対して上記の補正を行う。したがって、上記の補正における計算処理の回数を低減することができ、上記の補正処理を高速に実行することができる。   According to the above configuration, the block average vector is corrected according to the angular velocity indicated by the angular velocity data. This correction is a process for fixing the block average vector (acceleration vector) expressed with reference to the input device with respect to the space (that is, preventing the direction in the space from changing). Here, according to the above configuration, the posture calculation apparatus performs the above correction on the block average vector instead of the above correction on each acceleration vector for calculating the block average vector. Therefore, the number of calculation processes in the correction can be reduced, and the correction process can be executed at high speed.

また、本発明は、情報処理装置のコンピュータを上記各手段として機能させる姿勢算出プログラムの形態で実施されてもよい。   In addition, the present invention may be implemented in the form of a posture calculation program that causes a computer of an information processing device to function as each of the above means.

本発明によれば、角速度データに基づいて算出される重力ベクトルを、異なる3種類の方法で補正することによって、重力ベクトルを正確に算出することができる。その結果、姿勢算出装置は、入力装置の姿勢をより正確に算出することができる。   According to the present invention, the gravity vector can be accurately calculated by correcting the gravity vector calculated based on the angular velocity data by three different methods. As a result, the posture calculation device can calculate the posture of the input device more accurately.

ゲームシステムの外観図External view of game system ゲーム装置の機能ブロック図Functional block diagram of game device 入力装置の外観構成を示す斜視図The perspective view which shows the external appearance structure of an input device コントローラの外観構成を示す斜視図Perspective view showing the external configuration of the controller コントローラの内部構造を示す図Diagram showing the internal structure of the controller コントローラの内部構造を示す図Diagram showing the internal structure of the controller 入力装置の構成を示すブロック図Block diagram showing the configuration of the input device 入力装置に関する重力ベクトルおよび検出加速度ベクトルを示す図Diagram showing gravity vector and detected acceleration vector for input device 静的補正処理における重力ベクトルの補正を示す図The figure which shows the correction of the gravity vector in static correction processing 入力装置に関する重力ベクトル、検出加速度ベクトル、および運動加速度ベクトルを示す図Diagram showing gravity vector, detected acceleration vector, and motion acceleration vector for the input device 入力装置に関する角速度ベクトルおよび運動加速度ベクトルを示す図Diagram showing angular velocity vector and motion acceleration vector for input device 動的補正処理における重力ベクトルの補正を示す図Diagram showing correction of gravity vector in dynamic correction processing ゲーム装置のメインメモリに記憶される主なデータを示す図The figure which shows the main data memorize | stored in the main memory of a game device ゲーム装置において実行される処理の流れを示すメインフローチャートMain flowchart showing the flow of processing executed in the game device 図14に示す加速度に基づく補正処理(ステップS5)の流れを示すフローチャートThe flowchart which shows the flow of the correction process (step S5) based on the acceleration shown in FIG. 図15に示す静的補正処理(ステップS12)の流れを示すフローチャートThe flowchart which shows the flow of the static correction process (step S12) shown in FIG. 図15に示す動的補正処理(ステップS13)の流れを示すフローチャートThe flowchart which shows the flow of the dynamic correction process (step S13) shown in FIG. 動的補正処理における重力補正ベクトルの算出方法を示す図The figure which shows the calculation method of the gravity correction vector in a dynamic correction process 動的補正処理における重力補正ベクトルの算出方法を示す図The figure which shows the calculation method of the gravity correction vector in a dynamic correction process 図15に示す動的補正処理(ステップS13)の変形例を示すフローチャートThe flowchart which shows the modification of the dynamic correction process (step S13) shown in FIG. 図15に示す長期平均補正処理(ステップS14)の流れを示すフローチャートThe flowchart which shows the flow of the long-term average correction process (step S14) shown in FIG. 長期平均補正処理において用いられる加速度履歴データおよびブロック平均データを模式的に示す図A diagram schematically showing acceleration history data and block average data used in long-term average correction processing 図14に示す撮像画像に基づく補正処理(ステップS6)の流れを示すフローチャート14 is a flowchart showing the flow of correction processing (step S6) based on the captured image shown in FIG. 撮像画像に対応する2次元座標を示す図The figure which shows the two-dimensional coordinate corresponding to a captured image

[ゲームシステムの全体構成]
図1を参照して、本発明の一実施形態に係る姿勢算出装置の一例であるゲーム装置を含むゲームシステム1について説明する。図1は、ゲームシステム1の外観図である。以下、据置型のゲーム装置を一例にして、本実施形態のゲーム装置およびゲームプログラムについて説明する。図1において、ゲームシステム1は、テレビジョン受像器(以下、単に「テレビ」と記載する)2、ゲーム装置3、光ディスク4、入力装置8、およびマーカ部6を含む。本システムは、入力装置8を用いたゲーム操作に基づいてゲーム装置3でゲーム処理を実行するものである。
[Overall configuration of game system]
With reference to FIG. 1, a game system 1 including a game apparatus, which is an example of an attitude calculation apparatus according to an embodiment of the present invention, will be described. FIG. 1 is an external view of the game system 1. Hereinafter, the game apparatus and the game program of the present embodiment will be described using a stationary game apparatus as an example. In FIG. 1, the game system 1 includes a television receiver (hereinafter simply referred to as “TV”) 2, a game device 3, an optical disk 4, an input device 8, and a marker unit 6. In the present system, game processing is executed by the game device 3 based on a game operation using the input device 8.

ゲーム装置3には、当該ゲーム装置3に対して交換可能に用いられる情報記憶媒体の一例である光ディスク4が脱着可能に挿入される。光ディスク4には、ゲーム装置3において実行されるためのゲームプログラムが記憶されている。ゲーム装置3の前面には光ディスク4の挿入口が設けられている。ゲーム装置3は、挿入口に挿入された光ディスク4に記憶されているゲームプログラムを読み出して実行することによってゲーム処理を実行する。   An optical disk 4 that is an example of an information storage medium that can be used interchangeably with the game apparatus 3 is detachably inserted into the game apparatus 3. The optical disc 4 stores a game program to be executed on the game apparatus 3. An insertion slot for the optical disk 4 is provided on the front surface of the game apparatus 3. The game apparatus 3 executes a game process by reading and executing a game program stored in the optical disc 4 inserted into the insertion slot.

ゲーム装置3には、表示装置の一例であるテレビ2が接続コードを介して接続される。テレビ2は、ゲーム装置3において実行されるゲーム処理の結果得られるゲーム画像を表示する。また、テレビ2の画面の周辺(図1では画面の上側)には、マーカ部6が設置される。マーカ部6は、その両端に2つのマーカ6Rおよび6Lを備えている。マーカ6R(マーカ6Lも同様)は、具体的には1以上の赤外LEDであり、テレビ2の前方に向かって赤外光を出力する。マーカ部6はゲーム装置3に接続されており、ゲーム装置3はマーカ部6が備える各赤外LEDの点灯を制御することが可能である。   A television 2 which is an example of a display device is connected to the game apparatus 3 via a connection cord. The television 2 displays a game image obtained as a result of the game process executed in the game device 3. A marker unit 6 is installed around the screen of the television 2 (upper side of the screen in FIG. 1). The marker unit 6 includes two markers 6R and 6L at both ends thereof. The marker 6R (same for the marker 6L) is specifically one or more infrared LEDs, and outputs infrared light toward the front of the television 2. The marker unit 6 is connected to the game apparatus 3, and the game apparatus 3 can control lighting of each infrared LED included in the marker unit 6.

入力装置8は、自機に対して行われた操作の内容を示す操作データをゲーム装置3に与えるものである。本実施形態では、入力装置8はコントローラ5とジャイロセンサユニット7とを含む。詳細は後述するが、入力装置8は、コントローラ5に対してジャイロセンサユニット7が着脱可能に接続されている構成である。コントローラ5とゲーム装置3とは無線通信によって接続される。本実施形態では、コントローラ5とゲーム装置3との間の無線通信には例えばBluetooth(ブルートゥース)(登録商標)の技術が用いられる。なお、他の実施形態においてはコントローラ5とゲーム装置3とは有線で接続されてもよい。   The input device 8 gives operation data indicating the content of the operation performed on the own device to the game device 3. In the present embodiment, the input device 8 includes a controller 5 and a gyro sensor unit 7. Although details will be described later, the input device 8 has a configuration in which a gyro sensor unit 7 is detachably connected to the controller 5. The controller 5 and the game apparatus 3 are connected by wireless communication. In the present embodiment, for example, Bluetooth (registered trademark) technology is used for wireless communication between the controller 5 and the game apparatus 3. In other embodiments, the controller 5 and the game apparatus 3 may be connected by wire.

[ゲーム装置3の内部構成]
次に、図2を参照して、ゲーム装置3の内部構成について説明する。図2は、ゲーム装置3の構成を示すブロック図である。ゲーム装置3は、CPU10、システムLSI11、外部メインメモリ12、ROM/RTC13、ディスクドライブ14、およびAV−IC15等を有する。
[Internal configuration of game device 3]
Next, the internal configuration of the game apparatus 3 will be described with reference to FIG. FIG. 2 is a block diagram showing a configuration of the game apparatus 3. The game apparatus 3 includes a CPU 10, a system LSI 11, an external main memory 12, a ROM / RTC 13, a disk drive 14, an AV-IC 15 and the like.

CPU10は、光ディスク4に記憶されたゲームプログラムを実行することによってゲーム処理を実行するものであり、ゲームプロセッサとして機能する。CPU10は、システムLSI11に接続される。システムLSI11には、CPU10の他、外部メインメモリ12、ROM/RTC13、ディスクドライブ14およびAV−IC15が接続される。システムLSI11は、それに接続される各構成要素間のデータ転送の制御、表示すべき画像の生成、外部装置からのデータの取得等の処理を行う。システムLSIの内部構成について後述する。揮発性の外部メインメモリ12は、光ディスク4から読み出されたゲームプログラムや、フラッシュメモリ17から読み出されたゲームプログラム等のプログラムを記憶したり、各種データを記憶したりするものであり、CPU10のワーク領域やバッファ領域として用いられる。ROM/RTC13は、ゲーム装置3の起動用のプログラムが組み込まれるROM(いわゆるブートROM)と、時間をカウントするクロック回路(RTC:Real Time Clock)とを有する。ディスクドライブ14は、光ディスク4からプログラムデータやテクスチャデータ等を読み出し、後述する内部メインメモリ11eまたは外部メインメモリ12に読み出したデータを書き込む。   The CPU 10 executes a game process by executing a game program stored on the optical disc 4, and functions as a game processor. The CPU 10 is connected to the system LSI 11. In addition to the CPU 10, an external main memory 12, a ROM / RTC 13, a disk drive 14, and an AV-IC 15 are connected to the system LSI 11. The system LSI 11 performs processing such as control of data transfer between components connected thereto, generation of an image to be displayed, and acquisition of data from an external device. The internal configuration of the system LSI will be described later. The volatile external main memory 12 stores a program such as a game program read from the optical disc 4 or a game program read from the flash memory 17, or stores various data. Used as a work area and buffer area. The ROM / RTC 13 includes a ROM (so-called boot ROM) in which a program for starting the game apparatus 3 is incorporated, and a clock circuit (RTC: Real Time Clock) that counts time. The disk drive 14 reads program data, texture data, and the like from the optical disk 4 and writes the read data to an internal main memory 11e or an external main memory 12 described later.

また、システムLSI11には、入出力プロセッサ(I/Oプロセッサ)11a、GPU(Graphics Processor Unit)11b、DSP(Digital Signal Processor)11c、VRA 1d、および内部メインメモリ11eが設けられる。図示は省略するが、これらの構成要素11a〜11eは内部バスによって互いに接続される。   The system LSI 11 includes an input / output processor (I / O processor) 11a, a GPU (Graphics Processor Unit) 11b, a DSP (Digital Signal Processor) 11c, a VRA 1d, and an internal main memory 11e. Although not shown, these components 11a to 11e are connected to each other by an internal bus.

GPU11bは、描画手段の一部を形成し、CPU10からのグラフィクスコマンド(作画命令)に従って画像を生成する。VRAM11dは、GPU11bがグラフィクスコマンドを実行するために必要なデータ(ポリゴンデータやテクスチャデータ等のデータ)を記憶する。画像が生成される際には、GPU11bは、VRAM11dに記憶されたデータを用いて画像データを作成する。   The GPU 11b forms part of a drawing unit and generates an image according to a graphics command (drawing command) from the CPU 10. The VRAM 11d stores data (data such as polygon data and texture data) necessary for the GPU 11b to execute the graphics command. When an image is generated, the GPU 11b creates image data using data stored in the VRAM 11d.

DSP11cは、オーディオプロセッサとして機能し、内部メインメモリ11eや外部メインメモリ12に記憶されるサウンドデータや音波形(音色)データを用いて、音声データを生成する。   The DSP 11c functions as an audio processor, and generates sound data using sound data and sound waveform (tone color) data stored in the internal main memory 11e and the external main memory 12.

上述のように生成された画像データおよび音声データは、AV−IC15によって読み出される。AV−IC15は、読み出した画像データをAVコネクタ16を介してテレビ2に出力するとともに、読み出した音声データを、テレビ2に内蔵されるスピーカ2aに出力する。これによって、画像がテレビ2に表示されるとともに音がスピーカ2aから出力される。   The image data and audio data generated as described above are read out by the AV-IC 15. The AV-IC 15 outputs the read image data to the television 2 via the AV connector 16, and outputs the read audio data to the speaker 2 a built in the television 2. As a result, an image is displayed on the television 2 and a sound is output from the speaker 2a.

入出力プロセッサ11aは、それに接続される構成要素との間でデータの送受信を実行したり、外部装置からのデータのダウンロードを実行したりする。入出力プロセッサ11aは、フラッシュメモリ17、無線通信モジュール18、無線コントローラモジュール19、拡張コネクタ20、およびメモリカード用コネクタ21に接続される。無線通信モジュール18にはアンテナ22が接続され、無線コントローラモジュール19にはアンテナ23が接続される。   The input / output processor 11a performs transmission / reception of data to / from components connected to the input / output processor 11a and downloads data from an external device. The input / output processor 11a is connected to the flash memory 17, the wireless communication module 18, the wireless controller module 19, the expansion connector 20, and the memory card connector 21. An antenna 22 is connected to the wireless communication module 18, and an antenna 23 is connected to the wireless controller module 19.

入出力プロセッサ11aは、無線通信モジュール18およびアンテナ22を介してネットワークに接続し、ネットワークに接続される他のゲーム装置や各種サーバと通信することができる。入出力プロセッサ11aは、定期的にフラッシュメモリ17にアクセスし、ネットワークへ送信する必要があるデータの有無を検出し、当該データが有る場合には、無線通信モジュール18およびアンテナ22を介してネットワークに送信する。また、入出力プロセッサ11aは、他のゲーム装置から送信されてくるデータやダウンロードサーバからダウンロードしたデータを、ネットワーク、アンテナ22および無線通信モジュール18を介して受信し、受信したデータをフラッシュメモリ17に記憶する。CPU10はゲームプログラムを実行することにより、フラッシュメモリ17に記憶されたデータを読み出してゲームプログラムで利用する。フラッシュメモリ17には、ゲーム装置3と他のゲーム装置や各種サーバとの間で送受信されるデータの他、ゲーム装置3を利用してプレイしたゲームのセーブデータ(ゲームの結果データまたは途中データ)が記憶されてもよい。   The input / output processor 11a is connected to the network via the wireless communication module 18 and the antenna 22, and can communicate with other game devices and various servers connected to the network. The input / output processor 11a periodically accesses the flash memory 17 to detect the presence / absence of data that needs to be transmitted to the network. If there is such data, the input / output processor 11a communicates with the network via the wireless communication module 18 and the antenna 22. Send. Further, the input / output processor 11a receives data transmitted from other game devices and data downloaded from the download server via the network, the antenna 22 and the wireless communication module 18, and receives the received data in the flash memory 17. Remember. By executing the game program, the CPU 10 reads out the data stored in the flash memory 17 and uses it in the game program. In the flash memory 17, in addition to data transmitted and received between the game apparatus 3 and other game apparatuses and various servers, save data (game result data or intermediate data) of the game played using the game apparatus 3 May be stored.

また、入出力プロセッサ11aは、コントローラ5から送信される操作データをアンテナ23および無線コントローラモジュール19を介して受信し、内部メインメモリ11eまたは外部メインメモリ12のバッファ領域に記憶(一時記憶)する。   The input / output processor 11a receives operation data transmitted from the controller 5 via the antenna 23 and the wireless controller module 19, and stores (temporarily stores) the data in the buffer area of the internal main memory 11e or the external main memory 12.

さらに、入出力プロセッサ11aには、拡張コネクタ20およびメモリカード用コネクタ21が接続される。拡張コネクタ20は、USBやSCSIのようなインターフェースのためのコネクタであり、外部記憶媒体のようなメディアを接続したり、他のコントローラのような周辺機器を接続したり、有線の通信用コネクタを接続することによって無線通信モジュール18に替えてネットワークとの通信を行ったりすることができる。メモリカード用コネクタ21は、メモリカードのような外部記憶媒体を接続するためのコネクタである。例えば、入出力プロセッサ11aは、拡張コネクタ20やメモリカード用コネクタ21を介して外部記憶媒体にアクセスし、外部記憶媒体にデータを保存したり、外部記憶媒体からデータを読み出したりすることができる。   Further, an expansion connector 20 and a memory card connector 21 are connected to the input / output processor 11a. The expansion connector 20 is a connector for an interface such as USB or SCSI, and connects a medium such as an external storage medium, a peripheral device such as another controller, or a wired communication connector. By connecting, communication with the network can be performed instead of the wireless communication module 18. The memory card connector 21 is a connector for connecting an external storage medium such as a memory card. For example, the input / output processor 11a can access an external storage medium via the expansion connector 20 or the memory card connector 21 to store data in the external storage medium or read data from the external storage medium.

ゲーム装置3には、電源ボタン24、リセットボタン25、およびイジェクトボタン26が設けられる。電源ボタン24およびリセットボタン25は、システムLSI11に接続される。電源ボタン24がオンされると、ゲーム装置3の各構成要素に対して、図示しないACアダプタを経て電源が供給される。リセットボタン25が押されると、システムLSI11は、ゲーム装置3の起動プログラムを再起動する。イジェクトボタン26は、ディスクドライブ14に接続される。イジェクトボタン26が押されると、ディスクドライブ14から光ディスク4が排出される。   The game apparatus 3 is provided with a power button 24, a reset button 25, and an eject button 26. The power button 24 and the reset button 25 are connected to the system LSI 11. When the power button 24 is turned on, power is supplied to each component of the game apparatus 3 via an AC adapter (not shown). When the reset button 25 is pressed, the system LSI 11 restarts the boot program for the game apparatus 3. The eject button 26 is connected to the disk drive 14. When the eject button 26 is pressed, the optical disk 4 is ejected from the disk drive 14.

[入力装置8の構成]
次に、図3〜図6を参照して、入力装置8について説明する。図3は、入力装置8の外観構成を示す斜視図である。図4は、コントローラ5の外観構成を示す斜視図である。図3は、コントローラ5の上側後方から見た斜視図であり、図4は、コントローラ5を下側前方から見た斜視図である。
[Configuration of Input Device 8]
Next, the input device 8 will be described with reference to FIGS. FIG. 3 is a perspective view showing an external configuration of the input device 8. FIG. 4 is a perspective view showing an external configuration of the controller 5. 3 is a perspective view of the controller 5 as seen from the upper rear side, and FIG. 4 is a perspective view of the controller 5 as seen from the lower front side.

図3および図4において、コントローラ5は、例えばプラスチック成型によって形成されたハウジング31を有している。ハウジング31は、その前後方向(図3に示すZ軸方向)を長手方向とした略直方体形状を有しており、全体として大人や子供の片手で把持可能な大きさである。プレイヤは、コントローラ5に設けられたボタンを押下すること、および、コントローラ5自体を動かしてその位置や姿勢を変えることによってゲーム操作を行うことができる。   3 and 4, the controller 5 includes a housing 31 formed by plastic molding, for example. The housing 31 has a substantially rectangular parallelepiped shape whose longitudinal direction is the front-rear direction (the Z-axis direction shown in FIG. 3), and is a size that can be gripped with one hand of an adult or a child as a whole. The player can perform a game operation by pressing a button provided on the controller 5 and moving the controller 5 itself to change its position and posture.

ハウジング31には、複数の操作ボタンが設けられる。図3に示すように、ハウジング31の上面には、十字ボタン32a、1番ボタン32b、2番ボタン32c、Aボタン32d、マイナスボタン32e、ホームボタン32f、プラスボタン32g、および電源ボタン32hが設けられる。本明細書では、これらのボタン32a〜32hが設けられるハウジング31の上面を「ボタン面」と呼ぶことがある。一方、図4に示すように、ハウジング31の下面には凹部が形成されており、当該凹部の後面側傾斜面にはBボタン32iが設けられる。これらの各操作ボタン32a〜32iには、ゲーム装置3が実行するゲームプログラムに応じた機能が適宜割り当てられる。また、電源ボタン32hは遠隔からゲーム装置3本体の電源をオン/オフするためのものである。ホームボタン32fおよび電源ボタン32hは、その上面がハウジング31の上面に埋没している。これによって、プレイヤがホームボタン32fまたは電源ボタン32hを誤って押下することを防止することができる。   The housing 31 is provided with a plurality of operation buttons. As shown in FIG. 3, a cross button 32a, a first button 32b, a second button 32c, an A button 32d, a minus button 32e, a home button 32f, a plus button 32g, and a power button 32h are provided on the upper surface of the housing 31. It is done. In the present specification, the upper surface of the housing 31 on which these buttons 32a to 32h are provided may be referred to as a “button surface”. On the other hand, as shown in FIG. 4, a recess is formed on the lower surface of the housing 31, and a B button 32i is provided on the rear inclined surface of the recess. A function corresponding to the game program executed by the game apparatus 3 is appropriately assigned to each of the operation buttons 32a to 32i. The power button 32h is for remotely turning on / off the main body of the game apparatus 3. The home button 32 f and the power button 32 h are embedded in the upper surface of the housing 31. This can prevent the player from pressing the home button 32f or the power button 32h by mistake.

ハウジング31の後面にはコネクタ33が設けられている。コネクタ33は、コントローラ5に他の機器(例えば、ジャイロセンサユニット7や他のコントローラ)を接続するために利用される。また、ハウジング31の後面におけるコネクタ33の両側には、上記他の機器が容易に離脱することを防止するために係止穴33aが設けられている。   A connector 33 is provided on the rear surface of the housing 31. The connector 33 is used to connect another device (for example, the gyro sensor unit 7 or another controller) to the controller 5. Further, locking holes 33a are provided on both sides of the connector 33 on the rear surface of the housing 31 in order to prevent the other devices from being easily detached.

ハウジング31上面の後方には複数(図3では4つ)のLED34a〜34dが設けられる。ここで、コントローラ5には、他のメインコントローラと区別するためにコントローラ種別(番号)が付与される。各LED34a〜34dは、コントローラ5に現在設定されている上記コントローラ種別をプレイヤに通知したり、コントローラ5の電池残量をプレイヤに通知したりする等の目的で用いられる。具体的には、コントローラ5を用いてゲーム操作が行われる際、上記コントローラ種別に応じて複数のLED34a〜34dのいずれか1つが点灯する。   A plurality (four in FIG. 3) of LEDs 34 a to 34 d are provided behind the upper surface of the housing 31. Here, the controller type (number) is assigned to the controller 5 to distinguish it from other main controllers. The LEDs 34a to 34d are used for the purpose of notifying the player of the controller type currently set in the controller 5 and notifying the player of the remaining battery level of the controller 5. Specifically, when a game operation is performed using the controller 5, any one of the plurality of LEDs 34a to 34d is turned on according to the controller type.

また、コントローラ5は撮像情報演算部35(図6)を有しており、図4に示すように、ハウジング31前面には撮像情報演算部35の光入射面35aが設けられる。光入射面35aは、マーカ6Rおよび6Lからの赤外光を少なくとも透過する材質で構成される。   Further, the controller 5 has an imaging information calculation unit 35 (FIG. 6), and a light incident surface 35a of the imaging information calculation unit 35 is provided on the front surface of the housing 31 as shown in FIG. The light incident surface 35a is made of a material that transmits at least infrared light from the markers 6R and 6L.

ハウジング31上面における1番ボタン32bとホームボタン32fとの間には、コントローラ5に内蔵されるスピーカ49(図5)からの音を外部に放出するための音抜き孔31aが形成されている。   Between the first button 32b and the home button 32f on the upper surface of the housing 31, a sound release hole 31a for releasing sound from the speaker 49 (FIG. 5) built in the controller 5 is formed.

次に、図5および図6を参照して、コントローラ5の内部構造について説明する。図5および図6は、コントローラ5の内部構造を示す図である。なお、図5は、コントローラ5の上筐体(ハウジング31の一部)を外した状態を示す斜視図である。図6は、コントローラ5の下筐体(ハウジング31の一部)を外した状態を示す斜視図である。図6に示す斜視図は、図5に示す基板30を裏面から見た斜視図となっている。   Next, the internal structure of the controller 5 will be described with reference to FIGS. 5 and 6 are diagrams showing the internal structure of the controller 5. FIG. FIG. 5 is a perspective view showing a state in which the upper housing (a part of the housing 31) of the controller 5 is removed. FIG. 6 is a perspective view showing a state in which the lower casing (a part of the housing 31) of the controller 5 is removed. The perspective view shown in FIG. 6 is a perspective view of the substrate 30 shown in FIG.

図5において、ハウジング31の内部には基板30が固設されており、当該基板30の上主面上に各操作ボタン32a〜32h、各LED34a〜34d、加速度センサ37、アンテナ45、およびスピーカ49等が設けられる。これらは、基板30等に形成された配線(図示せず)によってマイクロコンピュータ(Micro Computer:マイコン)42(図6参照)に接続される。本実施形態では、加速度センサ37は、X軸方向に関してコントローラ5の中心からずれた位置に配置されている。これによって、コントローラ5をZ軸回りに回転させたときのコントローラ5の動きが算出しやすくなる。また、加速度センサ37は、長手方向(Z軸方向)に関してコントローラ5の中心よりも前方に配置されている。また、無線モジュール44(図6)およびアンテナ45によって、コントローラ5がワイヤレスコントローラとして機能する。   In FIG. 5, a substrate 30 is fixed inside the housing 31, and operation buttons 32 a to 32 h, LEDs 34 a to 34 d, an acceleration sensor 37, an antenna 45, and a speaker 49 are provided on the upper main surface of the substrate 30. Etc. are provided. These are connected to a microcomputer (microcomputer) 42 (see FIG. 6) by wiring (not shown) formed on the substrate 30 and the like. In the present embodiment, the acceleration sensor 37 is disposed at a position shifted from the center of the controller 5 with respect to the X-axis direction. This makes it easier to calculate the movement of the controller 5 when the controller 5 is rotated about the Z axis. The acceleration sensor 37 is disposed in front of the center of the controller 5 in the longitudinal direction (Z-axis direction). Further, the controller 5 functions as a wireless controller by the wireless module 44 (FIG. 6) and the antenna 45.

一方、図6において、基板30の下主面上の前端縁に撮像情報演算部35が設けられる。撮像情報演算部35は、コントローラ5の前方から順に赤外線フィルタ38、レンズ39、撮像素子40、および画像処理回路41を備えている。これらの部材38〜41はそれぞれ基板30の下主面に取り付けられる。   On the other hand, in FIG. 6, an imaging information calculation unit 35 is provided at the front edge on the lower main surface of the substrate 30. The imaging information calculation unit 35 includes an infrared filter 38, a lens 39, an imaging element 40, and an image processing circuit 41 in order from the front of the controller 5. These members 38 to 41 are respectively attached to the lower main surface of the substrate 30.

さらに、基板30の下主面上には、上記マイコン42およびバイブレータ48が設けられている。バイブレータ48は、例えば振動モータやソレノイドであり、基板30等に形成された配線によってマイコン42と接続される。マイコン42の指示によりバイブレータ48が作動することによってコントローラ5に振動が発生する。これによって、コントローラ5を把持しているプレイヤの手にその振動が伝達される、いわゆる振動対応ゲームを実現することができる。本実施形態では、バイブレータ48は、ハウジング31のやや前方寄りに配置される。つまり、バイブレータ48がコントローラ5の中心よりも端側に配置することによって、バイブレータ48の振動によりコントローラ5全体を大きく振動させることができる。また、コネクタ33は、基板30の下主面上の後端縁に取り付けられる。なお、図5および図6に示す他、コントローラ5は、マイコン42の基本クロックを生成する水晶振動子、スピーカ49に音声信号を出力するアンプ等を備えている。   Further, the microcomputer 42 and the vibrator 48 are provided on the lower main surface of the substrate 30. The vibrator 48 is, for example, a vibration motor or a solenoid, and is connected to the microcomputer 42 by wiring formed on the substrate 30 or the like. The controller 48 is vibrated by the operation of the vibrator 48 according to the instruction of the microcomputer 42. As a result, a so-called vibration-compatible game in which the vibration is transmitted to the hand of the player holding the controller 5 can be realized. In the present embodiment, the vibrator 48 is disposed slightly forward of the housing 31. That is, by arranging the vibrator 48 on the end side of the center of the controller 5, the entire controller 5 can be vibrated greatly by the vibration of the vibrator 48. The connector 33 is attached to the rear edge on the lower main surface of the substrate 30. 5 and 6, the controller 5 includes a crystal resonator that generates a basic clock of the microcomputer 42, an amplifier that outputs an audio signal to the speaker 49, and the like.

また、ジャイロセンサユニット7は、3軸回りの角速度を検知するジャイロセンサ(図7に示すジャイロセンサ55および56)を有する。ジャイロセンサユニット7は、コントローラ5のコネクタ33に着脱可能に装着される。ジャイロセンサユニット7の前端(図3に示すZ軸正方向側の端部)には、コネクタ33に接続可能なプラグ(図7に示すプラグ53)が設けられる。さらに、プラグ53の両側にはフック(図示せず)が設けられる。ジャイロセンサユニット7がコントローラ5に対して装着される状態では、プラグ53がコネクタ33に接続されるとともに、上記フックがコントローラ5の係止穴33aに係止する。これによって、コントローラ5とジャイロセンサユニット7とがしっかりと固定される。また、ジャイロセンサユニット7は側面(図3に示すX軸方向の面)にボタン51を有している。ボタン51は、それを押下すれば上記フックの係止穴33aに対する係止状態を解除することができるように構成されている。したがって、ボタン51を押下しながらプラグ53をコネクタ33から抜くことによって、ジャイロセンサユニット7をコントローラ5から離脱することができる。   Further, the gyro sensor unit 7 includes gyro sensors (gyro sensors 55 and 56 shown in FIG. 7) that detect angular velocities around three axes. The gyro sensor unit 7 is detachably attached to the connector 33 of the controller 5. A plug (plug 53 shown in FIG. 7) that can be connected to the connector 33 is provided at the front end of the gyro sensor unit 7 (end on the Z-axis positive direction side shown in FIG. 3). Further, hooks (not shown) are provided on both sides of the plug 53. In a state where the gyro sensor unit 7 is attached to the controller 5, the plug 53 is connected to the connector 33 and the hook is locked in the locking hole 33 a of the controller 5. Thereby, the controller 5 and the gyro sensor unit 7 are firmly fixed. The gyro sensor unit 7 has a button 51 on a side surface (surface in the X-axis direction shown in FIG. 3). The button 51 is configured such that when the button 51 is pressed, the hook is released from the locked state with respect to the locking hole 33a. Therefore, the gyro sensor unit 7 can be detached from the controller 5 by removing the plug 53 from the connector 33 while pressing the button 51.

また、ジャイロセンサユニット7の後端には、上記コネクタ33と同形状のコネクタが設けられる。したがって、コントローラ5(のコネクタ33)に対して装着可能な他の機器は、ジャイロセンサユニット7のコネクタに対しても装着可能である。なお、図3においては、当該コネクタに対してカバー52が着脱可能に装着されている。   A connector having the same shape as the connector 33 is provided at the rear end of the gyro sensor unit 7. Therefore, other devices that can be attached to the controller 5 (connector 33 thereof) can also be attached to the connector of the gyro sensor unit 7. In FIG. 3, a cover 52 is detachably attached to the connector.

なお、図3〜図6に示したコントローラ5およびジャイロセンサユニット7の形状や、各操作ボタンの形状、加速度センサやバイブレータの数および設置位置等は単なる一例に過ぎず、他の形状、数、および設置位置であっても、本発明を実現することができる。また、本実施形態では、撮像手段による撮像方向はZ軸正方向であるが、撮像方向はいずれの方向であってもよい。すなわち、コントローラ5における撮像情報演算部35の位置(撮像情報演算部35の光入射面35a)は、ハウジング31の前面でなくてもよく、ハウジング31の外部から光を取り入れることができれば他の面に設けられてもかまわない。   The shapes of the controller 5 and the gyro sensor unit 7 shown in FIGS. 3 to 6, the shapes of the operation buttons, the number of acceleration sensors and vibrators, and the installation positions are merely examples, and other shapes, numbers, Even in the installation position, the present invention can be realized. In the present embodiment, the imaging direction by the imaging unit is the positive Z-axis direction, but the imaging direction may be any direction. That is, the position of the imaging information calculation unit 35 in the controller 5 (the light incident surface 35a of the imaging information calculation unit 35) does not have to be the front surface of the housing 31, and other surfaces can be used as long as light can be taken in from the outside of the housing 31. May be provided.

図7は、入力装置8(コントローラ5およびジャイロセンサユニット7)の構成を示すブロック図である。コントローラ5は、操作部32(各操作ボタン32a〜32i)、コネクタ33、撮像情報演算部35、通信部36、および加速度センサ37を備えている。コントローラ5は、自機に対して行われた操作内容を示すデータを操作データとしてゲーム装置3へ送信するものである。   FIG. 7 is a block diagram showing a configuration of the input device 8 (the controller 5 and the gyro sensor unit 7). The controller 5 includes an operation unit 32 (operation buttons 32a to 32i), a connector 33, an imaging information calculation unit 35, a communication unit 36, and an acceleration sensor 37. The controller 5 transmits data indicating the details of the operation performed on the own device to the game apparatus 3 as operation data.

操作部32は、上述した各操作ボタン32a〜32iを含み、各操作ボタン32a〜32iに対する入力状態(各操作ボタン32a〜32iが押下されたか否か)を示す操作ボタンデータを通信部36のマイコン42へ出力する。   The operation unit 32 includes the operation buttons 32a to 32i described above, and the operation button data indicating the input state (whether or not each operation button 32a to 32i is pressed) to each operation button 32a to 32i is transmitted to the microcomputer of the communication unit 36. Output to 42.

撮像情報演算部35は、撮像手段が撮像した画像データを解析してその中で輝度が高い領域を判別してその領域の重心位置やサイズなどを算出するためのシステムである。撮像情報演算部35は、例えば最大200フレーム/秒程度のサンプリング周期を有するので、比較的高速なコントローラ5の動きでも追跡して解析することができる。   The imaging information calculation unit 35 is a system for analyzing the image data captured by the imaging unit, discriminating a region having a high luminance in the image data, and calculating a center of gravity position, a size, and the like of the region. Since the imaging information calculation unit 35 has a sampling period of, for example, about 200 frames / second at the maximum, it can track and analyze even a relatively fast movement of the controller 5.

撮像情報演算部35は、赤外線フィルタ38、レンズ39、撮像素子40、および画像処理回路41を含んでいる。赤外線フィルタ38は、コントローラ5の前方から入射する光から赤外線のみを通過させる。レンズ39は、赤外線フィルタ38を透過した赤外線を集光して撮像素子40へ入射させる。撮像素子40は、例えばCMOSセンサやあるいはCCDセンサのような固体撮像素子であり、レンズ39が集光した赤外線を受光して画像信号を出力する。ここで、テレビ2の表示画面近傍に配置されるマーカ部6のマーカ6Rおよび6Lは、テレビ2の前方に向かって赤外光を出力する赤外LEDで構成される。したがって、赤外線フィルタ38を設けることによって、撮像素子40は、赤外線フィルタ38を通過した赤外線だけを受光して画像データを生成するので、マーカ6Rおよび6Lの画像をより正確に撮像することができる。以下では、撮像素子40によって撮像された画像を撮像画像と呼ぶ。撮像素子40によって生成された画像データは、画像処理回路41で処理される。画像処理回路41は、撮像画像内における撮像対象(マーカ6Rおよび6L)の位置を算出する。画像処理回路41は、算出された位置を示す座標を通信部36のマイコン42へ出力する。この座標のデータは、マイコン42によって操作データとしてゲーム装置3に送信される。以下では、上記座標を「マーカ座標」と呼ぶ。マーカ座標はコントローラ5自体の向き(傾斜角度)や位置に対応して変化するので、ゲーム装置3はこのマーカ座標を用いてコントローラ5の向きや位置を算出することができる。   The imaging information calculation unit 35 includes an infrared filter 38, a lens 39, an imaging element 40, and an image processing circuit 41. The infrared filter 38 passes only infrared rays from the light incident from the front of the controller 5. The lens 39 collects the infrared light transmitted through the infrared filter 38 and makes it incident on the image sensor 40. The image sensor 40 is a solid-state image sensor such as a CMOS sensor or a CCD sensor, for example, and receives the infrared light collected by the lens 39 and outputs an image signal. Here, the markers 6 </ b> R and 6 </ b> L of the marker unit 6 disposed in the vicinity of the display screen of the television 2 are configured by infrared LEDs that output infrared light toward the front of the television 2. Therefore, by providing the infrared filter 38, the image sensor 40 receives only the infrared light that has passed through the infrared filter 38 and generates image data, so that the images of the markers 6R and 6L can be captured more accurately. Hereinafter, an image captured by the image sensor 40 is referred to as a captured image. Image data generated by the image sensor 40 is processed by the image processing circuit 41. The image processing circuit 41 calculates the position of the imaging target (markers 6R and 6L) in the captured image. The image processing circuit 41 outputs coordinates indicating the calculated position to the microcomputer 42 of the communication unit 36. The coordinate data is transmitted to the game apparatus 3 as operation data by the microcomputer 42. Hereinafter, the coordinates are referred to as “marker coordinates”. Since the marker coordinates change corresponding to the direction (tilt angle) and position of the controller 5 itself, the game apparatus 3 can calculate the direction and position of the controller 5 using the marker coordinates.

なお、他の実施形態においては、コントローラ5は画像処理回路41を備えていない構成であってもよく、撮像画像自体がコントローラ5からゲーム装置3へ送信されてもよい。このとき、ゲーム装置3は、画像処理回路41と同様の機能を有する回路あるいはプログラムを有しており、上記マーカ座標を算出するようにしてもよい。   In other embodiments, the controller 5 may not include the image processing circuit 41, and the captured image itself may be transmitted from the controller 5 to the game apparatus 3. At this time, the game apparatus 3 may have a circuit or a program having the same function as the image processing circuit 41, and may calculate the marker coordinates.

加速度センサ37は、コントローラ5の加速度(重力加速度を含む)を検出する、すなわち、コントローラ5に加わる力(重力を含む)を検出する。加速度センサ37は、当該加速度センサ37の検出部に加わっている加速度のうち、センシング軸方向に沿った直線方向の加速度(直線加速度)の値を検出する。例えば、2軸以上の多軸加速度センサの場合には、加速度センサの検出部に加わっている加速度として、各軸に沿った成分の加速度をそれぞれ検出する。例えば、3軸または2軸の加速度センサは、アナログ・デバイセズ株式会社(Analog Devices, Inc.)またはSTマイクロエレクトロニクス社(STMicroelectronics N.V.)から入手可能である種類のものでもよい。なお、加速度センサ37は、例えば静電容量式の加速度センサであるとするが、他の方式の加速度センサを用いるようにしてもよい。   The acceleration sensor 37 detects the acceleration (including gravity acceleration) of the controller 5, that is, detects the force (including gravity) applied to the controller 5. The acceleration sensor 37 detects the value of the acceleration (linear acceleration) in the linear direction along the sensing axis direction among the accelerations applied to the detection unit of the acceleration sensor 37. For example, in the case of a multi-axis acceleration sensor having two or more axes, the component acceleration along each axis is detected as the acceleration applied to the detection unit of the acceleration sensor. For example, the triaxial or biaxial acceleration sensor may be of the type available from Analog Devices, Inc. or ST Microelectronics NV. The acceleration sensor 37 is, for example, a capacitance type acceleration sensor, but other types of acceleration sensors may be used.

本実施形態では、加速度センサ37は、コントローラ5を基準とした上下方向(図3に示すY軸方向)、左右方向(図3に示すX軸方向)および前後方向(図3に示すZ軸方向)の3軸方向に関してそれぞれ直線加速度を検出する。加速度センサ37は、各軸に沿った直線方向に関する加速度を検出するものであるため、加速度センサ37からの出力は3軸それぞれの直線加速度の値を表すものとなる。すなわち、検出された加速度は、入力装置8(コントローラ5)を基準に設定されるXYZ座標系(コントローラ座標系)における3次元のベクトル(ax,ay,az)として表される。以下では、加速度センサ37によって検出される3軸に関する各加速度値を各成分とするベクトルを加速度ベクトルと呼ぶ。また、以下では、当該加速度ベクトルを、後述する運動加速度ベクトルと明確に区別する目的で、「検出加速度ベクトル」と呼ぶことがある。   In the present embodiment, the acceleration sensor 37 has a vertical direction (Y-axis direction shown in FIG. 3), a horizontal direction (X-axis direction shown in FIG. 3), and a front-back direction (Z-axis direction shown in FIG. 3) with reference to the controller 5. ) Linear acceleration is detected in each of the three axis directions. Since the acceleration sensor 37 detects acceleration in the linear direction along each axis, the output from the acceleration sensor 37 represents the linear acceleration value of each of the three axes. That is, the detected acceleration is represented as a three-dimensional vector (ax, ay, az) in an XYZ coordinate system (controller coordinate system) set with reference to the input device 8 (controller 5). Hereinafter, a vector having the respective acceleration values related to the three axes detected by the acceleration sensor 37 as components is referred to as an acceleration vector. Hereinafter, the acceleration vector may be referred to as a “detected acceleration vector” for the purpose of clearly distinguishing it from a motion acceleration vector described later.

加速度センサ37が検出した加速度を示すデータ(加速度データ)は、通信部36へ出力される。なお、加速度センサ37が検出した加速度は、コントローラ5自体の向き(傾斜角度)や動きに対応して変化するので、ゲーム装置3は加速度データを用いてコントローラ5の向きや動きを算出することができる。本実施形態では、ゲーム装置3は、加速度データに基づいてコントローラ5の姿勢を判断する。   Data indicating the acceleration detected by the acceleration sensor 37 (acceleration data) is output to the communication unit 36. The acceleration detected by the acceleration sensor 37 changes in accordance with the direction (tilt angle) and movement of the controller 5 itself, so that the game apparatus 3 can calculate the direction and movement of the controller 5 using the acceleration data. it can. In the present embodiment, the game apparatus 3 determines the attitude of the controller 5 based on the acceleration data.

加速度センサ37が検出した加速度(加速度ベクトル)を示すデータ(加速度データ)は、通信部36へ出力される。本実施形態において、加速度センサ37は、コントローラ5の傾斜角度を判断するためのデータを出力するセンサとして用いられる。   Data (acceleration data) indicating the acceleration (acceleration vector) detected by the acceleration sensor 37 is output to the communication unit 36. In the present embodiment, the acceleration sensor 37 is used as a sensor that outputs data for determining the tilt angle of the controller 5.

なお、加速度センサ37から出力される加速度の信号に基づいて、ゲーム装置3のプロセッサ(例えばCPU10)またはコントローラ5のプロセッサ(例えばマイコン42)等のコンピュータが処理を行うことによって、コントローラ5に関するさらなる情報を推測または算出(判定)することができることは、当業者であれば本明細書の説明から容易に理解できるであろう。例えば、加速度センサ37を搭載するコントローラ5が静止状態であることを前提としてコンピュータ側の処理が実行される場合(すなわち、加速度センサによって検出される加速度が重力加速度のみであるとして処理が実行される場合)、コントローラ5が現実に静止状態であれば、検出された加速度に基づいてコントローラ5の姿勢が重力方向に対して傾いているか否かまたはどの程度傾いているかを知ることができる。具体的には、加速度センサ37の検出軸が鉛直下方向を向いている状態を基準としたとき、1G(重力加速度)がかかっているか否かによって、コントローラ5が基準に対して傾いているか否かを知ることができるし、その大きさによって基準に対してどの程度傾いているかも知ることができる。また、多軸の加速度センサ37の場合には、さらに各軸の加速度の信号に対して処理を施すことによって、重力方向に対してコントローラ5がどの程度傾いているかをより詳細に知ることができる。この場合において、プロセッサは、加速度センサ37からの出力に基づいてコントローラ5の傾斜角度を算出してもよいし、当該傾斜角度を算出せずに、コントローラ5の傾斜方向を算出するようにしてもよい。このように、加速度センサ37をプロセッサと組み合わせて用いることによって、コントローラ5の傾斜角度または姿勢を判定することができる。   In addition, based on the acceleration signal output from the acceleration sensor 37, a computer such as a processor (for example, the CPU 10) of the game apparatus 3 or a processor (for example, the microcomputer 42) of the controller 5 performs processing, whereby further information regarding the controller 5 is obtained. Those skilled in the art will be able to easily understand from the description of the present specification that can be estimated or calculated (determined). For example, when processing on the computer side is executed on the assumption that the controller 5 on which the acceleration sensor 37 is mounted is stationary (that is, the processing is executed assuming that the acceleration detected by the acceleration sensor is only gravitational acceleration). When the controller 5 is actually stationary, it can be determined whether or not the attitude of the controller 5 is inclined with respect to the direction of gravity based on the detected acceleration. Specifically, whether or not the controller 5 is inclined with respect to the reference depending on whether or not 1G (gravity acceleration) is applied, based on the state in which the detection axis of the acceleration sensor 37 is directed vertically downward. It is possible to know how much it is inclined with respect to the reference according to its size. Further, in the case of the multi-axis acceleration sensor 37, it is possible to know in detail how much the controller 5 is inclined with respect to the direction of gravity by further processing the acceleration signal of each axis. . In this case, the processor may calculate the tilt angle of the controller 5 based on the output from the acceleration sensor 37, or may calculate the tilt direction of the controller 5 without calculating the tilt angle. Good. Thus, by using the acceleration sensor 37 in combination with the processor, the tilt angle or posture of the controller 5 can be determined.

一方、コントローラ5が動的な状態(コントローラ5が動かされている状態)であることを前提とする場合には、加速度センサ37は重力加速度に加えてコントローラ5の動きに応じた加速度を検出するので、検出された加速度から重力加速度の成分を所定の処理により除去することによってコントローラ5の動き方向を知ることができる。また、コントローラ5が動的な状態であることを前提とする場合であっても、検出された加速度から、加速度センサの動きに応じた加速度の成分を所定の処理により除去することによって、重力方向に対するコントローラ5の傾きを知ることが可能である。なお、他の実施例では、加速度センサ37は、内蔵の加速度検出手段で検出された加速度信号をマイコン42に出力する前に当該加速度信号に対して所定の処理を行うための、組込み式の処理装置または他の種類の専用の処理装置を備えていてもよい。組込み式または専用の処理装置は、例えば、加速度センサ37が静的な加速度(例えば、重力加速度)を検出するために用いられる場合、加速度信号を傾斜角(あるいは、他の好ましいパラメータ)に変換するものであってもよい。   On the other hand, when it is assumed that the controller 5 is in a dynamic state (a state in which the controller 5 is moved), the acceleration sensor 37 detects an acceleration corresponding to the movement of the controller 5 in addition to the gravitational acceleration. Therefore, the movement direction of the controller 5 can be known by removing the gravitational acceleration component from the detected acceleration by a predetermined process. Even if it is assumed that the controller 5 is in a dynamic state, the direction of gravity is obtained by removing the acceleration component corresponding to the movement of the acceleration sensor from the detected acceleration by a predetermined process. It is possible to know the inclination of the controller 5 with respect to. In another embodiment, the acceleration sensor 37 is a built-in process for performing a predetermined process on the acceleration signal before outputting the acceleration signal detected by the built-in acceleration detection means to the microcomputer 42. An apparatus or other type of dedicated processing apparatus may be provided. A built-in or dedicated processing device converts the acceleration signal into a tilt angle (or other preferred parameter) if, for example, the acceleration sensor 37 is used to detect static acceleration (eg, gravitational acceleration). It may be a thing.

通信部36は、マイコン42、メモリ43、無線モジュール44、およびアンテナ45を含んでいる。マイコン42は、処理を行う際にメモリ43を記憶領域として用いながら、マイコン42が取得したデータをゲーム装置3へ無線送信する無線モジュール44を制御する。また、マイコン42はコネクタ33に接続されている。ジャイロセンサユニット7から送信されてくるデータは、コネクタ33を介してマイコン42に入力される。以下、ジャイロセンサユニット7の構成について説明する。   The communication unit 36 includes a microcomputer 42, a memory 43, a wireless module 44, and an antenna 45. The microcomputer 42 controls the wireless module 44 that wirelessly transmits data acquired by the microcomputer 42 to the game apparatus 3 while using the memory 43 as a storage area when performing processing. The microcomputer 42 is connected to the connector 33. Data transmitted from the gyro sensor unit 7 is input to the microcomputer 42 via the connector 33. Hereinafter, the configuration of the gyro sensor unit 7 will be described.

ジャイロセンサユニット7は、プラグ53、マイコン54、2軸ジャイロセンサ55、および1軸ジャイロセンサ56を備えている。上述のように、ジャイロセンサユニット7は、3軸(本実施形態では、XYZ軸)周りの角速度を検出し、検出した角速度を示すデータ(角速度データ)をコントローラ5へ送信する。   The gyro sensor unit 7 includes a plug 53, a microcomputer 54, a 2-axis gyro sensor 55, and a 1-axis gyro sensor 56. As described above, the gyro sensor unit 7 detects angular velocities around the three axes (in this embodiment, the XYZ axes), and transmits data (angular velocity data) indicating the detected angular velocities to the controller 5.

2軸ジャイロセンサ55は、X軸周りの角速度およびY軸周りの(単位時間あたりの)角速度を検出する。また、1軸ジャイロセンサ56は、Z軸周りの(単位時間あたりの)角速度を検出する。なお、本明細書では、コントローラ5の撮像方向(Z軸正方向)を基準として、XYZ軸周りの回転方向を、それぞれ、ロール方向、ピッチ方向、ヨー方向と呼ぶ。すなわち、2軸ジャイロセンサ55は、ロール方向(X軸周りの回転方向)およびピッチ方向(Y軸周りの回転方向)の角速度を検出し、1軸ジャイロセンサ56は、ヨー方向(Z軸周りの回転方向)の角速度を検出する。   The biaxial gyro sensor 55 detects an angular velocity around the X axis and an angular velocity (per unit time) around the Y axis. The single axis gyro sensor 56 detects an angular velocity (per unit time) around the Z axis. In this specification, the rotation directions around the XYZ axes are referred to as a roll direction, a pitch direction, and a yaw direction, respectively, with reference to the imaging direction (Z axis positive direction) of the controller 5. That is, the biaxial gyro sensor 55 detects angular velocities in the roll direction (rotation direction around the X axis) and the pitch direction (rotation direction around the Y axis), and the single axis gyro sensor 56 detects the yaw direction (around the Z axis). Detect the angular velocity in the rotation direction.

なお、本実施形態では、3軸回りの角速度を検出するために、2軸ジャイロセンサ55と1軸ジャイロセンサ56とを用いる構成としたが、他の実施形態においては、3軸回りの角速度を検出することができればよく、用いるジャイロセンサの数および組み合わせはどのようなものであってもよい。   In this embodiment, the 2-axis gyro sensor 55 and the 1-axis gyro sensor 56 are used to detect the angular velocity around the three axes. However, in other embodiments, the angular velocity around the three axes is Any number and combination of gyro sensors may be used as long as they can be detected.

また、本実施形態では、後述する姿勢算出処理における計算を容易にする目的で、各ジャイロセンサ55および56が角速度を検出する3つの軸は、加速度センサ37が加速度を検出する3つの軸(XYZ軸)と一致するように設定される。ただし、他の実施形態においては、各ジャイロセンサ56および57が角速度を検出する3つの軸と、加速度センサ37が加速度を検出する3つの軸とは一致しなくてもよい。   Further, in the present embodiment, for the purpose of facilitating the calculation in the posture calculation process described later, the three axes where the gyro sensors 55 and 56 detect the angular velocity are the three axes (XYZ) where the acceleration sensor 37 detects the acceleration. Axis). However, in other embodiments, the three axes for detecting the angular velocities by the gyro sensors 56 and 57 and the three axes for detecting the acceleration by the acceleration sensor 37 may not coincide with each other.

各ジャイロセンサ56および57で検出された角速度を示すデータは、マイコン54に出力される。したがって、マイコン54には、XYZ軸の3軸回りの角度速度を示すデータが入力されることになる。マイコン54は、上記3軸回りの角速度を示すデータを角速度データとしてプラグ53を介してコントローラ5へ送信する。なお、マイコン54からコントローラ5への送信は所定の周期毎に逐次行われるが、ゲームの処理は1/60秒を単位として(1フレーム時間として)行われることが一般的であるので、この時間以下の周期で送信を行うことが好ましい。   Data indicating the angular velocity detected by each of the gyro sensors 56 and 57 is output to the microcomputer 54. Accordingly, the microcomputer 54 receives data indicating the angular velocity around the three axes of the XYZ axes. The microcomputer 54 transmits data indicating the angular velocities around the three axes as angular velocity data to the controller 5 via the plug 53. Although transmission from the microcomputer 54 to the controller 5 is sequentially performed every predetermined cycle, since the game processing is generally performed in units of 1/60 seconds (one frame time), this time Transmission is preferably performed in the following cycle.

コントローラ5の説明に戻り、操作部32、撮像情報演算部35、および加速度センサ37からマイコン42へ出力されたデータ、ならびに、ジャイロセンサユニット7からマイコン42へ送信されてきたデータは、一時的にメモリ43に格納される。これらのデータは、上記操作データとしてゲーム装置3へ送信される。すなわち、マイコン42は、ゲーム装置3の無線コントローラモジュール19への送信タイミングが到来すると、メモリ43に格納されている操作データを無線モジュール44へ出力する。無線モジュール44は、例えばBluetooth(ブルートゥース)(登録商標)の技術を用いて、所定周波数の搬送波を操作データで変調し、その微弱電波信号をアンテナ45から放射する。つまり、操作データは、無線モジュール44で微弱電波信号に変調されてコントローラ5から送信される。微弱電波信号はゲーム装置3側の無線コントローラモジュール19で受信される。受信された微弱電波信号について復調や復号を行うことによって、ゲーム装置3は操作データを取得することができる。そして、ゲーム装置3のCPU10は、取得した操作データとゲームプログラムとに基づいて、ゲーム処理を行う。なお、通信部36から無線コントローラモジュール19への無線送信は所定の周期毎に逐次行われるが、ゲームの処理は1/60秒を単位として(1フレーム時間として)行われることが一般的であるので、この時間以下の周期で送信を行うことが好ましい。コントローラ5の通信部36は、例えば1/200秒に1回の割合で各操作データをゲーム装置3の無線コントローラモジュール19へ出力する。   Returning to the description of the controller 5, the data output from the operation unit 32, the imaging information calculation unit 35, and the acceleration sensor 37 to the microcomputer 42 and the data transmitted from the gyro sensor unit 7 to the microcomputer 42 are temporarily stored. Stored in the memory 43. These data are transmitted to the game apparatus 3 as the operation data. That is, the microcomputer 42 outputs the operation data stored in the memory 43 to the wireless module 44 when the transmission timing to the wireless controller module 19 of the game apparatus 3 arrives. The wireless module 44 modulates a carrier wave of a predetermined frequency with operation data using, for example, Bluetooth (registered trademark) technology, and radiates a weak radio signal from the antenna 45. That is, the operation data is modulated by the wireless module 44 into a weak radio signal and transmitted from the controller 5. The weak radio signal is received by the wireless controller module 19 on the game apparatus 3 side. By demodulating and decoding the received weak radio signal, the game apparatus 3 can acquire operation data. And CPU10 of the game device 3 performs a game process based on the acquired operation data and a game program. Note that the wireless transmission from the communication unit 36 to the wireless controller module 19 is sequentially performed at predetermined intervals, but the game processing is generally performed in units of 1/60 seconds (one frame time). Therefore, it is preferable to perform transmission at a period equal to or shorter than this time. The communication unit 36 of the controller 5 outputs each operation data to the wireless controller module 19 of the game apparatus 3 at a rate of once every 1/200 seconds, for example.

上記コントローラ5を用いることによって、プレイヤは、各操作ボタンを押下する従来の一般的なゲーム操作に加えて、コントローラ5を任意の傾斜角度に傾ける操作を行うことができる。その他、上記コントローラ5によれば、プレイヤは、コントローラ5によって画面上の任意の位置を指示する操作、および、コントローラ5自体を動かす操作を行うこともできる。   By using the controller 5, the player can perform an operation of tilting the controller 5 to an arbitrary tilt angle in addition to the conventional general game operation of pressing each operation button. In addition, according to the controller 5, the player can also perform an operation of instructing an arbitrary position on the screen by the controller 5 and an operation of moving the controller 5 itself.

[姿勢算出処理の概要]
次に、ゲーム装置3において実行される、入力装置8の姿勢を算出する姿勢算出処理の概要を説明する。本実施形態では、入力装置8を用いてカヌーを漕ぐゲーム操作を行うゲームを想定する。すなわち、本実施形態では、ゲーム装置3は、プレイヤが入力装置8をパドルのようにして用いて、パドルで水を掻くように入力装置8を動かすことで、仮想のゲーム空間内のパドルを動かしてカヌーを漕ぐゲームを実行するものとする。より具体的には、ゲーム装置3は、入力装置8の姿勢を算出し、ゲーム空間内のパドルの姿勢を入力装置8の姿勢に応じて変化させる。
[Outline of posture calculation processing]
Next, an outline of a posture calculation process for calculating the posture of the input device 8 executed in the game apparatus 3 will be described. In the present embodiment, a game is assumed in which a game operation for rowing a canoe is performed using the input device 8. That is, in the present embodiment, the game apparatus 3 moves the paddle in the virtual game space by moving the input apparatus 8 so that the player uses the input apparatus 8 as a paddle and scratches water with the paddle. And a canoeing game is executed. More specifically, the game device 3 calculates the posture of the input device 8 and changes the posture of the paddle in the game space according to the posture of the input device 8.

本実施形態では、ゲーム装置3は、ジャイロセンサ55および56と、加速度センサ37と、撮像手段(撮像素子40)とを備えた入力装置8から操作データを取得し、入力装置8の姿勢を算出する。なお、本実施形態では、入力装置8は、ジャイロセンサ55および56と、加速度センサ37と、撮像素子40とを備える構成とするが、他の実施形態においては、ジャイロセンサと加速度センサとを少なくとも備える構成であればよい。   In the present embodiment, the game apparatus 3 acquires operation data from the input device 8 including the gyro sensors 55 and 56, the acceleration sensor 37, and the imaging means (imaging element 40), and calculates the attitude of the input device 8. To do. In the present embodiment, the input device 8 includes the gyro sensors 55 and 56, the acceleration sensor 37, and the image sensor 40. However, in another embodiment, the input device 8 includes at least the gyro sensor and the acceleration sensor. Any configuration may be used.

ゲーム装置3は、ジャイロセンサ55および56が検出する角速度に基づいて入力装置8の姿勢を算出する。以下では、当該角速度に基づいて算出される入力装置8の姿勢を、「第1の姿勢」と呼ぶ。第1の姿勢は、ジャイロセンサ55および56の検出結果に生じる誤差が原因で、実際の姿勢とは異なるおそれがある。そこで、本実施形態では、ゲーム装置3は、加速度センサ37によって検出される加速度を用いて、上記第1の姿勢を補正する。また、撮像素子40によって撮像される画像(撮像画像)を用いて、第1の姿勢を補正する。   The game apparatus 3 calculates the attitude of the input apparatus 8 based on the angular velocity detected by the gyro sensors 55 and 56. Hereinafter, the posture of the input device 8 calculated based on the angular velocity is referred to as a “first posture”. The first posture may be different from the actual posture due to an error generated in the detection results of the gyro sensors 55 and 56. Therefore, in the present embodiment, the game apparatus 3 corrects the first posture using the acceleration detected by the acceleration sensor 37. Further, the first posture is corrected using an image (captured image) captured by the image sensor 40.

以下、図8〜図12を参照して、加速度センサ37が検出する加速度を用いた補正処理の概要について説明する。ゲーム装置3は、上記ジャイロセンサ55および56が検出する角速度から入力装置8の姿勢を算出することができる他、加速度センサ37が検出する加速度からも入力装置8の姿勢を算出することができる。すなわち、加速度センサ37は入力装置8に加えられる重力加速度を検出する(加速度センサ37が検出する加速度には重力加速度が含まれる)ので、ゲーム装置3は、検出される加速度を用いて、入力装置8を基準にした重力方向、すなわち、重力方向に対する入力装置8の傾き(姿勢)を算出することができる。以下では、加速度センサ37が検出する加速度に基づいて算出される姿勢を、「第2の姿勢」と呼ぶ。本実施形態では、上記角速度に基づく第1の姿勢は、上記加速度から算出される重力方向(第2の姿勢)を用いて補正される。   Hereinafter, the outline of the correction process using the acceleration detected by the acceleration sensor 37 will be described with reference to FIGS. The game apparatus 3 can calculate the attitude of the input device 8 from the angular velocities detected by the gyro sensors 55 and 56, and can also calculate the attitude of the input apparatus 8 from the acceleration detected by the acceleration sensor 37. That is, since the acceleration sensor 37 detects the gravitational acceleration applied to the input device 8 (the acceleration detected by the acceleration sensor 37 includes the gravitational acceleration), the game device 3 uses the detected acceleration to input the input device. The gravity direction based on 8, that is, the inclination (posture) of the input device 8 with respect to the gravity direction can be calculated. Hereinafter, the posture calculated based on the acceleration detected by the acceleration sensor 37 is referred to as a “second posture”. In the present embodiment, the first posture based on the angular velocity is corrected using the gravity direction (second posture) calculated from the acceleration.

ここで、本実施形態では、ゲーム装置3は、上記加速度を用いた補正として、静的補正処理と、動的補正処理と、長期平均補正処理という3種類の補正処理を行う。静的補正処理は、角速度に基づいて算出される重力方向を、上記加速度の方向へ第1の度合で近づくように補正する処理である。静的補正処理は、入力装置8が主に静止しているまたは静止状態に近い場合に入力装置8の第1の姿勢を補正することを目的とした補正処理である。動的補正処理は、入力装置8が所定の運動を行う場合における、加速度と角速度との予め定義された関係から推定される重力方向へ第2の度合で近づくように上記重力方向を補正する処理である。動的補正処理は、入力装置8が主に動いている場合に入力装置8の第1の姿勢を補正することを目的とした補正処理である。本実施形態では、静的補正処理および動的補正処理の2種類の補正を行うことによって、入力装置8が静止している場合と動いている場合との両方の状況で、加速度を用いた補正を可能としている。また、長期平均補正処理は、所定期間(数秒程度の期間)における加速度の平均の方向へ第3の度合で近づくように上記重力方向を補正する処理である。長期平均補正処理は、入力装置8の運動状態(静止しているか動いているか)に依らずに補正を行う処理である。この長期平均補正によって、上記静的補正処理および動的補正処理による補正が行われない場合であっても、第1の姿勢を補正することができる。以下、静的補正処理、動的補正処理、および長期補正処理の概要について説明する。   Here, in the present embodiment, the game apparatus 3 performs three types of correction processing, that is, static correction processing, dynamic correction processing, and long-term average correction processing, as correction using the acceleration. The static correction process is a process of correcting the gravity direction calculated based on the angular velocity so as to approach the acceleration direction in a first degree. The static correction process is a correction process for correcting the first posture of the input device 8 when the input device 8 is mainly stationary or close to a stationary state. The dynamic correction process is a process of correcting the gravity direction so as to approach the gravity direction estimated from a predefined relationship between acceleration and angular velocity in a second degree when the input device 8 performs a predetermined motion. It is. The dynamic correction process is a correction process aimed at correcting the first posture of the input device 8 when the input device 8 is mainly moving. In the present embodiment, correction using acceleration is performed in both cases where the input device 8 is stationary and moving by performing two types of correction, static correction processing and dynamic correction processing. Is possible. The long-term average correction process is a process of correcting the gravity direction so as to approach the average direction of acceleration in a predetermined period (a period of several seconds) at a third degree. The long-term average correction process is a process for correcting the input device 8 regardless of the movement state (whether it is stationary or moving). With this long-term average correction, the first posture can be corrected even when correction by the static correction process and the dynamic correction process is not performed. Hereinafter, an outline of the static correction process, the dynamic correction process, and the long-term correction process will be described.

まず、静的補正処理について図8および図9を用いて説明する。図8は、入力装置8に関する重力ベクトルおよび検出加速度ベクトルを示す図である。図8に示す重力ベクトルVgは、入力装置8を基準とした(入力装置8から見た)重力方向を表す。当該重力方向は、空間に設定される鉛直下方向であるので、上記角速度に基づいて第1の姿勢が算出されれば、当該姿勢に対応して入力装置8を基準とした重力方向が算出できる。また、図8に示す検出加速度ベクトルVaは、加速度センサ37が検出した加速度の向きを表す。なお、図8に示すベクトルVzは、入力装置8のコントローラ座標系(XYZ座標系)におけるZ軸正方向、すなわち、入力装置8の姿勢を表すベクトルである。   First, the static correction process will be described with reference to FIGS. FIG. 8 is a diagram showing a gravity vector and a detected acceleration vector related to the input device 8. A gravity vector Vg shown in FIG. 8 represents the direction of gravity with respect to the input device 8 (viewed from the input device 8). Since the gravity direction is a vertically downward direction set in the space, if the first posture is calculated based on the angular velocity, the gravity direction based on the input device 8 can be calculated corresponding to the posture. . A detected acceleration vector Va shown in FIG. 8 represents the direction of acceleration detected by the acceleration sensor 37. A vector Vz shown in FIG. 8 is a vector representing the Z-axis positive direction in the controller coordinate system (XYZ coordinate system) of the input device 8, that is, the attitude of the input device 8.

図8において、入力装置8が静止またはほぼ静止している状態である場合、検出加速度ベクトルVaは重力方向を表すと推測することができる。したがって、この場合、ゲーム装置3は、角速度から算出された重力ベクトルVgを、より正確に重力方向を表すと推測される検出加速度ベクトルVaを用いて補正する。図9は、静的補正処理における重力ベクトルVgの補正を示す図である。図9においては、ベクトルVgは補正前の重力ベクトルを示し、ベクトルVg’は補正後の重力ベクトルを示す。図9に示すように、本実施形態においては、補正前の重力ベクトルVgは、検出加速度ベクトルVaに近づく方向へ補正される。これによって、重力ベクトルがより正確に重力方向を表すように補正されたことになり、補正された重力ベクトルを用いて入力装置8の第1の姿勢を補正することによって姿勢を正確に算出することができる。   In FIG. 8, when the input device 8 is stationary or almost stationary, it can be estimated that the detected acceleration vector Va represents the direction of gravity. Therefore, in this case, the game apparatus 3 corrects the gravity vector Vg calculated from the angular velocity using the detected acceleration vector Va that is estimated to represent the direction of gravity more accurately. FIG. 9 is a diagram illustrating correction of the gravity vector Vg in the static correction process. In FIG. 9, a vector Vg indicates a gravity vector before correction, and a vector Vg ′ indicates a gravity vector after correction. As shown in FIG. 9, in the present embodiment, the gravity vector Vg before correction is corrected in a direction approaching the detected acceleration vector Va. Thus, the gravity vector is corrected so as to more accurately represent the direction of gravity, and the posture is accurately calculated by correcting the first posture of the input device 8 using the corrected gravity vector. Can do.

なお、詳細は後述するが、静的補正処理において重力ベクトルVgが検出加速度ベクトルVaに近づく度合は、入力装置8が静止状態に近いほど大きくなる。つまり、本実施形態においては、検出加速度ベクトルVaが重力方向を表すものとして信頼できる場合ほど、重力ベクトルVgが検出加速度ベクトルVaに近くなるように補正される。これによれば、入力装置8の姿勢をより正確に算出することができる。また、本実施形態においては、入力装置8が静止状態からかけ離れている(激しく動かされている)場合には、静的補正処理における補正が行われない。これによっても、入力装置8の姿勢をより正確に算出することができる。   Although details will be described later, the degree to which the gravity vector Vg approaches the detected acceleration vector Va in the static correction processing increases as the input device 8 approaches the stationary state. That is, in the present embodiment, the gravity vector Vg is corrected so as to be closer to the detected acceleration vector Va as the detected acceleration vector Va can be trusted to represent the direction of gravity. According to this, the attitude of the input device 8 can be calculated more accurately. In the present embodiment, when the input device 8 is far from the stationary state (moved violently), the correction in the static correction process is not performed. Also by this, the attitude of the input device 8 can be calculated more accurately.

なお、入力装置8が静止しているか、あるいはほぼ静止している場合には、加速度センサ37が検出する加速度には重力加速度のみが含まれるので、上記静的補正処理によって重力方向を正確に算出することができる。一方、入力装置8がプレイヤによって動かされている場合には、重力加速度だけでなく、入力装置8の運動に起因する加速度が加速度センサ37によって検出される。例えば、加速度センサ37が検出する加速度には、遠心力等の慣性力による加速度が含まれる。そのため、入力装置8が動いている場合には、加速度センサ37の出力をそのまま用いても重力方向を正確に判断することができず、上記静的補正処理によって重力方向を正確に算出することができないおそれがある。また、入力装置8が動いている場合には上記静的補正処理を実行しないようにする方法も考えられる。しかし、この方法では、例えば上記カヌーのゲームの場合のように、プレイヤが入力装置8を絶えず動かしてゲーム操作を行うことが想定される場合には、上記静的補正処理が実行される機会が無く、重力方向の補正処理が実行されないことになる。その結果、入力装置8の姿勢を正確に算出することができない。以上のように、静的補正処理のみでは、入力装置8が動いている場合に対応することができない可能性がある。そこで、本実施形態では、入力装置8が動いている場合にも重力方向の補正処理を行うことを可能にするべく、静的補正処理に加えて、動的補正処理を行うものとする。以下、動的補正処理について図10〜図12を用いて説明する。   Note that when the input device 8 is stationary or almost stationary, the acceleration detected by the acceleration sensor 37 includes only the gravitational acceleration, so the gravitational direction is accurately calculated by the static correction process. can do. On the other hand, when the input device 8 is being moved by the player, the acceleration sensor 37 detects not only the gravitational acceleration but also the acceleration caused by the movement of the input device 8. For example, the acceleration detected by the acceleration sensor 37 includes acceleration due to inertial force such as centrifugal force. Therefore, when the input device 8 is moving, the gravity direction cannot be accurately determined even if the output of the acceleration sensor 37 is used as it is, and the gravity direction can be accurately calculated by the static correction process. It may not be possible. Further, a method is also conceivable in which the static correction process is not executed when the input device 8 is moving. However, in this method, for example, in the case of the canoe game, when it is assumed that the player performs the game operation by constantly moving the input device 8, there is an opportunity to execute the static correction process. In other words, the gravity direction correction process is not executed. As a result, the attitude of the input device 8 cannot be calculated accurately. As described above, only the static correction process may not be able to cope with the case where the input device 8 is moving. Therefore, in the present embodiment, in order to enable correction processing in the direction of gravity even when the input device 8 is moving, dynamic correction processing is performed in addition to static correction processing. Hereinafter, the dynamic correction process will be described with reference to FIGS.

図10は、入力装置8に関する重力ベクトル、検出加速度ベクトル、および運動加速度ベクトルを示す図である。図10に示す運動加速度ベクトルVAは、入力装置8の運動加速度を表すベクトルである。ここで「運動加速度」とは、入力装置8の運動により入力装置8に加えられる加速度のことであり、入力装置8が回転運動を行っている場合に生じる遠心力による加速度や、入力装置8が速度変化を伴って運動している場合に生じる慣性力による加速度を含む。運動加速度ベクトルVAは、加速度センサ37が検出した加速度から、重力加速度を除いた加速度のベクトルとして算出される。すなわち、運動加速度ベクトルVAは、上記検出加速度ベクトルVaから上記重力ベクトルVgを引いたベクトルである。このように、運動加速度ベクトルVAは、重力ベクトルVgから決まるベクトルである。重力ベクトルVgは角速度に基づく第1の姿勢から算出されるものであるので、運動加速度ベクトルVAについては重力ベクトルVgと同様に、ジャイロセンサ55および56の誤検出等の原因で実際の値に比べて誤差が生じるおそれがある。   FIG. 10 is a diagram illustrating a gravity vector, a detected acceleration vector, and a motion acceleration vector related to the input device 8. A motion acceleration vector VA shown in FIG. 10 is a vector representing the motion acceleration of the input device 8. Here, the “motion acceleration” is acceleration applied to the input device 8 by the movement of the input device 8, and acceleration due to centrifugal force generated when the input device 8 performs rotational motion, It includes acceleration due to inertial force that occurs when exercising with speed changes. The motion acceleration vector VA is calculated as an acceleration vector obtained by removing the gravitational acceleration from the acceleration detected by the acceleration sensor 37. That is, the motion acceleration vector VA is a vector obtained by subtracting the gravity vector Vg from the detected acceleration vector Va. Thus, the motion acceleration vector VA is a vector determined from the gravity vector Vg. Since the gravity vector Vg is calculated from the first posture based on the angular velocity, the motion acceleration vector VA is compared with the actual value due to erroneous detection of the gyro sensors 55 and 56 as in the gravity vector Vg. May cause errors.

図11は、入力装置8に関する角速度ベクトルおよび運動加速度ベクトルを示す図である。図11に示す角速度ベクトルVωは、ジャイロセンサ55および56が検出する角速度で入力装置8が回転するときの回転軸を表し、ジャイロセンサ55および56の検出結果から得ることができる。ここで、入力装置8が特定の運動を行う場合には、ジャイロセンサ55および56が検出する角速度と運動加速度との間には所定の関係が成立する。ここで、本実施形態のようにプレイヤがパドルで水を掻くように入力装置8を動かす場合には、入力装置8は所定位置を中心とした回転運動を行うと考えられる。入力装置8を動かす運動は、プレイヤの肘、肩等の関節を中心とした回転運動であることが多いので、回転運動と見なすことができる(常に回転運動を行うとは限らないが、少なくとも一部の期間では回転運動を行う)。詳細は後述するが、入力装置8が例えば等角速度で回転運動を行う場合には、角速度に対応する回転軸(角速度ベクトルVω)と、入力装置8の運動加速度とが直交する関係が成立する。したがって、図11においては、運動加速度は、ベクトルVA’のように、角速度ベクトルVωと垂直になるべきであるとの推定が成り立つ。例えば、入力装置8が、コントローラ座標系のY軸正方向が鉛直上向きとなる姿勢で、Y軸方向に平行な軸を回転軸として、X軸負方向に向かって回転移動する回転運動を行っている(図10〜図12に示す矢印参照)ものとすれば、運動加速度は、ベクトルVA’のようにY軸方向に垂直な向きになると推定される。   FIG. 11 is a diagram showing an angular velocity vector and a motion acceleration vector related to the input device 8. An angular velocity vector Vω shown in FIG. 11 represents a rotation axis when the input device 8 rotates at an angular velocity detected by the gyro sensors 55 and 56, and can be obtained from the detection results of the gyro sensors 55 and 56. Here, when the input device 8 performs a specific motion, a predetermined relationship is established between the angular velocity detected by the gyro sensors 55 and 56 and the motion acceleration. Here, when the input device 8 is moved so that the player scratches the water with a paddle as in the present embodiment, the input device 8 is considered to perform a rotational motion around a predetermined position. The movement of moving the input device 8 is often a rotational movement centered on the joints of the player's elbows, shoulders, etc., and can therefore be regarded as a rotational movement (although it does not always perform a rotational movement, at least one During the part period, it performs rotational movement). Although details will be described later, for example, when the input device 8 performs a rotational motion at a constant angular velocity, a relationship in which the rotation axis corresponding to the angular velocity (angular velocity vector Vω) and the motion acceleration of the input device 8 are orthogonal is established. Therefore, in FIG. 11, it is estimated that the motion acceleration should be perpendicular to the angular velocity vector Vω as in the vector VA ′. For example, the input device 8 performs a rotational motion that rotates in the negative direction of the X axis with the axis parallel to the Y axis direction as the rotation axis in a posture in which the positive direction of the Y axis of the controller coordinate system is vertically upward. (See the arrows shown in FIGS. 10 to 12), the motion acceleration is estimated to be in a direction perpendicular to the Y-axis direction as a vector VA ′.

動的補正処理では、ゲーム装置3は、上記の推定を用いて重力ベクトルVgを補正する。図12は、動的補正処理における重力ベクトルの補正を示す図である。図12に示すように、ゲーム装置3は、入力装置8の現在の角速度(図11に示す角速度ベクトルVω)に対して上記関係を満たす運動加速度(ベクトルVA’)へと運動加速度ベクトルVAを近づける方向へ重力ベクトルVgを補正する。換言すれば、動的補正処理では、加速度センサ37の検出結果である検出加速度ベクトルVaから算出される運動加速度(ベクトルVA)を、ジャイロセンサ55および56の検出結果である角速度ベクトルVωから決められる運動加速度(ベクトルVA’)へと近づけるように、重力ベクトルVgが補正される。   In the dynamic correction process, the game apparatus 3 corrects the gravity vector Vg using the above estimation. FIG. 12 is a diagram showing the correction of the gravity vector in the dynamic correction process. As shown in FIG. 12, the game apparatus 3 brings the motion acceleration vector VA closer to the motion acceleration (vector VA ′) that satisfies the above relationship with the current angular velocity of the input device 8 (angular velocity vector Vω shown in FIG. 11). The gravity vector Vg is corrected in the direction. In other words, in the dynamic correction process, the motion acceleration (vector VA) calculated from the detected acceleration vector Va that is the detection result of the acceleration sensor 37 is determined from the angular velocity vector Vω that is the detection result of the gyro sensors 55 and 56. The gravity vector Vg is corrected so as to approach the motion acceleration (vector VA ′).

以上のように、動的補正処理では、入力装置8が特定の運動(ここでは、等角速度の回転運動)を行うものとして、当該運動を行う場合における角速度と運動加速度との関係(ここでは、「運動加速度ベクトルVAが角速度ベクトルVωと垂直になる」という関係)を予め定義しておく。そして、運動加速度ベクトルVAが当該関係を満たすように、運動加速度ベクトルVAの算出元である重力ベクトルVgを補正する。これによって、入力装置8が動かされている場合であっても、加速度センサ37が検出した加速度を用いて重力方向を補正することができる。   As described above, in the dynamic correction process, it is assumed that the input device 8 performs a specific motion (here, a rotational motion at a uniform angular velocity), and the relationship between the angular velocity and the motion acceleration in the case of performing the motion (here, The relationship “the motion acceleration vector VA is perpendicular to the angular velocity vector Vω”) is defined in advance. Then, the gravity vector Vg that is the calculation source of the motion acceleration vector VA is corrected so that the motion acceleration vector VA satisfies the relationship. Thereby, even when the input device 8 is moved, the direction of gravity can be corrected using the acceleration detected by the acceleration sensor 37.

次に、長期平均補正処理について説明する。上述のように、加速度センサ37によって検出される加速度には、重力加速度と運動加速度が含まれる。ここで、入力装置8が静止状態から移動を始め、移動を終えて再び静止するまでの期間において、運動加速度の総和は“0”になると考えられる。したがって、ある程度の長い期間において検出加速度の総和を計算すれば、その期間中における運動加速度は相殺されて“0”になる結果、総和としては重力加速度の成分のみが残される。静止状態から静止状態までの間の期間でなくとも、ある程度の長期間の総和であれば、運動加速度の大部分は相殺されているので、相殺されなかった部分についての影響を無視することができる。そのため、上記期間における検出加速度の平均は、重力加速度を表すことになる。以上より、本実施形態では、ゲーム装置3は、検出加速度ベクトルの長期平均(ここでは、約8秒間の平均)のベクトルを算出し、算出されたベクトルを重力方向を表すものとして用いて補正を行う。すなわち、ゲーム装置3は、上記重力ベクトルVgを、算出されたベクトルの方向へと近づける補正を行う。この補正は、入力装置8が静止しているか動いているかにかかわらず常に行うことが可能である。   Next, the long-term average correction process will be described. As described above, the acceleration detected by the acceleration sensor 37 includes gravity acceleration and motion acceleration. Here, it is considered that the sum of motion acceleration becomes “0” in the period from when the input device 8 starts to move from a stationary state to when the input device 8 finishes moving and then stops again. Therefore, if the sum of the detected accelerations is calculated in a certain long period, the motion acceleration during that period is canceled and becomes “0”, so that only the gravitational acceleration component remains as the sum. Even if it is not the period between the resting state and the resting state, the sum of the acceleration for a certain period of time will cancel most of the motion acceleration, so the influence on the part that has not been cancelled can be ignored. . For this reason, the average of the detected accelerations in the above period represents the gravitational acceleration. As described above, in the present embodiment, the game apparatus 3 calculates a long-term average (here, an average of about 8 seconds) of detected acceleration vectors, and uses the calculated vector as a gravity direction for correction. Do. That is, the game apparatus 3 performs correction to bring the gravity vector Vg closer to the calculated vector direction. This correction can always be performed regardless of whether the input device 8 is stationary or moving.

本実施形態では、ゲーム装置3は、上記静的補正処理、動的補正処理、および長期平均補正処理という3つの補正処理によって補正された重力ベクトルVgを用いて入力装置8の第1の姿勢を補正する。すなわち、第1の姿勢を、上記3つの補正処理によって補正された重力ベクトルVgに対応する姿勢(第2の姿勢)へと近づける補正を行う。本実施形態によれば、入力装置8が静止している場合には静的補正処理によって、入力装置8が動いている場合には動的補正処理によって、それぞれ重力ベクトルが補正され、補正された重力ベクトルを用いて第1の姿勢が補正される。したがって、入力装置8が静止している場合でも動かされている場合でも、入力装置8の第1の姿勢を補正することができ、入力装置8の姿勢を正確に算出することができる。本実施形態では、入力装置8が動かされている場合でも姿勢を補正することができるので、プレイヤが入力装置8を常に動かすような操作が想定される場合に特に有効である。さらに、本実施形態では、ゲーム装置3は、入力装置8の運動状態に依らず常に行うことが可能な長期平均補正処理を実行するので、上記静的補正処理が適切に行えない場合であっても、第1の姿勢を確実にある程度補正することができる。また、上記動的補正処理が適切に行えない場合であっても、第1の姿勢を確実にある程度補正することができる。それゆえ、上記静的補正処理と動的補正処理のいずれも適切に行うことができない場合であっても、長期平均補正処理を行うことである程度補正をすることができる。   In the present embodiment, the game apparatus 3 changes the first posture of the input device 8 using the gravity vector Vg corrected by the three correction processes of the static correction process, the dynamic correction process, and the long-term average correction process. to correct. That is, the first posture is corrected so as to approach the posture corresponding to the gravity vector Vg corrected by the three correction processes (second posture). According to the present embodiment, the gravity vector is corrected and corrected by static correction processing when the input device 8 is stationary and by dynamic correction processing when the input device 8 is moving. The first posture is corrected using the gravity vector. Therefore, regardless of whether the input device 8 is stationary or moved, the first posture of the input device 8 can be corrected, and the posture of the input device 8 can be accurately calculated. In the present embodiment, the posture can be corrected even when the input device 8 is being moved, which is particularly effective when an operation in which the player always moves the input device 8 is assumed. Furthermore, in the present embodiment, the game apparatus 3 executes a long-term average correction process that can always be performed regardless of the motion state of the input device 8, and therefore, the static correction process cannot be performed appropriately. However, the first posture can be corrected to some extent with certainty. Even when the dynamic correction process cannot be performed properly, the first posture can be reliably corrected to some extent. Therefore, even if neither the static correction process nor the dynamic correction process can be performed appropriately, the correction can be made to some extent by performing the long-term average correction process.

なお、本実施形態においては、加速度センサ37が検出した加速度を用いた補正処理の後、撮像素子40によって撮像される画像(撮像画像)を用いた補正処理が実行される。撮像画像を用いた補正処理では、ゲーム装置3は、まず撮像画像に基づいて入力装置8の姿勢を算出する。すなわち、撮像画像内におけるマーカの画像の位置(マーカ座標)から入力装置8の姿勢を算出する。以下では、撮像画像に基づいて算出される入力装置8の姿勢を、「第3の姿勢」と呼ぶ。次に、ゲーム装置3は、上記角速度に基づく第1の姿勢を、撮像画像から算出された第3の姿勢へと近づける補正を行う。また、本実施形態においては、ゲーム装置3は、加速度に基づく補正処理を先に行い、撮像画像に基づく補正処理を後に行うこととするが、他の実施形態においては、加速度に基づく補正処理と撮像画像に基づく補正処理とのいずれを先に行うようにしてもよい。   In the present embodiment, after the correction process using the acceleration detected by the acceleration sensor 37, the correction process using the image (captured image) captured by the image sensor 40 is executed. In the correction process using the captured image, the game apparatus 3 first calculates the attitude of the input device 8 based on the captured image. That is, the attitude of the input device 8 is calculated from the position of the marker image (marker coordinates) in the captured image. Hereinafter, the posture of the input device 8 calculated based on the captured image is referred to as a “third posture”. Next, the game apparatus 3 performs a correction to bring the first posture based on the angular velocity closer to the third posture calculated from the captured image. In the present embodiment, the game apparatus 3 performs the correction process based on the acceleration first and the correction process based on the captured image later. However, in the other embodiments, the game apparatus 3 performs the correction process based on the acceleration. Any of the correction processing based on the captured image may be performed first.

以上のように、本実施形態によれば、ジャイロセンサ55および56によって検知された角速度から算出される入力装置8の第1の姿勢を、加速度センサ37によって検知された加速度を用いて補正し、また、撮像手段による撮像画像を用いて補正する。これによって、ジャイロセンサから算出される姿勢の誤差を減少することができ、入力装置8の姿勢をより正確に算出することができる。   As described above, according to the present embodiment, the first posture of the input device 8 calculated from the angular velocities detected by the gyro sensors 55 and 56 is corrected using the acceleration detected by the acceleration sensor 37. Moreover, it correct | amends using the captured image by an imaging means. Thereby, the error of the attitude calculated from the gyro sensor can be reduced, and the attitude of the input device 8 can be calculated more accurately.

なお、加速度センサ37の検出結果からは、重力方向を軸とした回転(ヨー方向の回転)を検知することはできないので、加速度に基づく補正処理では、ヨー方向に関しては補正を行うことができない。しかし、加速度に基づく補正処理は、入力装置8の姿勢がどのような姿勢であっても(常に加速度を検出することができるので)可能であるという特長を有する。一方、入力装置8の撮像方向にマーカ部6がなければマーカ座標が検出されないので、撮像画像に基づく補正処理は、入力装置8の姿勢によっては行うことができない。しかし、撮像画像に基づく補正処理は、姿勢(特にロール方向の姿勢)を正確に算出することができるという特長を有する。本実施形態においては、このように特長の異なる2種類の補正を行うことによって、入力装置8の姿勢をより正確に算出することができる。   In addition, from the detection result of the acceleration sensor 37, it is impossible to detect rotation (rotation in the yaw direction) with the gravity direction as an axis. Therefore, in the correction processing based on acceleration, correction in the yaw direction cannot be performed. However, the correction processing based on the acceleration has a feature that the posture of the input device 8 can be any posture (since the acceleration can always be detected). On the other hand, if the marker unit 6 is not present in the imaging direction of the input device 8, marker coordinates are not detected, and therefore correction processing based on the captured image cannot be performed depending on the attitude of the input device 8. However, the correction processing based on the captured image has a feature that the posture (particularly the posture in the roll direction) can be accurately calculated. In the present embodiment, the posture of the input device 8 can be calculated more accurately by performing two types of corrections having different features as described above.

なお、他の実施形態においては、ゲーム装置3は、撮像画像を用いた補正処理を実行しなくてもよい。この場合、入力装置8は、撮像情報演算部35を備えていない構成であってもよい。   In other embodiments, the game apparatus 3 may not execute the correction process using the captured image. In this case, the input device 8 may be configured not to include the imaging information calculation unit 35.

[ゲーム装置3における処理の詳細]
次に、ゲーム装置3において実行される処理の詳細について説明する。まず、ゲーム装置3における処理において用いられる主なデータについて図13を用いて説明する。図13は、ゲーム装置3のメインメモリ(外部メインメモリ12または内部メインメモリ11e)に記憶される主なデータを示す図である。図13に示すように、ゲーム装置3のメインメモリには、ゲームプログラム60、操作データ62、およびゲーム処理用データ67が記憶される。なお、メインメモリには、図13に示すデータの他、ゲームに登場する各種オブジェクトの画像データや、オブジェクトの各種パラメータを示すデータ等、ゲーム処理に必要なデータが記憶される。
[Details of processing in game device 3]
Next, details of processing executed in the game apparatus 3 will be described. First, main data used in the processing in the game apparatus 3 will be described with reference to FIG. FIG. 13 is a diagram illustrating main data stored in the main memory (the external main memory 12 or the internal main memory 11e) of the game apparatus 3. As shown in FIG. 13, a game program 60, operation data 62, and game processing data 67 are stored in the main memory of the game apparatus 3. In addition to the data shown in FIG. 13, the main memory stores data necessary for game processing, such as image data of various objects appearing in the game and data indicating various parameters of the objects.

ゲームプログラム60は、ゲーム装置3に電源が投入された後の適宜のタイミングで光ディスク4からその一部または全部が読み込まれてメインメモリに記憶される。ゲームプログラム60には、姿勢算出プログラム61が含まれる。姿勢算出プログラム61は、入力装置8の姿勢を算出するための姿勢算出処理を実行するためのプログラムである。   A part or all of the game program 60 is read from the optical disc 4 and stored in the main memory at an appropriate timing after the game apparatus 3 is turned on. The game program 60 includes a posture calculation program 61. The attitude calculation program 61 is a program for executing an attitude calculation process for calculating the attitude of the input device 8.

操作データ62は、コントローラ5からゲーム装置3へ送信されてくる操作データである。上述したように、コントローラ5からゲーム装置3へ1/200秒に1回の割合で操作データが送信されるので、メインメモリに記憶される操作データ62はこの割合で更新される。   The operation data 62 is operation data transmitted from the controller 5 to the game apparatus 3. As described above, since the operation data is transmitted from the controller 5 to the game apparatus 3 at a rate of once every 1/200 seconds, the operation data 62 stored in the main memory is updated at this rate.

操作データ62には、角速度データ63、加速度データ64、マーカ座標データ65、および操作ボタンデータ66が含まれる。角速度データ63は、ジャイロセンサユニット7のジャイロセンサ55および56によって検出された角速度を示すデータである。ここでは、角速度データ63は、図3に示すXYZ座標系の3軸回りのそれぞれの角速度を示す。3軸周りの角速度(時計回り)のそれぞれの大きさを3次元のベクトルとして表すと、角速度データ63は、回転面に垂直な方向を向き(より具体的には、右ネジを角速度の方向へ回転させた場合における右ネジの進行方向を向き)、その大きさが角速度ωの大きさを表す角速度ベクトルVωを示す。なお、本実施形態では、入力装置8の角加速度を算出するために、最後に取得された操作データの前に取得された操作データに含まれる角速度データが角速度履歴データとしてメインメモリに記憶される。   The operation data 62 includes angular velocity data 63, acceleration data 64, marker coordinate data 65, and operation button data 66. The angular velocity data 63 is data indicating angular velocities detected by the gyro sensors 55 and 56 of the gyro sensor unit 7. Here, the angular velocity data 63 indicates the respective angular velocities around the three axes of the XYZ coordinate system shown in FIG. If the magnitudes of the angular velocities (clockwise) around the three axes are expressed as a three-dimensional vector, the angular velocity data 63 is oriented in a direction perpendicular to the plane of rotation (more specifically, the right screw is directed in the direction of angular velocity). The direction of the right screw in the case of rotation is pointed), and the magnitude thereof represents an angular velocity vector Vω representing the magnitude of the angular velocity ω. In the present embodiment, in order to calculate the angular acceleration of the input device 8, the angular velocity data included in the operation data acquired before the last acquired operation data is stored in the main memory as the angular velocity history data. .

加速度データ64は、加速度センサ37によって検出された加速度(検出加速度ベクトル)を示すデータである。ここでは、加速度データ64は、図3に示すXYZの3軸の方向に関する加速度を各成分とする3次元の加速度ベクトルを示す。また、本実施形態においては、コントローラ5が静止している状態で加速度センサ37が検出する加速度ベクトルの大きさを“1”とする。つまり、加速度センサ37によって検出される重力加速度の大きさは“1”である。   The acceleration data 64 is data indicating the acceleration (detected acceleration vector) detected by the acceleration sensor 37. Here, the acceleration data 64 indicates a three-dimensional acceleration vector having each component of acceleration in the directions of the three axes of XYZ shown in FIG. In the present embodiment, the magnitude of the acceleration vector detected by the acceleration sensor 37 while the controller 5 is stationary is “1”. That is, the magnitude of gravitational acceleration detected by the acceleration sensor 37 is “1”.

マーカ座標データ65は、撮像情報演算部35の画像処理回路41によって算出される座標、すなわち上記マーカ座標を示すデータである。マーカ座標は、撮像画像に対応する平面上の位置を表すための2次元座標系(図17に示すx’y’座標系)で表現される。なお、撮像素子40によって2つのマーカ6Rおよび6Lが撮像される場合には、2つのマーカ座標が算出される。一方、撮像素子40の撮像可能な範囲内にマーカ6Rおよび6Lのいずれか一方が位置しない場合には、撮像素子40によって1つのマーカのみが撮像され、1つのマーカ座標のみが算出される。また、撮像素子40の撮像可能な範囲内にマーカ6Rおよび6Lの両方が位置しない場合には、撮像素子40によってマーカが撮像されず、マーカ座標は算出されない。したがって、マーカ座標データ65は、2つのマーカ座標を示す場合もあるし、1つのマーカ座標を示す場合もあるし、マーカ座標がないことを示す場合もある。   The marker coordinate data 65 is data indicating coordinates calculated by the image processing circuit 41 of the imaging information calculation unit 35, that is, the marker coordinates. The marker coordinates are expressed in a two-dimensional coordinate system (x′y ′ coordinate system shown in FIG. 17) for representing a position on a plane corresponding to the captured image. Note that, when the two markers 6R and 6L are imaged by the imaging element 40, two marker coordinates are calculated. On the other hand, if either one of the markers 6R and 6L is not located within the imageable range of the image sensor 40, only one marker is imaged by the image sensor 40, and only one marker coordinate is calculated. Further, when both of the markers 6R and 6L are not located within the image capturing range of the image sensor 40, the marker is not imaged by the image sensor 40, and the marker coordinates are not calculated. Therefore, the marker coordinate data 65 may indicate two marker coordinates, may indicate one marker coordinate, or may indicate that there is no marker coordinate.

操作ボタンデータ66は、各操作ボタン32a〜32iに対する入力状態を示すデータである。   The operation button data 66 is data indicating an input state for each of the operation buttons 32a to 32i.

ゲーム処理用データ67は、後述するゲーム処理(図14)において用いられるデータである。ゲーム処理用データ67は、第1姿勢データ68、重力方向データ69、加速度大きさデータ70、加加速度データ71、第1補正度データ72、第2補正度データ73、運動加速度データ74、重力補正ベクトルデータ75、補正行列データ76、加速度履歴データ77、ブロック平均データ78、全平均データ79、ロール姿勢成分データ80、ヨー姿勢成分データ81、ピッチ姿勢成分データ82、および第3姿勢データ83を含む。なお、図13に示すデータの他、ゲーム処理用データ67は、ゲーム処理において用いられる各種データ(ゲームパラメータを示すデータ等)を含む。   The game process data 67 is data used in a game process (FIG. 14) described later. The game processing data 67 includes first posture data 68, gravity direction data 69, acceleration magnitude data 70, jerk data 71, first correction degree data 72, second correction degree data 73, motion acceleration data 74, gravity correction. Vector data 75, correction matrix data 76, acceleration history data 77, block average data 78, total average data 79, roll attitude component data 80, yaw attitude component data 81, pitch attitude component data 82, and third attitude data 83 are included. . In addition to the data shown in FIG. 13, the game processing data 67 includes various data (data indicating game parameters, etc.) used in the game processing.

第1姿勢データ68は、角速度データ63を用いて算出される入力装置8の上記第1の姿勢を示すデータである。本実施形態では、入力装置8の姿勢は、以下の式(1)に示す3×3の行列M1で表現される。

Figure 0005630969
上記行列M1は、所定の基準姿勢から現在の入力装置8の姿勢への回転を表す回転行列である。以下では、上記第1の姿勢を示す行列M1を、「第1姿勢行列M1」と呼ぶ。なお、第1姿勢行列M1により表される姿勢は、入力装置8が存在する空間の所定位置を基準としたxyz座標系(上記空間座標系)における姿勢である。ここでは、xyz座標系は、入力装置8がマーカ部6の正面に位置することを前提とし、入力装置8の位置からマーカ部6を向く方向をz軸正方向とし、鉛直上向き(重力方向の逆方向)をy軸正方向とし、入力装置8の位置からマーカ部6を向いた場合の左方向をx軸正方向とした座標系であるとする。また、上記所定の基準姿勢は、マーカ部6の正面に位置する入力装置8の撮像方向がマーカ部6の中央を向き、かつ、コントローラ5のボタン面が鉛直上向きとなる姿勢(すなわち、入力装置8を基準としたX軸、Y軸、Z軸が、それぞれx軸、y軸、z軸の向きと一致する姿勢)であるとする。したがって、回転行列M1は、入力装置8のX軸、Y軸、Z軸の向きを示す単位ベクトルを、それぞれxyz座標系で示したものを並べたものでもある。なお、本実施形態では、行列を用いて入力装置8の姿勢を表現することとしたが、他の実施形態においては、入力装置8の姿勢は、3次のベクトルまたは3つの角度によって表現されてもよい。また、入力装置8の姿勢は、空間に対して固定される座標系(xyz座標系)で表現されてもよいし、入力装置8に対して固定される座標系(XYZ座標系)で表現されてもよい。入力装置8の姿勢は、例えば、入力装置8に対して固定される座標系によって表現される、入力装置8に加わる重力方向を示す重力ベクトルによって表現されてもよい。 The first attitude data 68 is data indicating the first attitude of the input device 8 calculated using the angular velocity data 63. In the present embodiment, the attitude of the input device 8 is expressed by a 3 × 3 matrix M1 shown in the following equation (1).
Figure 0005630969
The matrix M1 is a rotation matrix representing the rotation from a predetermined reference posture to the current input device 8 posture. Hereinafter, the matrix M1 indicating the first posture is referred to as a “first posture matrix M1”. Note that the posture represented by the first posture matrix M1 is a posture in the xyz coordinate system (the spatial coordinate system) with reference to a predetermined position in the space where the input device 8 exists. Here, the xyz coordinate system is based on the premise that the input device 8 is located in front of the marker unit 6, and the direction from the input device 8 toward the marker unit 6 is the z-axis positive direction, and is vertically upward (in the gravitational direction). It is assumed that the coordinate system is such that the reverse direction) is the y-axis positive direction and the left direction when facing the marker unit 6 from the position of the input device 8 is the x-axis positive direction. The predetermined reference posture is a posture in which the imaging direction of the input device 8 located in front of the marker unit 6 faces the center of the marker unit 6 and the button surface of the controller 5 is vertically upward (that is, the input device). The X axis, the Y axis, and the Z axis with reference to 8 are postures that match the directions of the x axis, the y axis, and the z axis, respectively). Therefore, the rotation matrix M1 is also an array of unit vectors indicating the directions of the X-axis, Y-axis, and Z-axis of the input device 8 that are shown in the xyz coordinate system. In this embodiment, the posture of the input device 8 is expressed using a matrix. However, in other embodiments, the posture of the input device 8 is expressed by a cubic vector or three angles. Also good. Further, the attitude of the input device 8 may be expressed in a coordinate system (xyz coordinate system) fixed with respect to space, or expressed in a coordinate system (XYZ coordinate system) fixed with respect to the input device 8. May be. The posture of the input device 8 may be expressed by, for example, a gravity vector indicating a direction of gravity applied to the input device 8 expressed by a coordinate system fixed to the input device 8.

重力方向データ69は、入力装置8から見た重力方向、すなわち、上記重力ベクトルVgを示すデータである。重力ベクトルVgは、上記コントローラ座標系(XYZ座標系)における方向を表す単位ベクトルである。   The gravity direction data 69 is data indicating the gravity direction as viewed from the input device 8, that is, the gravity vector Vg. The gravity vector Vg is a unit vector that represents a direction in the controller coordinate system (XYZ coordinate system).

加速度大きさデータ70は、加速度データ64により示される検出加速度ベクトルVaの大きさ(長さ)Lを示すデータである。   The acceleration magnitude data 70 is data indicating the magnitude (length) L of the detected acceleration vector Va indicated by the acceleration data 64.

加加速度データ71は、入力装置8の加速度の単位時間あたりの変化量(加加速度)Jを示すデータである。本実施形態では、加加速度は、最後に算出された運動加速度ベクトルと、その前に算出された運動加速度ベクトルとの差として算出される。加加速度は3次元のベクトルとして算出可能であるが、本実施形態では加加速度の大きさのみを用いるので、加加速度データ71は、加加速度の大きさを示すスカラー量を示す。加加速度データ71は、後述する第1補正度Aおよび第2補正度Bを算出するために用いられる。   The jerk data 71 is data indicating a change amount (jerk) J per unit time of acceleration of the input device 8. In the present embodiment, the jerk is calculated as a difference between the motion acceleration vector calculated last and the motion acceleration vector calculated before that. Although the jerk can be calculated as a three-dimensional vector, since only the magnitude of the jerk is used in the present embodiment, the jerk data 71 indicates a scalar quantity indicating the magnitude of the jerk. The jerk data 71 is used to calculate a first correction degree A and a second correction degree B, which will be described later.

第1補正度データ72は、静的補正処理によって上記重力ベクトルVgを補正する度合(第1補正度A)を示すデータである。また、第2補正度データ73は、動的補正処理によって上記重力ベクトルVgを補正する度合(第2補正度B)を示す。詳細は後述するが、各補正度の値が大きいほど補正量は大きくなる。   The first correction degree data 72 is data indicating the degree of correction of the gravity vector Vg (first correction degree A) by static correction processing. The second correction degree data 73 indicates the degree to which the gravity vector Vg is corrected by the dynamic correction process (second correction degree B). Although details will be described later, the correction amount increases as the value of each correction degree increases.

運動加速度データ74は、上記運動加速度ベクトルVAを示すデータである。運動加速度ベクトルVAは、重力ベクトルVgと同様、上記コントローラ座標系(XYZ座標系)における方向を表すベクトルである。運動加速度ベクトルVAは、上記加速度データ64および重力方向データ69に基づいて算出される。   The motion acceleration data 74 is data indicating the motion acceleration vector VA. Similar to the gravity vector Vg, the motion acceleration vector VA is a vector representing a direction in the controller coordinate system (XYZ coordinate system). The motion acceleration vector VA is calculated based on the acceleration data 64 and the gravity direction data 69.

重力補正ベクトルデータ75は、上記動的補正処理において重力ベクトルを補正するために用いられる重力補正ベクトルΔVgを示すデータである。詳細は後述するが、動的補正処理による補正後の重力ベクトルは、補正前の重力ベクトルに重力補正ベクトルΔVgを加算した方向を向く。   The gravity correction vector data 75 is data indicating a gravity correction vector ΔVg used for correcting the gravity vector in the dynamic correction process. Although details will be described later, the gravity vector after the correction by the dynamic correction process is directed in a direction obtained by adding the gravity correction vector ΔVg to the gravity vector before the correction.

補正行列データ76は、補正行列Maを示すデータである。補正行列Maは、加速度に基づく補正処理において、入力装置8の第1の姿勢を補正するために用いられる回転行列である。つまり、上記補正処理においては、上記第1姿勢行列M1に補正行列Maを掛けることで第1の姿勢が補正される。   The correction matrix data 76 is data indicating the correction matrix Ma. The correction matrix Ma is a rotation matrix used for correcting the first posture of the input device 8 in the correction process based on acceleration. That is, in the correction process, the first posture is corrected by multiplying the first posture matrix M1 by the correction matrix Ma.

加速度履歴データ77は、加速度データ64の履歴を示すデータである。本実施形態では、新しいものから順に最大40個の検出加速度ベクトルを示すデータが加速度履歴データ77としてメインメモリに記憶される(図22参照)。なお、上述した長期平均補正処理においては検出加速度ベクトルの所定期間(ここでは約8秒間)の平均を算出する。詳細は後述するが、本実施形態では、CPU10は所定期間内の複数の検出加速度ベクトルをブロックにまとめて管理する。そのため、ゲーム装置3は、所定期間内の複数の検出加速度ベクトルをすべて履歴として保存(記憶)する必要はなく、最大40個(約0.2秒間分)の検出加速度ベクトルを保存する。   The acceleration history data 77 is data indicating the history of the acceleration data 64. In the present embodiment, data indicating a maximum of 40 detected acceleration vectors in order from the newest is stored in the main memory as acceleration history data 77 (see FIG. 22). In the above-described long-term average correction process, the average of the detected acceleration vector for a predetermined period (here, about 8 seconds) is calculated. Although details will be described later, in the present embodiment, the CPU 10 collectively manages a plurality of detected acceleration vectors within a predetermined period. Therefore, the game apparatus 3 does not need to store (store) all of the plurality of detected acceleration vectors within a predetermined period as a history, and stores up to 40 detected acceleration vectors (for about 0.2 seconds).

ブロック平均データ78は、検出加速度ベクトルの1ブロック分の平均のベクトル(ブロック平均ベクトル)を示すデータである。ここで、本実施形態では、上記所定期間における検出加速度ベクトルの平均を算出する処理に必要な計算量およびメモリ領域を低減するべく、CPU10は、所定期間内の複数の検出加速度ベクトルをブロックにまとめて管理する。具体的には、CPU10は、40個の検出加速度ベクトルを1つのブロックとしてまとめて管理する。ブロック平均ベクトルは、1つのブロックに含まれる40個の検出加速度ベクトルの平均である。本実施形態では、1/200秒で1つの検出加速度ベクトルが取得されるので、ブロック平均ベクトルは、0.2秒間の検出加速度ベクトルの平均である。また、本実施形態では、約8秒間の検出加速度ベクトルの平均を算出するべく、40個(0.2秒×40=8秒となるため)のブロックの平均をメインメモリに記憶しておく。つまり、ブロック平均データ78は、40個のブロックに関する各ブロック平均ベクトルを示す(図22参照)。   The block average data 78 is data indicating an average vector (block average vector) for one block of the detected acceleration vector. Here, in the present embodiment, in order to reduce the calculation amount and the memory area necessary for the process of calculating the average of the detected acceleration vectors in the predetermined period, the CPU 10 collects a plurality of detected acceleration vectors in the predetermined period into blocks. Manage. Specifically, the CPU 10 collectively manages 40 detected acceleration vectors as one block. The block average vector is an average of 40 detected acceleration vectors included in one block. In this embodiment, since one detected acceleration vector is acquired in 1/200 seconds, the block average vector is an average of detected acceleration vectors for 0.2 seconds. In this embodiment, an average of 40 blocks (because 0.2 seconds × 40 = 8 seconds) is stored in the main memory in order to calculate an average of detected acceleration vectors for about 8 seconds. That is, the block average data 78 shows each block average vector regarding 40 blocks (refer FIG. 22).

全平均データ79は、上記所定期間内の検出加速度ベクトルの平均のベクトル(全平均ベクトル)を示すデータである。本実施形態では、全平均ベクトルは、ブロック平均データ78により示される40個のブロック平均ベクトルの平均として算出される。長期平均補正処理においては、上記全平均ベクトルによって決まる重力方向に基づいて、第1の姿勢に対応する重力方向が補正される。   The total average data 79 is data indicating an average vector (total average vector) of the detected acceleration vectors within the predetermined period. In the present embodiment, the total average vector is calculated as the average of 40 block average vectors indicated by the block average data 78. In the long-term average correction process, the gravity direction corresponding to the first posture is corrected based on the gravity direction determined by the total average vector.

ロール姿勢成分データ80は、撮像画像から算出される入力装置8の第3の姿勢に含まれる姿勢成分のうち、ロール方向に関する姿勢成分(ロール姿勢成分)M3rを示すデータである。また、ヨー姿勢成分データ81は、上記第3の姿勢に含まれる姿勢成分のうち、ヨー方向に関する姿勢成分(ヨー姿勢成分)M3yを示すデータであり、ピッチ姿勢成分データ82は、上記第3の姿勢に含まれる姿勢成分のうち、ピッチ方向に関する姿勢成分(ピッチ姿勢成分)M3pを示すデータである。なお、ここで言うロール方向、ヨー方向、およびピッチ方向とは、入力装置8の撮像方向(Z軸正方向)を基準とした場合の回転方向である。本実施形態においては、各姿勢成分M3r、M3y、およびM3pは、第1姿勢データ68により示される姿勢と同様、3×3の行列で表現される。   The roll posture component data 80 is data indicating a posture component (roll posture component) M3r related to the roll direction among the posture components included in the third posture of the input device 8 calculated from the captured image. The yaw posture component data 81 is data indicating a posture component (yaw posture component) M3y related to the yaw direction among posture components included in the third posture, and the pitch posture component data 82 is the third posture. Among the posture components included in the posture, this is data indicating a posture component (pitch posture component) M3p related to the pitch direction. Note that the roll direction, yaw direction, and pitch direction referred to here are rotation directions when the imaging direction (Z-axis positive direction) of the input device 8 is used as a reference. In the present embodiment, each of the posture components M3r, M3y, and M3p is expressed by a 3 × 3 matrix, similar to the posture indicated by the first posture data 68.

第3姿勢データ83は、上記第3の姿勢を示すデータである。本実施形態では、第3の姿勢は、第1の姿勢と同様、3×3の行列M3で表現される。後述するステップS6の補正処理では、上記行列M3が第1姿勢行列M1を補正するために用いられる。以下では、第3の姿勢を表す行列M3を「第3姿勢行列M3」と呼ぶ。本実施形態では、入力装置8から操作データとしてマーカ座標データが送信されてくるので、第3姿勢行列M3は、マーカ座標データ65に基づいて算出される。具体的には、第3姿勢行列M3は、上記各姿勢成分M3r、M3y、およびM3pを合成することによって得られる。   The third attitude data 83 is data indicating the third attitude. In the present embodiment, the third posture is represented by a 3 × 3 matrix M3, like the first posture. In the correction process in step S6 described later, the matrix M3 is used to correct the first posture matrix M1. Hereinafter, the matrix M3 representing the third posture is referred to as a “third posture matrix M3”. In the present embodiment, since the marker coordinate data is transmitted as operation data from the input device 8, the third posture matrix M <b> 3 is calculated based on the marker coordinate data 65. Specifically, the third posture matrix M3 is obtained by combining the posture components M3r, M3y, and M3p.

次に、ゲーム装置3において行われる処理の詳細を、図14〜図17を用いて説明する。図14は、ゲーム装置3において実行される処理の流れを示すメインフローチャートである。ゲーム装置3の電源が投入されると、ゲーム装置3のCPU10は、図示しないブートROMに記憶されている起動プログラムを実行し、これによってメインメモリ等の各ユニットが初期化される。そして、光ディスク4に記憶されたゲームプログラムがメインメモリに読み込まれ、CPU10によって当該ゲームプログラムの実行が開始される。図14に示すフローチャートは、以上の処理が完了した後に行われる処理を示すフローチャートである。   Next, details of processing performed in the game apparatus 3 will be described with reference to FIGS. FIG. 14 is a main flowchart showing the flow of processing executed in the game apparatus 3. When the power of the game apparatus 3 is turned on, the CPU 10 of the game apparatus 3 executes a startup program stored in a boot ROM (not shown), whereby each unit such as the main memory is initialized. Then, the game program stored on the optical disc 4 is read into the main memory, and the CPU 10 starts executing the game program. The flowchart shown in FIG. 14 is a flowchart showing processing performed after the above processing is completed.

まず、ステップS1において、CPU10は、ゲームに関する初期化処理を実行する。この初期化処理においては、ゲーム処理に用いられる各種パラメータの値が初期化されたり、仮想のゲーム空間が構築されたり、プレイヤオブジェクトや他のオブジェクトがゲーム空間の初期位置に配置されたりする。以上のステップS1の次にステップS2の処理が実行される。   First, in step S1, the CPU 10 executes an initialization process relating to the game. In this initialization process, the values of various parameters used in the game process are initialized, a virtual game space is constructed, and player objects and other objects are placed at initial positions in the game space. Following step S1, the process of step S2 is executed.

ステップS2において、CPU10は初期姿勢設定処理を実行する。具体的には、プレイヤが所定の操作(例えば、Aボタン32dを押下する操作)を行ったことに応じて、入力装置8の初期姿勢として所定の値が設定される。ここでは、基準となる姿勢は、Z軸が鉛直方向と平行となり、かつ、入力装置8の撮像方向がマーカ部6の中央(マーカ6Rおよび6Lの中央)を向く姿勢としているので、プレイヤは、初期姿勢が上記基準となる姿勢となるように入力装置8を把持した状態で、上記所定の操作を行うことが望ましいが、入力装置が静止状態に近く、かつマーカ部を撮像可能であれば、初期姿勢を算出することが可能である。CPU10は、所定の操作が行われると、上記初期姿勢を表す行列を示すデータを第1姿勢データ68としてメインメモリに記憶する。この時点での重力ベクトルである、空間座標系における重力方向(0,−1,0)を、コントローラ座標系で表したベクトル(−Xy,−Yy,−Zy)を示すデータを、重力方向データ69としてメインメモリに記憶する。以上のステップS2の後、ステップS3〜S8の処理ループが、ゲームが実行される間繰り返し実行される。なお、1回の当該処理ループは、1フレーム時間(例えば1/60秒)に1回の割合で実行される。   In step S2, the CPU 10 executes an initial posture setting process. Specifically, a predetermined value is set as the initial posture of the input device 8 in response to the player performing a predetermined operation (for example, an operation of pressing the A button 32d). Here, the reference posture is a posture in which the Z axis is parallel to the vertical direction and the imaging direction of the input device 8 faces the center of the marker unit 6 (the center of the markers 6R and 6L). It is desirable to perform the predetermined operation while holding the input device 8 so that the initial posture becomes the reference posture, but if the input device is close to a stationary state and the marker portion can be imaged, It is possible to calculate the initial posture. When a predetermined operation is performed, the CPU 10 stores data indicating a matrix representing the initial posture as first posture data 68 in the main memory. Data indicating the gravity vector (−Xy, −Yy, −Zy) representing the gravity direction (0, −1, 0) in the spatial coordinate system in the controller coordinate system, which is the gravity vector at this time, is the gravity direction data. 69 is stored in the main memory. After the above step S2, the processing loop of steps S3 to S8 is repeatedly executed while the game is executed. Note that one processing loop is executed once per frame time (for example, 1/60 seconds).

なお、本実施形態では、初期姿勢設定処理(ステップS2)は、ゲーム開始前(ステップS3〜S8の処理ループが実行される前)に1回実行されるのみであるとしたが、他の実施形態においては、ゲーム中における任意のタイミングで初期姿勢設定処理が実行されるようにしてもよい。すなわち、CPU10は、ゲーム中においてプレイヤが上記所定の操作を行ったことに応じて初期姿勢設定処理を実行するようにしてもよい。   In this embodiment, the initial posture setting process (step S2) is executed only once before the game starts (before the processing loop of steps S3 to S8 is executed). In the embodiment, the initial posture setting process may be executed at an arbitrary timing during the game. That is, the CPU 10 may execute the initial posture setting process in response to the player performing the predetermined operation during the game.

ステップS3において、CPU10は操作データを取得する。すなわち、コントローラ5から送信されてくる操作データが無線コントローラモジュール19を介して受信される。そして、受信された操作データに含まれる角速度データ、加速度データ、マーカ座標データ、操作ボタンデータがそれぞれメインメモリに記憶される。ステップS3の次にステップS4の処理が実行される。   In step S3, the CPU 10 acquires operation data. That is, operation data transmitted from the controller 5 is received via the wireless controller module 19. Then, angular velocity data, acceleration data, marker coordinate data, and operation button data included in the received operation data are stored in the main memory. Following step S3, the process of step S4 is executed.

ステップS4において、CPU10は、メインメモリに記憶されている角速度データ63に基づいて入力装置8の第1の姿勢(第1姿勢行列M1)を算出する。第1の姿勢を角速度から算出する方法はどのような方法であってもよいが、本実施形態においては、第1の姿勢は、前回の入力装置8の第1の姿勢(前回のステップS3〜S8の処理ループにおいて算出された姿勢)と、今回の角速度(今回の処理ループにおいて取得された角速度)とを用いて算出される。具体的には、CPU10は、メインメモリに記憶されている角速度データ63および第1姿勢データ68を読み出し、第1姿勢データ68により示される前回の姿勢と角速度データ63により示される今回の角速度とを取得する。そして、前回の姿勢を今回の角速度で単位時間分だけ回転させた姿勢を、新たな第1の姿勢とする。ステップS4で算出された姿勢(3×3の行列)を示すデータが、第1姿勢データ68としてメインメモリに新たに記憶される。上記ステップS4の次にステップS5の処理が実行される。   In step S4, the CPU 10 calculates the first attitude (first attitude matrix M1) of the input device 8 based on the angular velocity data 63 stored in the main memory. Any method may be used to calculate the first posture from the angular velocity. However, in the present embodiment, the first posture is the first posture of the previous input device 8 (previous step S3-3). The posture calculated in the processing loop of S8) and the current angular velocity (the angular velocity acquired in the current processing loop) are calculated. Specifically, the CPU 10 reads the angular velocity data 63 and the first posture data 68 stored in the main memory, and obtains the previous posture indicated by the first posture data 68 and the current angular velocity indicated by the angular velocity data 63. get. Then, a posture obtained by rotating the previous posture by a unit time at the current angular velocity is set as a new first posture. Data indicating the posture (3 × 3 matrix) calculated in step S4 is newly stored in the main memory as the first posture data 68. Following step S4, the process of step S5 is executed.

ステップS5において、CPU10は加速度に基づく補正処理を実行する。加速度に基づく補正処理は、加速度データを用いて入力装置8の第1の姿勢を補正する処理である。以下、図15を参照して、加速度に基づく補正処理の詳細を説明する。   In step S5, the CPU 10 executes a correction process based on the acceleration. The correction process based on acceleration is a process of correcting the first posture of the input device 8 using acceleration data. Hereinafter, the details of the correction process based on the acceleration will be described with reference to FIG.

図15は、図14に示す加速度に基づく補正処理(ステップS5)の流れを示すフローチャートである。加速度に基づく補正処理においては、まずステップS11において、CPU10は重力ベクトルVgを算出する。重力ベクトルVgは、前回のステップS3〜S8の処理ループで算出された重力ベクトルと、今回のステップS3〜S8の処理ループで取得された角速度とに基づいて算出される。具体的には、CPU10は、メインメモリに記憶されている角速度データ63および重力方向データ69を読み出し、角速度データ63により示される今回の角速度と重力方向データ69により示される前回の重力ベクトルとを取得する。そして、前回の重力ベクトルを、今回の角速度の回転方向とは逆方向に単位時間分だけ回転させることによって新たな重力ベクトルVgを算出する。新たに算出された重力ベクトルVgを示すデータが、新たな重力方向データ69としてメインメモリに記憶される。以上のステップS11の次にステップS12の処理が実行される。   FIG. 15 is a flowchart showing the flow of the correction process (step S5) based on the acceleration shown in FIG. In the correction process based on acceleration, first, in step S11, the CPU 10 calculates a gravity vector Vg. The gravity vector Vg is calculated based on the gravity vector calculated in the previous processing loop of steps S3 to S8 and the angular velocity acquired in the current processing loop of steps S3 to S8. Specifically, the CPU 10 reads the angular velocity data 63 and the gravity direction data 69 stored in the main memory, and acquires the current angular velocity indicated by the angular velocity data 63 and the previous gravity vector indicated by the gravity direction data 69. To do. Then, a new gravity vector Vg is calculated by rotating the previous gravity vector by a unit time in the direction opposite to the rotation direction of the current angular velocity. Data indicating the newly calculated gravity vector Vg is stored in the main memory as new gravity direction data 69. Following step S11, the process of step S12 is executed.

なお、本実施形態では、入力装置8の姿勢は上記空間座標系で表現されるのに対して、重力ベクトルは上記コントローラ座標系で表現されるので、空間座標系における入力装置8の姿勢が変化することによって空間座標系における重力ベクトルの方向が変化してしまう。つまり、今回の処理ループにおける上記ステップS4において新たな姿勢が算出されて姿勢が変化すると、姿勢の変化に応じて(実際には変化していない)重力ベクトルも変化してしまう。上記ステップS11の処理は、重力ベクトルを正しく表すために、入力装置8の姿勢の変化による重力ベクトルの変化をキャンセルするための処理である。   In the present embodiment, the orientation of the input device 8 is expressed in the spatial coordinate system, whereas the gravity vector is expressed in the controller coordinate system. Therefore, the orientation of the input device 8 in the spatial coordinate system changes. As a result, the direction of the gravity vector in the spatial coordinate system changes. That is, when a new posture is calculated in step S4 in the current processing loop and the posture changes, the gravity vector also changes in accordance with the change in the posture (which has not actually changed). The process in step S11 is a process for canceling a change in the gravity vector due to a change in the attitude of the input device 8 in order to correctly represent the gravity vector.

ステップS12においては、CPU10は、静的補正処理を実行する。入力装置8が主に静止している(または静止状態に近い)場合に入力装置8の第1の姿勢を補正する補正処理である。以下、図16を参照して、静的補正処理の詳細を説明する。   In step S12, the CPU 10 executes a static correction process. This is correction processing for correcting the first posture of the input device 8 when the input device 8 is mainly stationary (or close to a stationary state). The details of the static correction process will be described below with reference to FIG.

図16は、図15に示す静的補正処理(ステップS12)の流れを示すフローチャートである。静的補正処理においては、まずステップS21において、CPU10は、加速度センサ37によって検出された加速度の大きさLを算出する。すなわち、メインメモリに記憶されている加速度データ64を読み出し、当該加速度データ64により示される検出加速度ベクトルVaについて大きさLを算出する。算出された大きさLを示すデータは加速度大きさデータ70としてメインメモリに記憶される。ステップS21の次にステップS22の処理が実行される。   FIG. 16 is a flowchart showing the flow of the static correction process (step S12) shown in FIG. In the static correction process, first, in step S21, the CPU 10 calculates the magnitude L of the acceleration detected by the acceleration sensor 37. That is, the acceleration data 64 stored in the main memory is read, and the magnitude L is calculated for the detected acceleration vector Va indicated by the acceleration data 64. Data indicating the calculated magnitude L is stored as acceleration magnitude data 70 in the main memory. Following step S21, the process of step S22 is executed.

ステップS22において、CPU10は、静的補正処理において入力装置8の姿勢を補正する度合を示す上記第1補正度Aを算出する。第1補正度Aは、ステップS21で算出された検出加速度ベクトルVaの大きさLに基づいて算出される。具体的には、CPU10は、メインメモリに記憶されている加速度大きさデータ70を読み出す。そして、当該加速度大きさデータ70により示される大きさLを用いて、次の式(2)に従って第1補正度Aを算出する。
0≦|L−1|≦Rのとき、A=1−(|L−1|/R)
R<|L−1|のとき、A=0 …(2)
上式(2)において、定数Rは、予め定められており、例えばR=0.4に設定される。上式(2)は、検出加速度ベクトルVaの大きさLが重力加速度の大きさ(=1)に近いほど大きくなるように、第1補正度Aを算出する式である。つまり、上式(2)によって、検出加速度ベクトルVaの大きさLが重力加速度の大きさに近いほど、重力ベクトルの補正量が大きくなる。なお、他の実施形態においては、上記大きさLが1に近いほど大きい重みが付されるように、上式(2)で算出されるAをさらに2乗した値を第1補正度として用いてもよい。上式(2)で算出された第1補正度Aを示すデータは、第1補正度データ72としてメインメモリに記憶される。なお、ステップS22で算出された第1補正度Aは、最終的な値ではない演算中の値であって、以降のステップS23〜S26で値が修正されることによって、最終的な第1補正度Aの値が得られる。ステップS22の次にステップS23の処理が実行される。
In step S <b> 22, the CPU 10 calculates the first correction degree A indicating the degree of correcting the attitude of the input device 8 in the static correction process. The first correction degree A is calculated based on the magnitude L of the detected acceleration vector Va calculated in step S21. Specifically, the CPU 10 reads the acceleration magnitude data 70 stored in the main memory. Then, using the magnitude L indicated by the acceleration magnitude data 70, the first correction degree A is calculated according to the following equation (2).
When 0 ≦ | L−1 | ≦ R, A = 1− (| L−1 | / R)
When R <| L-1 |, A = 0 (2)
In the above equation (2), the constant R is predetermined, and is set to R = 0.4, for example. The above equation (2) is an equation for calculating the first correction degree A so that the magnitude L of the detected acceleration vector Va becomes larger as it approaches the magnitude of gravity acceleration (= 1). That is, according to the above equation (2), the correction amount of the gravity vector becomes larger as the magnitude L of the detected acceleration vector Va is closer to the magnitude of gravity acceleration. In another embodiment, a value obtained by further squaring A calculated by the above equation (2) is used as the first correction degree so that the weight is increased as the size L is closer to 1. May be. Data indicating the first correction degree A calculated by the above equation (2) is stored in the main memory as the first correction degree data 72. Note that the first correction degree A calculated in step S22 is a value that is not the final value being calculated, and the value is corrected in subsequent steps S23 to S26, so that the final first correction is performed. A value of degree A is obtained. Following step S22, the process of step S23 is executed.

ここで、入力装置8が動かされている状態では、重力加速度以外に、入力装置8が動かされることによって生じる慣性による加速度が加速度センサ37によって検出される。そのため、入力装置8が動かされている状態では、検出加速度ベクトルVaの大きさLが“1”とは異なる値となり、入力装置8が激しく動かされている場合ほど上記差が大きくなる傾向がある。また、入力装置8が激しく動かされている場合には、検出加速度ベクトルVaに重力加速度以外の成分(上記慣性による加速度の成分)が多く含まれているので、検出加速度ベクトルVaは、重力方向を示す値としては信頼できないものと推測される。つまり、上記差が大きいほど、検出加速度ベクトルVaは信頼できないものと考えられる。   Here, in a state where the input device 8 is moved, in addition to the gravitational acceleration, acceleration due to inertia caused by moving the input device 8 is detected by the acceleration sensor 37. Therefore, when the input device 8 is being moved, the magnitude L of the detected acceleration vector Va becomes a value different from “1”, and the difference tends to increase as the input device 8 is moved harder. . In addition, when the input device 8 is moved violently, the detected acceleration vector Va includes many components other than gravitational acceleration (the acceleration component due to inertia), so the detected acceleration vector Va indicates the direction of gravity. The value shown is assumed to be unreliable. That is, the detected acceleration vector Va is considered to be unreliable as the difference is larger.

そこで、本実施形態では、上記ステップS22により、検出加速度ベクトルVaの大きさLが重力加速度の大きさ(=1)に近いほど、重力ベクトルの補正量が大きくなるようにしている。また、検出加速度ベクトルの大きさLと重力加速度の大きさとの差が所定の基準(所定値R)よりも小さい場合にのみ補正が行われるようにしている。これによれば、検出加速度ベクトルVaが信頼できる場合ほど重力ベクトルが検出加速度ベクトルVaに近い値となり、また、検出加速度ベクトルVaの値が信頼できない場合には補正が行われない。このように、本実施形態によれば、検出加速度ベクトルVaの信頼度に応じて補正量が決まるので、重力ベクトルVgの補正量を当該信頼度に応じて適切に決定することができる。これによって、ゲーム装置3は、重力方向を正確に算出することができ、入力装置8の姿勢をより正確に算出することができる。   Therefore, in the present embodiment, the correction amount of the gravity vector is increased as the magnitude L of the detected acceleration vector Va is closer to the magnitude of gravity acceleration (= 1) in step S22. Further, the correction is performed only when the difference between the magnitude L of the detected acceleration vector and the magnitude of the gravitational acceleration is smaller than a predetermined reference (predetermined value R). According to this, as the detected acceleration vector Va is reliable, the gravity vector becomes closer to the detected acceleration vector Va, and when the detected acceleration vector Va is unreliable, no correction is performed. Thus, according to this embodiment, since the correction amount is determined according to the reliability of the detected acceleration vector Va, the correction amount of the gravity vector Vg can be appropriately determined according to the reliability. Thereby, the game apparatus 3 can calculate the gravity direction accurately, and can calculate the attitude of the input apparatus 8 more accurately.

ステップS23において、CPU10は、入力装置8の角速度に応じて第1補正度Aの値を修正する。具体的には、CPU10は、メインメモリに記憶されている角速度データ63および第1補正度データ72を読み出し、角速度データ63により示される角速度と第1補正度データ72により示される第1補正度Aとを取得する。そして、上記角速度を用いて、次の式(3)に従って修正後の第1補正度Aを算出する。
0≦|ω|≦T1のとき、A=A’×{1−(ω/T1)}
T1<|ω|のとき、A=0 …(3)
上式(3)において、定数T1は、予め定められており、例えば、T1=60[deg/sec]に設定される。また、変数ωは、角速度の大きさ、すなわち、角速度ベクトルVωの大きさである。上式(3)は、角速度が大きいほど第1補正度Aが小さくなるように、第1補正度Aを修正するものである。つまり、上式(3)によって、角速度が大きいほど、重力ベクトルの補正量が小さくなる。なお、他の実施形態においては、角速度が小さいほど大きい重みが付されるように、上式(3)における“{1−(ω/T1)}”を、“{1−(ω/T1)}”としてもよい。上式(3)で修正された第1補正度Aを示すデータは、第1補正度データ72としてメインメモリに記憶される。ステップS23の次にステップS24の処理が実行される。
In step S <b> 23, the CPU 10 corrects the value of the first correction degree A according to the angular velocity of the input device 8. Specifically, the CPU 10 reads the angular velocity data 63 and the first correction degree data 72 stored in the main memory, and the angular velocity indicated by the angular velocity data 63 and the first correction degree A indicated by the first correction degree data 72. And get. Then, using the angular velocity, a corrected first correction degree A is calculated according to the following equation (3).
When 0 ≦ | ω | ≦ T1, A = A ′ × {1− (ω / T1)}
When T1 <| ω |, A = 0 (3)
In the above equation (3), the constant T1 is determined in advance, and is set to T1 = 60 [deg / sec], for example. The variable ω is the magnitude of the angular velocity, that is, the magnitude of the angular velocity vector Vω. The above equation (3) is for correcting the first correction degree A so that the first correction degree A decreases as the angular velocity increases. That is, according to the above equation (3), the greater the angular velocity, the smaller the gravity vector correction amount. In another embodiment, “{1- (ω / T1)}” in the above equation (3) is replaced with “{1- (ω / T1)” so that a greater weight is applied as the angular velocity is smaller. } 2 ". Data indicating the first correction degree A corrected by the above equation (3) is stored in the main memory as the first correction degree data 72. Following step S23, the process of step S24 is executed.

ここで、入力装置8の角速度が大きい場合とは、入力装置8が激しく動かされている場合であると推測され、この場合、検出加速度ベクトルVaの値は、重力方向を示す値としては信頼できないものと推測される。逆に、角速度が小さい場合とは、入力装置8があまり動かされていない場合であると推測され、検出加速度ベクトルVaの値は信頼できると推測される。したがって、上記ステップS23によって、上記ステップS22と同様、検出加速度ベクトルVaが信頼できる場合(角速度が小さい場合)ほど、第1補正度Aの値が大きくなるように設定することができる。その結果、上記ステップS22の場合と同様、検出加速度ベクトルVaの信頼度に応じて補正量を適切に決定することができるので、重力方向および入力装置8の姿勢をより正確に算出することができる。   Here, the case where the angular velocity of the input device 8 is large is assumed to be a case where the input device 8 is moved violently. In this case, the value of the detected acceleration vector Va is not reliable as a value indicating the direction of gravity. Presumed to be. On the contrary, the case where the angular velocity is small is assumed to be a case where the input device 8 is not moved so much, and the value of the detected acceleration vector Va is estimated to be reliable. Therefore, as in step S22, the value of the first correction degree A can be set to be larger by the step S23 as the detected acceleration vector Va is reliable (when the angular velocity is small). As a result, since the correction amount can be appropriately determined according to the reliability of the detected acceleration vector Va as in the case of step S22, the gravity direction and the attitude of the input device 8 can be calculated more accurately. .

また、上記ステップS22では、入力装置8が動かされている度合(検出加速度ベクトルVaの信頼度)を、入力装置8の加速度に基づいて判断しているのに対して、上記ステップS23では、入力装置8の角速度に基づいて判断している。このように、ステップS22とは異なる変数で上記信頼度を判断するので、ステップS22で上記信頼度を正しく判断できない場合(例えば、入力装置8を動かしている場合において、検出加速度ベクトルVaの大きさが重力加速度の大きさと偶然等しくなる場合)でも、ステップS23によって上記信頼度を正しく判断することができる。   In step S22, the degree to which the input device 8 is moved (reliability of the detected acceleration vector Va) is determined based on the acceleration of the input device 8, whereas in step S23, the input is performed. The determination is based on the angular velocity of the device 8. As described above, since the reliability is determined using a variable different from that in step S22, when the reliability cannot be correctly determined in step S22 (for example, when the input device 8 is moving, the magnitude of the detected acceleration vector Va). Even if it is accidentally equal to the magnitude of gravitational acceleration), the reliability can be correctly determined in step S23.

ステップS24において、CPU10は、上記運動加速度ベクトルVAを算出する。上述のように、運動加速度ベクトルVAは、検出加速度ベクトルVaおよび重力ベクトルVgに基づいて算出される。具体的には、CPU10は、メインメモリに記憶されている加速度データ64および重力方向データ69を読み出し、加速度データ64により示される検出加速度ベクトルVaから、重力方向データ69により示される重力ベクトルVgを引くことによって、運動加速度ベクトルVAを算出する。算出された運動加速度ベクトルVAを示すデータは、運動加速度データ74としてメインメモリに記憶される。なお、本実施形態では、入力装置8の加加速度を算出するために、前回の処理ループで算出された運動加速度ベクトルVAを示すデータは、運動加速度履歴データとしてメインメモリに記憶される。ステップS24の次にステップS25の処理が実行される。   In step S24, the CPU 10 calculates the motion acceleration vector VA. As described above, the motion acceleration vector VA is calculated based on the detected acceleration vector Va and the gravity vector Vg. Specifically, the CPU 10 reads the acceleration data 64 and the gravity direction data 69 stored in the main memory, and subtracts the gravity vector Vg indicated by the gravity direction data 69 from the detected acceleration vector Va indicated by the acceleration data 64. Thus, the motion acceleration vector VA is calculated. Data indicating the calculated motion acceleration vector VA is stored in the main memory as motion acceleration data 74. In this embodiment, in order to calculate the jerk of the input device 8, data indicating the motion acceleration vector VA calculated in the previous processing loop is stored in the main memory as motion acceleration history data. Following step S24, the process of step S25 is executed.

ステップS25において、CPU10は、入力装置8の加加速度Jを算出する。加加速度Jは、今回の処理ループで算出された運動加速度ベクトルと、前回の処理ループで算出された運動加速度ベクトルとの差分として算出される。具体的には、CPU10は、メインメモリに記憶されている運動加速度データ74および上記運動加速度履歴データを読み出し、運動加速度データ74により示される運動加速度ベクトルから、運動加速度履歴データにより示される運動加速度ベクトルを引いたベクトルの大きさを加加速度(の大きさ)Jとして算出する。算出された加加速度を示すデータは、加加速度データ71としてメインメモリに記憶される。なお、他の実施形態においては、CPU10は、運動加速度ベクトルに代えて、加速度センサ37が検出した加速度ベクトルから加加速度を算出するようにしてもよい。すなわち、今回のステップS3−S8の処理ループにおいて取得された検出加速度ベクトルから、前回のステップS3−S8の処理ループにおいて取得された検出加速度ベクトルを引いたベクトルの大きさを加加速度(の大きさ)Jとして算出してもよい。ステップS25の次にステップS26の処理が実行される。   In step S <b> 25, the CPU 10 calculates a jerk J of the input device 8. The jerk J is calculated as a difference between the motion acceleration vector calculated in the current processing loop and the motion acceleration vector calculated in the previous processing loop. Specifically, the CPU 10 reads the motion acceleration data 74 and the motion acceleration history data stored in the main memory, and from the motion acceleration vector indicated by the motion acceleration data 74, the motion acceleration vector indicated by the motion acceleration history data. Is calculated as a jerk (magnitude) J. Data indicating the calculated jerk is stored as jerk data 71 in the main memory. In other embodiments, the CPU 10 may calculate the jerk from the acceleration vector detected by the acceleration sensor 37 instead of the motion acceleration vector. That is, the magnitude of a vector obtained by subtracting the detected acceleration vector acquired in the previous processing loop of steps S3-S8 from the detected acceleration vector acquired in the current processing loop of steps S3-S8 is the magnitude of the jerk (the magnitude of ) It may be calculated as J. Following step S25, the process of step S26 is executed.

ステップS26において、CPU10は、入力装置8の加加速度Jに応じて第1補正度Aの値を修正する。具体的には、CPU10は、メインメモリに記憶されている加加速度データ71および第1補正度データ72を読み出し、加加速度データ71により示される加加速度Jと第1補正度データ72により示される第1補正度Aとを取得する。そして、上記加加速度Jを用いて、次の式(4)に従って修正後の第1補正度Aを算出する。
0≦J≦U1のとき、A=A’×{1−(J/U1)}×C1
U1<Jのとき、A=0 …(4)
上式(4)において、定数U1は、予め定められており、例えば、U1=40[G/sec]に設定される。また、定数C1は、補正量を調整するために適宜設定され、例えば、C1=0.03に設定される。上式(4)は、加加速度Jが大きいほど第1補正度Aが小さくなるように、第1補正度Aを修正するものである。つまり、上式(4)によって、加加速度Jが大きいほど、重力ベクトルの補正量が小さくなる。なお、他の実施形態においては、加加速度Jが小さいほど大きい重みが付されるように、上式(4)における“{1−(J/U1)}”を、“{1−(J/U1)}”としてもよい。上式(4)で修正された第1補正度Aを示すデータは、第1補正度データ72としてメインメモリに記憶される。上記ステップS26によって、最終的な第1補正度Aが算出されたことになる。ステップS26の次にステップS27の処理が実行される。
In step S <b> 26, the CPU 10 corrects the value of the first correction degree A according to the jerk J of the input device 8. Specifically, the CPU 10 reads the jerk data 71 and the first correction degree data 72 stored in the main memory, and the jerk J indicated by the jerk data 71 and the first correction degree data 72 indicate the first correction degree data 72. 1 correction degree A is acquired. Then, using the jerk J, the corrected first correction degree A is calculated according to the following equation (4).
When 0 ≦ J ≦ U1, A = A ′ × {1- (J / U1)} × C1
When U1 <J, A = 0 (4)
In the above equation (4), the constant U1 is predetermined, and is set to U1 = 40 [G / sec], for example. The constant C1 is set as appropriate to adjust the correction amount, and is set to C1 = 0.03, for example. The above equation (4) corrects the first correction degree A so that the first correction degree A decreases as the jerk J increases. That is, according to the above equation (4), the greater the jerk J, the smaller the gravity vector correction amount. In other embodiments, “{1- (J / U1)}” in the above equation (4) is replaced with “{1- (J / U1)} 2 ". Data indicating the first correction degree A corrected by the above equation (4) is stored in the main memory as the first correction degree data 72. In step S26, the final first correction degree A is calculated. Following step S26, the process of step S27 is executed.

ここで、入力装置8の加加速度Jが大きい場合とは、入力装置8が激しく動かされている場合であると推測され、上述したように、検出加速度ベクトルVaの値が信頼できないものと推測される。逆に、上記加加速度Jが小さい場合とは、入力装置8があまり動かされていない場合であると推測され、検出加速度ベクトルVaの値が信頼できるものと推測される。したがって、上記ステップS26によって、上記ステップS22およびS23と同様、検出加速度ベクトルVaが信頼できる場合(加加速度Jが小さい場合)ほど、第1補正度Aの値を大きく設定することができる。その結果、上記ステップS22の場合と同様、検出加速度ベクトルVaの信頼度に応じて補正量を適切に決定することができるので、重力方向および入力装置8の姿勢をより正確に算出することができる。   Here, the case where the jerk J of the input device 8 is large is assumed to be a case where the input device 8 is moved violently, and as described above, the value of the detected acceleration vector Va is presumed to be unreliable. The Conversely, the case where the jerk J is small is assumed to be a case where the input device 8 is not moved so much, and the value of the detected acceleration vector Va is estimated to be reliable. Accordingly, the value of the first correction degree A can be set to be larger by the step S26 as the detected acceleration vector Va is reliable (when the jerk J is small), as in the steps S22 and S23. As a result, since the correction amount can be appropriately determined according to the reliability of the detected acceleration vector Va as in the case of step S22, the gravity direction and the attitude of the input device 8 can be calculated more accurately. .

また、上記ステップS26では、入力装置8が動かされている度合(検出加速度ベクトルVaの信頼度)を、上記ステップS22およびS23とは異なる変数である加加速度Jを用いて判断している。そのため、ステップS22およびS23で上記信頼度を正しく判断できずに第1補正度Aが大きい値のままになる場合(例えば、入力装置8が回転せずに平行移動している場合で、検出加速度ベクトルVaの大きさが重力加速度の大きさと偶然等しくなる場合)であっても、ステップS26の処理によって第1補正度Aを小さく変更することができるので、上記信頼度を正しく判断することができる。   In step S26, the degree to which the input device 8 is moved (the reliability of the detected acceleration vector Va) is determined using the jerk J, which is a variable different from steps S22 and S23. Therefore, when the reliability cannot be correctly determined in steps S22 and S23 and the first correction degree A remains a large value (for example, when the input device 8 moves in parallel without rotating, the detected acceleration Even when the magnitude of the vector Va coincides with the magnitude of the gravitational acceleration), the first correction degree A can be changed small by the processing of step S26, so that the reliability can be correctly determined. .

以上のように、本実施形態においては、ステップS22,S23,S26によって、検出加速度ベクトルVaの信頼度を、入力装置8の状態を表す3つの異なる変数を用いて判断している。これによって、検出加速度ベクトルVaの信頼度をより正確に判断することができ、信頼度に応じて補正量を適切に決定することができる。そのため、ゲーム装置3は、重力方向および入力装置8の姿勢をより正確に算出することができる。なお、他の実施形態においては、CPU10は、ステップS22,S23,S26の全ての処理を実行する必要はなく、S22,S23,S26の処理のうち1つまたは2つの処理のみを実行するようにしてもよい。   As described above, in this embodiment, the reliability of the detected acceleration vector Va is determined using steps S22, S23, and S26 using three different variables that represent the state of the input device 8. Thereby, the reliability of the detected acceleration vector Va can be determined more accurately, and the correction amount can be appropriately determined according to the reliability. Therefore, the game apparatus 3 can calculate the gravity direction and the attitude of the input apparatus 8 more accurately. In other embodiments, the CPU 10 does not need to execute all the processes of steps S22, S23, and S26, and executes only one or two of the processes of S22, S23, and S26. May be.

また、上記ステップS22,S23,またはS26の結果、第1補正度Aが“0”となった場合、CPU10は、それ以降の処理をスキップして、静的補正処理を終了するようにしてもよい。上記の場合、実質的には重力ベクトルの補正が行われないので、それ以降の処理を省略することにより、処理を短縮することができるからである。   When the first correction degree A is “0” as a result of step S22, S23, or S26, the CPU 10 skips the subsequent processes and ends the static correction process. Good. This is because the gravity vector is not substantially corrected in the above case, and the processing can be shortened by omitting the subsequent processing.

ステップS27において、CPU10は、検出加速度ベクトルVaに近づけるように重力ベクトルVgを補正する(図9参照)。本実施形態では、補正前の重力ベクトルVgを、上記第1補正度Aの大きさに応じた割合で検出加速度ベクトルVaに近づけることによって、補正後の重力ベクトルVg’が算出される。具体的には、CPU10は、メインメモリに記憶されている加速度データ64、重力方向データ69、および第1補正度データ72を読み出し、加速度データ64により示される検出加速度ベクトルVaと、重力方向データ69により示される(補正前の)重力ベクトルVgと、第1補正度データ72により示される第1補正度データAとを取得する。そして、補正前の重力ベクトルVgと検出加速度ベクトルVaとのなす角度をθ1[deg]とすると、検出加速度ベクトルVaの方向へ“A・θ1[deg]”だけ補正前の重力ベクトルVgを回転させることによって、補正後の重力ベクトルVg’を算出する。算出された重力ベクトルVg’を示すデータは、新たな重力方向データ69としてメインメモリに記憶される。なお、補正後の重力ベクトルVg’の算出方法はどのような方法であってもよい。例えば、他の実施形態においては、補正前の重力ベクトルVgの終点から検出加速度ベクトルVaの終点までを結ぶ線分をA:(1−A)に内分する点を終点とするベクトルを算出し、算出されたベクトルを正規化することによって、補正後の重力ベクトルVg’を得るようにしてもよい。以上のステップS21〜S27によって、静的補正処理において重力ベクトルが補正されたこととなる。上記ステップS27の後、CPU10は静的補正処理を終了する。   In step S27, the CPU 10 corrects the gravity vector Vg so as to approach the detected acceleration vector Va (see FIG. 9). In the present embodiment, the corrected gravity vector Vg ′ is calculated by bringing the uncorrected gravity vector Vg closer to the detected acceleration vector Va at a rate corresponding to the magnitude of the first correction degree A. Specifically, the CPU 10 reads the acceleration data 64, the gravity direction data 69, and the first correction degree data 72 stored in the main memory, and detects the detected acceleration vector Va indicated by the acceleration data 64 and the gravity direction data 69. And the first correction degree data A indicated by the first correction degree data 72 are acquired. If the angle formed by the gravity vector Vg before correction and the detected acceleration vector Va is θ1 [deg], the gravity vector Vg before correction is rotated by “A · θ1 [deg]” in the direction of the detected acceleration vector Va. Thus, the corrected gravity vector Vg ′ is calculated. Data indicating the calculated gravity vector Vg ′ is stored in the main memory as new gravity direction data 69. Note that any method may be used to calculate the corrected gravity vector Vg ′. For example, in another embodiment, a vector whose end point is a point dividing the line segment connecting the end point of the gravity vector Vg before correction to the end point of the detected acceleration vector Va into A: (1-A) is calculated. The corrected gravity vector Vg ′ may be obtained by normalizing the calculated vector. Through the above steps S21 to S27, the gravity vector is corrected in the static correction process. After step S27, the CPU 10 ends the static correction process.

図15の説明に戻り、ステップS12の次のステップS13において、CPU10は、動的補正処理を実行する。動的補正処理は、入力装置8が主に動いている場合に入力装置8の姿勢を補正する補正処理である。   Returning to the description of FIG. 15, in step S <b> 13 subsequent to step S <b> 12, the CPU 10 executes dynamic correction processing. The dynamic correction process is a correction process for correcting the posture of the input device 8 when the input device 8 is mainly moving.

上述のように、動的補正処理においては、CPU10は、入力装置8が等角速度で回転運動を行うものと推定し、等角速度の回転運動を行う場合における角速度と運動加速度との関係を用いて、重力ベクトルVgを補正する。ここで、回転運動を行う入力装置8の運動加速度ベクトルは、一般的に、次の式(5)によって表される。

Figure 0005630969
上式(5)において、ベクトルVωは、ジャイロセンサ55および56が検出した角速度を表す角速度ベクトルであり、ベクトルVrは、入力装置8の位置、より厳密には加速度センサの位置37の位置から回転の中心位置を指すベクトル(位置ベクトル)である。ここでは、入力装置8は等角速度の回転運動を行うと推定するので、上式(5)の右辺の第1項が“0”となり、さらに上式(5)を整理すると、次の式(6)が得られる。
VA=(−Vω[I]+VωVω)Vr …(6)
上式(6)において、行列[I]は3×3の単位行列であり、行列VωはベクトルVωを1×3の行列であるとみなした場合における行列Vωの転置行列である。上式(6)の両辺それぞれに対してベクトルVωとの内積を算出する演算を行うと、右辺が“0”となるので、下記の式(7)が成り立つ。
Vω・VA=0 …(7)
上式(7)は、角速度ベクトルVωと運動加速度ベクトルVAとが直交することを表している。つまり、入力装置8が等角速度の回転運動を行う場合、角速度ベクトルVωと運動加速度ベクトルVAとは直交する関係が成り立つ。なお、以下では、入力装置8が回転運動を行う場合において運動加速度ベクトルと直交するベクトルを、「直交ベクトル」と呼ぶことがある。本実施形態では、角速度ベクトルVωが直交ベクトルである。 As described above, in the dynamic correction process, the CPU 10 estimates that the input device 8 performs a rotational motion at a uniform angular velocity, and uses the relationship between the angular velocity and the motion acceleration when performing a rotational motion at a uniform angular velocity. The gravity vector Vg is corrected. Here, the motion acceleration vector of the input device 8 that performs the rotational motion is generally expressed by the following equation (5).
Figure 0005630969
In the above equation (5), the vector Vω is an angular velocity vector representing the angular velocity detected by the gyro sensors 55 and 56, and the vector Vr is rotated from the position of the input device 8, more precisely from the position of the acceleration sensor position 37. It is a vector (position vector) indicating the center position of. Here, since it is presumed that the input device 8 performs a rotational motion at an equiangular velocity, the first term on the right side of the above equation (5) becomes “0”, and further, the above equation (5) is rearranged, 6) is obtained.
VA = (− Vω 2 [I] + VωVω T ) Vr (6)
In the above formula (6), the matrix [I] is a unit matrix of 3 × 3 matrix Vomega T is the transpose of the matrix Vomega in a case where regarded as a matrix of 1 × 3 vector Vomega. When an operation for calculating the inner product with the vector Vω is performed on both sides of the above equation (6), the right side becomes “0”, and the following equation (7) is established.
Vω · VA = 0 (7)
The above equation (7) represents that the angular velocity vector Vω and the motion acceleration vector VA are orthogonal to each other. That is, when the input device 8 performs a rotational motion at a constant angular velocity, the angular velocity vector Vω and the motion acceleration vector VA are orthogonal to each other. Hereinafter, when the input device 8 performs a rotational motion, a vector orthogonal to the motion acceleration vector may be referred to as an “orthogonal vector”. In the present embodiment, the angular velocity vector Vω is an orthogonal vector.

上記関係を用いることによって、重力ベクトルVgを補正することができる。すなわち、運動加速度ベクトルVAは重力ベクトルVgから算出される(上記ステップS24参照)ので、ジャイロセンサ55および56が検出した角速度ベクトルVωに対して運動加速度ベクトルVAが上式(7)を満たすように、重力ベクトルVgを補正すればよい。なお、本実施形態における動的補正処理では、入力装置8が正確に等角速度の回転運動を行っていない場合もあり得ることや、補正によって重力ベクトルVgが急激に変化することを防止すること等を考慮して、上記関係を満たす重力ベクトルを1回の補正処理で得るのではなく、1回の補正処理では、上記関係を満たす重力ベクトルへと近づける補正を行う。すなわち、運動加速度ベクトルVAが角速度ベクトルVωに対して垂直に近づくように、重力ベクトルVgを補正する。   By using the above relationship, the gravity vector Vg can be corrected. That is, since the motion acceleration vector VA is calculated from the gravity vector Vg (see step S24), the motion acceleration vector VA satisfies the above equation (7) with respect to the angular velocity vector Vω detected by the gyro sensors 55 and 56. The gravity vector Vg may be corrected. In the dynamic correction process according to the present embodiment, the input device 8 may not accurately rotate at a uniform angular velocity, or the gravity vector Vg may be prevented from changing suddenly due to the correction. In consideration of the above, a gravity vector satisfying the above relationship is not obtained by a single correction process, but correction is performed so as to approach a gravity vector satisfying the above relationship in one correction process. That is, the gravity vector Vg is corrected so that the motion acceleration vector VA approaches a direction perpendicular to the angular velocity vector Vω.

補正前の重力ベクトルVgを、上記関係を満たす重力ベクトルへと近づけるためには、直交ベクトルWと運動加速度ベクトルVAとの内積が小さくなるように重力ベクトルVgを補正すればよい。すなわち、関数φ=Vω・VA=Vω・(Va−Vg)を、|Vg|=1の条件下で最小にする重力ベクトルVgを得ればよい。このような重力ベクトルVgを得る方法はどのような方法であってもよいが、本実施形態における動的補正処理では、重力補正ベクトルΔVgを用いた方法によって処理を行う。重力補正ベクトルΔVgは、予め定められた長さであり、その方向へ重力ベクトルVgを回転させるベクトルである。CPU10は、重力補正ベクトルΔVgの方向、すなわち、重力ベクトルVgをどの向きへ回転させるかを決定する。つまり、本実施形態では、重力ベクトルVgを所定角度だけ(重力補正ベクトルΔVgの長さだけ)回転させたときに、回転後の重力ベクトルから算出される運動加速度ベクトルが、上記関係を満たす運動加速度へ最も近づく方向へ、重力ベクトルVgを回転させる補正を行う。 In order to bring the gravity vector Vg before correction closer to the gravity vector satisfying the above relationship, the gravity vector Vg may be corrected so that the inner product of the orthogonal vector W and the motion acceleration vector VA becomes small. That is, it is only necessary to obtain the gravity vector Vg that minimizes the function φ = Vω · VA = Vω · (Va−Vg) under the condition of | Vg | 2 = 1. Any method may be used to obtain the gravity vector Vg. In the dynamic correction process according to the present embodiment, the process is performed by a method using the gravity correction vector ΔVg. The gravity correction vector ΔVg has a predetermined length, and is a vector that rotates the gravity vector Vg in that direction. The CPU 10 determines the direction of the gravity correction vector ΔVg, that is, the direction in which the gravity vector Vg is rotated. That is, in this embodiment, when the gravity vector Vg is rotated by a predetermined angle (by the length of the gravity correction vector ΔVg), the motion acceleration vector calculated from the rotated gravity vector satisfies the above relationship. Correction is performed to rotate the gravity vector Vg in the direction closest to.

以下、図17を参照して、動的補正処理の詳細を説明する。図17は、図15に示す動的補正処理(ステップS13)の流れを示すフローチャートである。動的補正処理においては、まずステップS31において、CPU10は、重力ベクトルVgを補正するために用いられる上記重力補正ベクトルΔVgを算出する。重力補正ベクトルΔVgは、角速度ベクトルVωおよび運動加速度ベクトルVAに基づいて算出される。以下、図18を参照して、重力補正ベクトルΔVgの算出方法について説明する。   Hereinafter, details of the dynamic correction processing will be described with reference to FIG. FIG. 17 is a flowchart showing the flow of the dynamic correction process (step S13) shown in FIG. In the dynamic correction process, first, in step S31, the CPU 10 calculates the gravity correction vector ΔVg used for correcting the gravity vector Vg. The gravity correction vector ΔVg is calculated based on the angular velocity vector Vω and the motion acceleration vector VA. Hereinafter, a method for calculating the gravity correction vector ΔVg will be described with reference to FIG.

図18および図19は、動的補正処理における重力補正ベクトルΔVgの算出方法を示す図である。図18においては、運動加速度ベクトルVAと角速度ベクトルVωとのなす角θ2は鋭角である。当該角θ2が鋭角である場合、上記の関係を満たすべく、運動加速度ベクトルVAを角速度ベクトルVωを直交させる(直交状態に近づける)ためには、運動加速度ベクトルVAを角速度ベクトルVωの逆方向へ回転させる(角速度ベクトルVωから遠ざける)ように補正すればよい。つまり、運動加速度ベクトルVAの終端を角速度ベクトルVωの逆方向(ベクトルV1の方向)へ回転させればよい。したがって、重力ベクトルVgについては、その終端を角速度ベクトルVωの同方向へ回転させればよい。以上より、重力補正ベクトルΔVgは、角速度ベクトルVωと同じ方向を向くベクトル−V1を重力ベクトルVgと垂直な平面Pに投影したベクトルとして算出することができる。一方、図19に示すように、運動加速度ベクトルVAと角速度ベクトルVωとのなす角θ2が鈍角である場合は、角θ2が鋭角である場合とは逆に、運動加速度ベクトルVAの終端を角速度ベクトルVωと同方向へ回転させればよい。したがって、重力補正ベクトルΔVgは、角速度ベクトルVωの逆方向を向くベクトル−V1を上記平面Pに投影したベクトルとして算出することができる。   18 and 19 are diagrams illustrating a method of calculating the gravity correction vector ΔVg in the dynamic correction process. In FIG. 18, the angle θ2 formed by the motion acceleration vector VA and the angular velocity vector Vω is an acute angle. When the angle θ2 is an acute angle, the motion acceleration vector VA is rotated in the opposite direction of the angular velocity vector Vω in order to make the motion acceleration vector VA orthogonal to the angular velocity vector Vω so as to satisfy the above relationship. It suffices to correct it so that it is moved away from the angular velocity vector Vω. That is, the end of the motion acceleration vector VA may be rotated in the direction opposite to the angular velocity vector Vω (the direction of the vector V1). Therefore, the end of the gravity vector Vg may be rotated in the same direction as the angular velocity vector Vω. As described above, the gravity correction vector ΔVg can be calculated as a vector obtained by projecting the vector −V1 facing the same direction as the angular velocity vector Vω onto the plane P perpendicular to the gravity vector Vg. On the other hand, as shown in FIG. 19, when the angle θ2 formed by the motion acceleration vector VA and the angular velocity vector Vω is an obtuse angle, contrary to the case where the angle θ2 is an acute angle, the end of the motion acceleration vector VA is defined as the angular velocity vector. What is necessary is just to rotate in the same direction as Vω. Therefore, the gravity correction vector ΔVg can be calculated as a vector obtained by projecting the vector −V1 facing the opposite direction of the angular velocity vector Vω onto the plane P.

上記ステップS31の具体的な処理としては、CPU10は、まず、角速度ベクトルVωおよび運動加速度ベクトルVAに基づいて上記ベクトルV1を算出する。ベクトルV1は、運動加速度ベクトルVAと角速度ベクトルVωとのなす角が鋭角である場合に角速度ベクトルVωと逆方向を向き、当該角が鋭角である場合に角速度ベクトルVωと同方向を向く。すなわち、CPU10は、メインメモリに記憶されている角速度データ63および運動加速度データ74を読み出し、角速度データ63により示される角速度ベクトルVωと運動加速度データ74により示される運動加速度ベクトルVAとを取得する。そして、角速度ベクトルVωおよび運動加速度ベクトルVAを用いて、次の式(8)に従ってベクトルV1を算出する。
V1=(Vω・VA)Vω …(8)
さらに、CPU10は、上式(8)で算出されたベクトルV1を上記平面P(図18参照)に投影したベクトルを得るべく、次の式(9)に従って重力補正ベクトルΔVgを算出する。
ΔVg=V1−(Vg・V1)Vg …(9)
上式(9)は、上記V1から重力ベクトルVgと平行な成分を除いたベクトルを算出するものである。CPU10は、さらに、上式(9)で得られた重力補正ベクトルΔVgを正規化した後、予め定められた定数を掛ける。この定数は、補正量を表すものであり、例えば0.03に設定される。これによって、所定の長さの重力補正ベクトルΔVgを得ることができる。以上によって算出された重力補正ベクトルΔVgを示すデータは、重力補正ベクトルデータ75としてメインメモリに記憶される。ステップS31の次にステップS32の処理が実行される。
As specific processing of step S31, the CPU 10 first calculates the vector V1 based on the angular velocity vector Vω and the motion acceleration vector VA. The vector V1 is directed in the opposite direction to the angular velocity vector Vω when the angle formed by the motion acceleration vector VA and the angular velocity vector Vω is an acute angle, and is directed in the same direction as the angular velocity vector Vω when the angle is an acute angle. That is, the CPU 10 reads the angular velocity data 63 and the motion acceleration data 74 stored in the main memory, and acquires the angular velocity vector Vω indicated by the angular velocity data 63 and the motion acceleration vector VA indicated by the motion acceleration data 74. Then, using the angular velocity vector Vω and the motion acceleration vector VA, a vector V1 is calculated according to the following equation (8).
V1 = (Vω · VA) Vω (8)
Further, the CPU 10 calculates a gravity correction vector ΔVg according to the following equation (9) in order to obtain a vector obtained by projecting the vector V1 calculated by the above equation (8) onto the plane P (see FIG. 18).
ΔVg = V1− (Vg · V1) Vg (9)
The above equation (9) is to calculate a vector obtained by removing the component parallel to the gravity vector Vg from V1. The CPU 10 further normalizes the gravity correction vector ΔVg obtained by the above equation (9), and then multiplies a predetermined constant. This constant represents the correction amount, and is set to 0.03, for example. Thereby, a gravity correction vector ΔVg having a predetermined length can be obtained. Data indicating the gravity correction vector ΔVg calculated as described above is stored in the main memory as gravity correction vector data 75. Following step S31, the process of step S32 is executed.

なお、本実施形態においては、角速度ベクトルVωの方向に基づいて上記重力補正ベクトルΔVgの方向を決定した。ここで、他の実施形態においては、CPU10は、上式(7)の関係を満たす重力ベクトルを算出し、算出された重力ベクトルへ補正前の重力ベクトルを近づける方向として、上記重力補正ベクトルΔVgの方向を決定してもよい。   In the present embodiment, the direction of the gravity correction vector ΔVg is determined based on the direction of the angular velocity vector Vω. Here, in another embodiment, the CPU 10 calculates a gravity vector that satisfies the relationship of the above equation (7), and sets the gravity correction vector ΔVg as a direction in which the gravity vector before correction approaches the calculated gravity vector. The direction may be determined.

ステップS32において、CPU10は、動的補正処理において入力装置8の姿勢を補正する度合を示す上記第2補正度Bを算出する。第2補正度Bは、入力装置8の角速度に応じた大きさになるように算出される。具体的には、CPU10は、メインメモリに記憶されている角速度データ63を読み出す。そして、角速度データ63により示される角速度を用いて、次の式(10)に従って第2補正度Bを算出する。
0≦|ω|≦T2のとき、B=ω/T2
T2<|ω|のとき、B=1 …(10)
上式(10)において、定数T2は、予め定められており、例えば、T2=10[deg/sec]に設定される。上式(10)は、角速度ωの大きさ(角速度ベクトルVωの大きさ)が小さいほど第2補正度Bが小さくなるように、第2補正度Bを算出するものである。つまり、上式(10)によって、角速度ωが小さくほど、重力ベクトルの補正量が小さくなる。なお、他の実施形態においては、角速度ωが大きいほど大きい重みが付されるように、上式(10)における“ω/T2”を、“(ω/T2)”としてもよい。上式(10)で算出された第2補正度Bを示すデータは、第2補正度データ73としてメインメモリに記憶される。ステップS32の次にステップS33の処理が実行される。
In step S <b> 32, the CPU 10 calculates the second correction degree B indicating the degree of correcting the attitude of the input device 8 in the dynamic correction process. The second correction degree B is calculated so as to have a magnitude corresponding to the angular velocity of the input device 8. Specifically, the CPU 10 reads the angular velocity data 63 stored in the main memory. Then, using the angular velocity indicated by the angular velocity data 63, the second correction degree B is calculated according to the following equation (10).
When 0 ≦ | ω | ≦ T2, B = ω / T2
When T2 <| ω |, B = 1 (10)
In the above equation (10), the constant T2 is determined in advance, and is set to T2 = 10 [deg / sec], for example. The above equation (10) calculates the second correction degree B so that the second correction degree B decreases as the magnitude of the angular velocity ω (the magnitude of the angular velocity vector Vω) decreases. That is, according to the above equation (10), the smaller the angular velocity ω, the smaller the gravity vector correction amount. In another embodiment, “ω / T2” in the above equation (10) may be set to “(ω / T2) 2 ” so that the greater the angular velocity ω, the greater the weight. Data indicating the second correction degree B calculated by the above equation (10) is stored in the main memory as the second correction degree data 73. Following step S32, the process of step S33 is executed.

ここで、入力装置8の角速度が小さい場合、入力装置8が回転運動を行っていない可能性が高いと推測される。動的補正処理における補正は、入力装置8が(等角速度の)回転運動を行っていることを前提として行われるが、入力装置8の角速度が小さい場合には、この前提が成り立たない可能性が高いと考えられる。そのため、本実施形態では、入力装置8の角速度が小さい場合には、動的補正処理における補正が正確でないおそれがあることを考慮して、補正量を小さくしている。これによれば、入力装置8が回転運動を行っていないことから補正を正しく行うことができない場合に、動的補正処理によって不正確な補正が行われることを防止することができる。その結果、動的補正処理において重力ベクトルの補正を正しく行うことができる。   Here, when the angular velocity of the input device 8 is small, it is estimated that there is a high possibility that the input device 8 is not rotating. The correction in the dynamic correction process is performed on the assumption that the input device 8 is performing a rotational motion (with a constant angular velocity). However, when the angular velocity of the input device 8 is small, this assumption may not be satisfied. It is considered high. Therefore, in this embodiment, when the angular velocity of the input device 8 is small, the correction amount is reduced in consideration of the possibility that the correction in the dynamic correction process may not be accurate. According to this, in the case where the input device 8 does not perform the rotational movement and thus cannot be corrected correctly, it is possible to prevent the dynamic correction process from performing the incorrect correction. As a result, the gravity vector can be corrected correctly in the dynamic correction process.

ステップS33において、CPU10は、入力装置8の加加速度Jに応じて第2補正度Bの値を修正する。具体的には、CPU10は、メインメモリに記憶されている加加速度データ71および第2補正度データ73を読み出し、加加速度データ71により示される加加速度Jと第2補正度データ73により示される第2補正度Bとを取得する。そして、上記加加速度Jを用いて、次の式(11)に従って修正後の第2補正度Bを算出する。
0≦J≦U2のとき、B=B’×{1−(J/U1)}
U2<Jのとき、B=0 …(11)
上式(11)において、定数U2は、予め定められており、例えば、U2=40[G/sec]に設定される。上式(11)は、加加速度Jが大きいほど第2補正度Bが小さくなるように、第2補正度Bを修正するものである。つまり、上式(11)によって、加加速度Jが大きいほど、重力ベクトルの補正量が小さくなる。なお、他の実施形態においては、加加速度Jが小さいほど大きい重みが付されるように、上式(11)における“{1−(J/U2)}”を、“{1−(J/U2)}”としてもよい。上式(11)で修正された第2補正度Bを示すデータは、第2補正度データ73としてメインメモリに記憶される。上記ステップS33によって、最終的な第2補正度Bが算出されたことになる。ステップS33の次にステップS34の処理が実行される。
In step S <b> 33, the CPU 10 corrects the value of the second correction degree B according to the jerk J of the input device 8. Specifically, the CPU 10 reads the jerk data 71 and the second correction degree data 73 stored in the main memory, and the jerk J indicated by the jerk data 71 and the second correction degree data 73 indicate the first. 2 correction degree B is acquired. Then, using the jerk J, a corrected second correction degree B is calculated according to the following equation (11).
When 0 ≦ J ≦ U2, B = B ′ × {1- (J / U1)}
When U2 <J, B = 0 (11)
In the above equation (11), the constant U2 is predetermined, and is set to U2 = 40 [G / sec], for example. The above equation (11) corrects the second correction degree B so that the second correction degree B decreases as the jerk J increases. That is, according to the above equation (11), the greater the jerk J, the smaller the gravity vector correction amount. In another embodiment, “{1- (J / U2)}” in the above equation (11) is replaced with “{1- (J / U2)} 2 ". Data indicating the second correction degree B corrected by the above equation (11) is stored in the main memory as second correction degree data 73. In step S33, the final second correction degree B is calculated. Following step S33, the process of step S34 is executed.

ここで、入力装置8の加加速度Jが大きくなるのは、入力装置8を動かし始めた時点、(動かしている状態から)停止させた時点、または入力装置8を往復移動させている場合における折り返しの時点等である。このような時点では、入力装置8は回転運動を行っていないと推測される。したがって、入力装置8の角速度が小さい場合と同様、入力装置8の加加速度Jが大きくなる場合には、「入力装置8が(等角速度の)回転運動を行っている」という前提が成り立たない可能性が高いと考えられ、この場合には動的補正処理における補正が不正確になるおそれがある。そのため、本実施形態では、入力装置8の加加速度Jが大きい場合には、動的補正処理における補正が正確でないおそれがあることを考慮して、補正量を小さくしている。これによれば、上記ステップS32の場合と同様、動的補正処理によって不正確な補正が行われることを防止することができる。その結果、動的補正処理において重力ベクトルの補正を正しく行うことができる。   Here, the jerk J of the input device 8 increases when the input device 8 starts to move, when it stops (from the moving state), or when the input device 8 is reciprocated. And so on. At such time, it is estimated that the input device 8 is not performing rotational motion. Therefore, as in the case where the angular velocity of the input device 8 is small, when the jerk J of the input device 8 is large, it is possible that the assumption that “the input device 8 is rotating (at a uniform angular velocity)” is not satisfied. In this case, the correction in the dynamic correction process may be inaccurate. Therefore, in the present embodiment, when the jerk J of the input device 8 is large, the correction amount is reduced in consideration of the possibility that the correction in the dynamic correction process may not be accurate. According to this, as in the case of step S32, it is possible to prevent incorrect correction from being performed by dynamic correction processing. As a result, the gravity vector can be corrected correctly in the dynamic correction process.

また、上記ステップS33では、入力装置8が回転運動を行っているか否かを、上記ステップS32とは異なる変数である加加速度Jを用いて判断している。そのため、入力装置8が回転運動を行っているか否かをステップS32では正しく判断できずに第2補正度Bが大きい値のままになる場合であっても、ステップS26の処理によって第1補正度Aを小さく変更することができるので、上記信頼度を正しく判断することができる。   In step S33, it is determined whether or not the input device 8 is rotating using the jerk J, which is a variable different from that in step S32. Therefore, even if the second correction degree B remains a large value because it is not possible to correctly determine in step S32 whether or not the input device 8 is rotating, the first correction degree is obtained by the process of step S26. Since A can be changed small, the reliability can be correctly determined.

ステップS34において、CPU10は、重力ベクトルVgを重力補正ベクトルΔVgで補正する。具体的には、CPU10は、メインメモリに記憶されている重力方向データ69および重力補正ベクトルデータ75を読み出し、重力方向データ69により示される重力ベクトルVgに、重力補正ベクトルデータ75により示される重力補正ベクトルΔVgを加算する。さらに、加算結果のベクトルを正規化することによって、補正後の重力ベクトルVgを算出する。補正後の重力ベクトルVgを示すデータは、重力方向データ69としてメインメモリに記憶される。これによって、動的補正処理において重力ベクトルVgの補正が行われたこととなる。上記ステップS34の後、CPU10は動的補正処理を終了する。   In step S34, the CPU 10 corrects the gravity vector Vg with the gravity correction vector ΔVg. Specifically, the CPU 10 reads the gravity direction data 69 and the gravity correction vector data 75 stored in the main memory, and converts the gravity vector Vg indicated by the gravity direction data 69 into the gravity correction indicated by the gravity correction vector data 75. The vector ΔVg is added. Furthermore, the corrected gravity vector Vg is calculated by normalizing the addition result vector. Data indicating the corrected gravity vector Vg is stored in the main memory as gravity direction data 69. As a result, the gravity vector Vg is corrected in the dynamic correction process. After step S34, the CPU 10 ends the dynamic correction process.

上記動的補正処理によれば、CPU10は、入力装置8が等角速度の回転運動を行うものとして、「運動加速度ベクトルVAが角速度ベクトルVωと垂直になる」という関係(上式(7))を予め定義しておく。そして、補正前の重力ベクトルVgを、上記関係を満たす重力ベクトルに近づける補正を行う。これによれば、ゲーム装置3は、入力装置8が動いている場合であっても重力ベクトルを補正することができ、重力方向および入力装置8の姿勢を正確に算出することができる。   According to the dynamic correction process described above, the CPU 10 assumes that the input device 8 performs a rotational motion at a constant angular velocity, and has the relationship that the motion acceleration vector VA is perpendicular to the angular velocity vector Vω (the above equation (7)). Define in advance. And the correction | amendment which makes the gravity vector Vg before correction | amendment approach the gravity vector which satisfy | fills the said relationship is performed. According to this, the game apparatus 3 can correct the gravity vector even when the input apparatus 8 is moving, and can accurately calculate the direction of gravity and the attitude of the input apparatus 8.

また、本実施形態におけるカヌーのゲームでは、プレイヤはパドルで水を掻くように入力装置8を動かすので、入力装置8が回転運動を行う期間があると想定される。その一方、入力装置8の振り始めや振り終わりの期間や、入力装置8が正確に回転運動を行っておらずに往復運動に近い運動を行っている期間があるおそれがある。そのため、本実施形態では、入力装置8の角速度および加加速度を用いて、入力装置8が回転運動を行っているか否かを判断し、回転運動を行っている可能性が高い場合には動的補正処理における補正量を大きくし、回転運動を行っている可能性が低い場合には補正量を小さくしている(ステップS32およびS33)。したがって、本実施形態によれば、入力装置8が回転運動を行う期間には重力方向が正しく補正される一方、振り始めや振り終わりの期間や、往復運動を行っている期間には補正が行われないので、不正確な補正が行われることがなく、重力方向を正確に算出することができる。   In the canoe game according to the present embodiment, the player moves the input device 8 so as to scrape water with a paddle. Therefore, it is assumed that there is a period during which the input device 8 performs a rotational motion. On the other hand, there is a possibility that there is a period when the input device 8 starts swinging or ends, or there is a period when the input device 8 does not accurately rotate but performs a motion close to a reciprocating motion. For this reason, in the present embodiment, it is determined whether the input device 8 is performing a rotational motion using the angular velocity and jerk of the input device 8, and if there is a high possibility that the input device 8 is performing a rotational motion, The correction amount in the correction process is increased, and the correction amount is decreased when the possibility of performing the rotational motion is low (steps S32 and S33). Therefore, according to the present embodiment, the direction of gravity is correctly corrected during the period in which the input device 8 performs the rotational motion, while the correction is performed during the swing start and swing end periods and the reciprocating motion period. Therefore, the direction of gravity can be accurately calculated without inaccurate correction.

[動的補正処理の変形例]
なお、上記実施形態においては、入力装置8が等角速度で回転運動を行うものと推定して、運動加速度と角速度との関係(上式(7))を定義した。ここで、他の実施形態においては、入力装置8が、等角速度でない場合も含む回転運動を行うものと推定して、運動加速度と角速度との関係を定義することも可能である。以下、入力装置8が(等角速度でない場合も含む)回転運動を行うものと推定する場合の変形例について説明する。
[Modified example of dynamic correction processing]
In the above embodiment, the relationship between the motion acceleration and the angular velocity (formula (7)) is defined on the assumption that the input device 8 performs a rotational motion at a constant angular velocity. Here, in another embodiment, it is also possible to define the relationship between the motion acceleration and the angular velocity by estimating that the input device 8 performs a rotational motion including a case where the angular velocity is not constant. Hereinafter, a modified example in the case where it is estimated that the input device 8 performs a rotational motion (including a case where the angular velocity is not equal) will be described.

まず、入力装置8が等角速度でない回転運動を行う場合における、運動加速度と角速度との関係について説明する。入力装置8が等角速度でない回転運動を行う場合においても、上式(5)は成り立つ。この場合、式(5)の右辺の第1項が“0”とならないので、右辺の第1項を削除せずに式(5)を整理すると、次の式(12)が得られる。

Figure 0005630969
上式(12)は、上式(6)と比べて、右辺の括弧内の第1項が追加されている点で異なる。なお、当該第1項は、外積の行列表現を表し、演算結果が外積と同様になる行列(反対称行列)を表すものとする。上述のように、入力装置8を動かす運動は回転運動であると見なすことができるので、入力装置8の位置から回転中心を向く位置ベクトルVrと角速度ベクトルVωとが直交することを前提とすれば、上式(12)において右辺の括弧内の第3項に位置ベクトルVrを掛けたものは“0”になる。さらに、上式(12)を整理して両辺にベクトルVωとの内積を算出する演算を行うと、下記の式(13)が成り立つ。
Figure 0005630969
ここで、下記の式(14)のようにベクトルWを定義する。
Figure 0005630969
上式(14)のようにベクトルWを定義すると、上式(13)の右辺は、ベクトルWとベクトルVAとの内積として表すことができるので、上式(13)は下記の式(15)のように表すことができる。
W・VA=0 …(15)
上式(15)は、角速度ベクトルVωとベクトルWとが直交することを表している。つまり、入力装置8が回転運動を行う場合、運動加速度ベクトルVAとベクトルWとは直交する関係が成り立ち、ベクトルWが上記直交ベクトルとなる。本変形例では、CPU10は、上式(7)に代えて、上式(15)で表される関係に基づいて、重力ベクトルを補正する。 First, the relationship between motion acceleration and angular velocity when the input device 8 performs a rotational motion that is not a constant angular velocity will be described. Even when the input device 8 performs a rotational motion that is not at a uniform angular velocity, the above equation (5) holds. In this case, since the first term on the right side of Equation (5) does not become “0”, the following Equation (12) is obtained by rearranging Equation (5) without deleting the first term on the right side.
Figure 0005630969
The above equation (12) differs from the above equation (6) in that the first term in the parenthesis on the right side is added. The first term represents a matrix representation of the outer product, and represents a matrix (antisymmetric matrix) in which the operation result is similar to the outer product. As described above, since the motion of moving the input device 8 can be regarded as a rotational motion, it is assumed that the position vector Vr facing the rotation center from the position of the input device 8 and the angular velocity vector Vω are orthogonal to each other. In the above equation (12), the third term in the parenthesis on the right side multiplied by the position vector Vr is “0”. Further, when the above equation (12) is rearranged and an operation for calculating the inner product of the vector Vω on both sides is performed, the following equation (13) is established.
Figure 0005630969
Here, a vector W is defined as in the following equation (14).
Figure 0005630969
If the vector W is defined as in the above equation (14), the right side of the above equation (13) can be expressed as the inner product of the vector W and the vector VA. Therefore, the above equation (13) can be expressed by the following equation (15): It can be expressed as
W · VA = 0 (15)
The above equation (15) represents that the angular velocity vector Vω and the vector W are orthogonal. That is, when the input device 8 performs a rotational motion, the motion acceleration vector VA and the vector W are orthogonal to each other, and the vector W is the orthogonal vector. In this modification, the CPU 10 corrects the gravity vector based on the relationship expressed by the above equation (15) instead of the above equation (7).

以下、図20を参照して、上記変形例における動的補正処理の詳細について説明する。図20は、図15に示す動的補正処理(ステップS13)の変形例を示すフローチャートである。なお、図20において、図17と同じ処理ステップには図17と同じステップ番号を付す。   Hereinafter, with reference to FIG. 20, the detail of the dynamic correction process in the said modification is demonstrated. FIG. 20 is a flowchart showing a modification of the dynamic correction process (step S13) shown in FIG. In FIG. 20, the same processing steps as those in FIG. 17 are denoted by the same step numbers as in FIG.

本変形例における動的補正処理においては、まずステップS41において、CPU10は入力装置8の角加速度ベクトルを算出する。角加速度ベクトルは、例えば、今回の処理ループで算出された角速度ベクトルVωと、前回の処理ループで算出された角速度ベクトルVωとの差分のベクトルとして算出される。具体的には、CPU10は、メインメモリに記憶されている角速度データ63および角速度履歴データを読み出し、角速度データ63により示される角速度ベクトルから、角速度履歴データにより示される角速度ベクトルを引いたベクトルを角加速度ベクトルとして算出する。算出された角加速度ベクトルを示すデータはメインメモリに記憶される。ステップS41の次にステップS42の処理が実行される。   In the dynamic correction process in the present modification, first, in step S41, the CPU 10 calculates an angular acceleration vector of the input device 8. The angular acceleration vector is calculated as, for example, a difference vector between the angular velocity vector Vω calculated in the current processing loop and the angular velocity vector Vω calculated in the previous processing loop. Specifically, the CPU 10 reads the angular velocity data 63 and the angular velocity history data stored in the main memory, and obtains a vector obtained by subtracting the angular velocity vector indicated by the angular velocity history data from the angular velocity vector indicated by the angular velocity data 63 from the angular acceleration. Calculate as a vector. Data indicating the calculated angular acceleration vector is stored in the main memory. Following step S41, the process of step S42 is executed.

ステップS42において、CPU10は上記直交ベクトルWを算出する。直交ベクトルWは、上式(14)に従って、角速度ベクトルVωと角加速度ベクトルとから算出することができる。具体的には、CPU10は、メインメモリに記憶されている角速度データ63および角加速度ベクトルを示すデータを読み出し、角速度データ63により示される角速度ベクトルと当該角加速度ベクトルを用いて、上式(14)に従って直交ベクトルWを算出する。算出された直交ベクトルWを示すデータは、直交ベクトルデータとしてメインメモリに記憶される。ステップS42の次にステップS43の処理が実行される。   In step S42, the CPU 10 calculates the orthogonal vector W. The orthogonal vector W can be calculated from the angular velocity vector Vω and the angular acceleration vector according to the above equation (14). Specifically, the CPU 10 reads out the angular velocity data 63 and the data indicating the angular acceleration vector stored in the main memory, and uses the angular velocity vector indicated by the angular velocity data 63 and the angular acceleration vector, the above equation (14) The orthogonal vector W is calculated according to Data indicating the calculated orthogonal vector W is stored in the main memory as orthogonal vector data. Following step S42, the process of step S43 is executed.

ステップS43において、CPU10は重力補正ベクトルΔVgを算出する。重力補正ベクトルΔVgは、上記ステップS31では角速度ベクトルVωと運動加速度ベクトルVAとに基づいて算出されたが、本変形例では上記直交ベクトルWと運動加速度ベクトルVAとに基づいて算出される。なお、ステップS43における重力補正ベクトルΔVgの具体的な算出方法は、角速度ベクトルVωに代えて直交ベクトルWを用いる点を除いてステップS31と同様の方法である。   In step S43, the CPU 10 calculates a gravity correction vector ΔVg. The gravity correction vector ΔVg is calculated based on the angular velocity vector Vω and the motion acceleration vector VA in step S31, but is calculated based on the orthogonal vector W and the motion acceleration vector VA in the present modification. The specific calculation method of the gravity correction vector ΔVg in step S43 is the same method as that in step S31 except that the orthogonal vector W is used instead of the angular velocity vector Vω.

本変形例では、ステップS43の次に、上記実施形態と同様のステップS32〜S34の処理が実行される。その結果、重力補正ベクトルΔVgによって重力ベクトルVgが補正される。本変形例によれば、等角速度でない回転運動にも対応した角速度ベクトルVωと運動加速度ベクトルVAと関係を用いて重力ベクトルVgの補正を行うので、入力装置8が等角速度でない回転運動を行う場合にも重力ベクトルVgを正しく補正することができる。したがって、CPU10は、上記実施形態に比べてより正確に重力方向を算出することができ、入力装置8をより正確に算出することができる。   In the present modification, the processes of steps S32 to S34 similar to those in the above embodiment are executed after step S43. As a result, the gravity vector Vg is corrected by the gravity correction vector ΔVg. According to the present modification, the gravity vector Vg is corrected using the relationship between the angular velocity vector Vω and the motion acceleration vector VA corresponding to a rotational motion that is not a uniform angular velocity, and therefore the input device 8 performs a rotational motion that is not a uniform angular velocity. In addition, the gravity vector Vg can be corrected correctly. Therefore, the CPU 10 can calculate the direction of gravity more accurately than in the above embodiment, and can calculate the input device 8 more accurately.

図15の説明に戻り、ステップS13の次のステップS14において、CPU10は、長期平均補正処理を実行する。長期平均補正処理は、比較的長い期間における検出加速度ベクトルの平均(全平均ベクトル)を用いて、重力ベクトルVgを補正する処理である。以下、図21および図22を参照して、長期平均補正処理の詳細を説明する。   Returning to the description of FIG. 15, in step S14 following step S13, the CPU 10 executes a long-term average correction process. The long-term average correction process is a process of correcting the gravity vector Vg using the average (total average vector) of detected acceleration vectors over a relatively long period. Hereinafter, details of the long-term average correction processing will be described with reference to FIGS. 21 and 22.

図21は、図15に示す長期平均補正処理(ステップS14)の流れを示すフローチャートである。長期平均補正処理においては、まずステップS51において、CPU10は、最新の加速度データを加速度履歴データ77に追加する。すなわち、CPU10は、加速度データ64と加速度履歴データ77とをメインメモリから読み出し、加速度履歴データ77の内容に、読み出した加速度データ64を追加する。加速度データ64の内容が追加された新たな加速度履歴データが、メインメモリに記憶される。つまり、ステップS51の処理によって、メインメモリに記憶される加速度履歴データ77は、更新前の内容に上記加速度データ64を追加した内容へと更新される。ステップS51の次にステップS52の処理が実行される。   FIG. 21 is a flowchart showing the flow of the long-term average correction process (step S14) shown in FIG. In the long-term average correction process, first, in step S 51, the CPU 10 adds the latest acceleration data to the acceleration history data 77. That is, the CPU 10 reads the acceleration data 64 and the acceleration history data 77 from the main memory, and adds the read acceleration data 64 to the contents of the acceleration history data 77. New acceleration history data to which the content of the acceleration data 64 is added is stored in the main memory. That is, the acceleration history data 77 stored in the main memory is updated to the content obtained by adding the acceleration data 64 to the content before the update by the process of step S51. Following step S51, the process of step S52 is executed.

ステップS52において、CPU10は、加速度履歴データ77をメインメモリから読み出し、加速度履歴データ77により示される1以上の検出加速度ベクトルの平均を算出する。本実施形態では、加速度履歴データ77により示される1以上の検出加速度ベクトルが、最新のブロックに含まれる検出加速度ベクトルに相当する(図22参照)。つまり、ステップS52の処理は、最新のブロックに関して、検出加速度ベクトルのブロック内の平均(ブロック平均ベクトル)を算出する処理である。ステップS52の次にステップS53の処理が実行される。   In step S <b> 52, the CPU 10 reads the acceleration history data 77 from the main memory, and calculates an average of one or more detected acceleration vectors indicated by the acceleration history data 77. In the present embodiment, one or more detected acceleration vectors indicated by the acceleration history data 77 correspond to the detected acceleration vectors included in the latest block (see FIG. 22). That is, the process of step S52 is a process of calculating the average (block average vector) of the detected acceleration vectors in the block with respect to the latest block. Following step S52, the process of step S53 is executed.

ステップS53において、CPU10は、最新のブロックに関して、ブロック内に含まれる検出加速度ベクトルの数が、予め定められた所定数(本実施形態では40)に達したか否かを判定する。すなわち、CPU10は、加速度履歴データ77をメインメモリから読み出し、加速度履歴データ77により示される検出加速度ベクトルの数が上記所定数に達したか否かを判定する。ステップS53の判定結果が肯定である場合、ステップS54の処理が実行される。一方、ステップS53の判定結果が否定である場合、ステップS54の処理がスキップされ、後述するステップS55の処理が実行される。   In step S <b> 53, the CPU 10 determines whether or not the number of detected acceleration vectors included in the block has reached a predetermined number (40 in the present embodiment) with respect to the latest block. That is, the CPU 10 reads the acceleration history data 77 from the main memory, and determines whether or not the number of detected acceleration vectors indicated by the acceleration history data 77 has reached the predetermined number. If the determination result of step S53 is affirmative, the process of step S54 is executed. On the other hand, when the determination result of step S53 is negative, the process of step S54 is skipped, and the process of step S55 described later is executed.

ステップS54において、CPU10は各ブロックを更新する。すなわち、CPU10は、40個のブロックのうちで最も古いブロックを削除し、新たなブロックを最新のブロックとして追加する。具体的には、CPU10は、40個のブロックそれぞれのブロック平均ベクトルを示すブロック平均データ78をメインメモリから読み出し、40個のブロックのうちで最も古いブロックを削除した内容へとブロック平均データ78を更新する。また、CPU10は、加速度履歴データ77の内容をクリアする。この時点で加速度履歴データ77は検出加速度ベクトルを示さないこととなるが、次回のステップS51において新たな検出加速度ベクトルが追加される。ステップS54の次にステップS55の処理が実行される。   In step S54, the CPU 10 updates each block. That is, the CPU 10 deletes the oldest block among the 40 blocks and adds a new block as the latest block. Specifically, the CPU 10 reads block average data 78 indicating the block average vector of each of the 40 blocks from the main memory, and sets the block average data 78 to the content obtained by deleting the oldest block among the 40 blocks. Update. Further, the CPU 10 clears the contents of the acceleration history data 77. At this time, the acceleration history data 77 does not indicate the detected acceleration vector, but a new detected acceleration vector is added in the next step S51. Following step S54, the process of step S55 is executed.

図22は、長期平均補正処理において用いられる加速度履歴データおよびブロック平均データを模式的に示す図である。図22において、横軸は時間(t)軸であり、時間軸の上に記載される長方形は、ブロック平均データ78により示される各ブロック平均ベクトルVavを表す。また、ブロック平均データ78の長方形の上に記載される正方形は、加速度履歴データ77により示される検出加速度ベクトルVaを表す。   FIG. 22 is a diagram schematically showing acceleration history data and block average data used in the long-term average correction processing. In FIG. 22, the horizontal axis is a time (t) axis, and the rectangle described on the time axis represents each block average vector Vav indicated by the block average data 78. A square described above the rectangle of the block average data 78 represents the detected acceleration vector Va indicated by the acceleration history data 77.

図22に示すように、加速度履歴データ77により示される1以上の検出加速度ベクトルVa(1)〜Va(n)(nは1≦n≦40の整数)は、最新のブロックに含まれる検出加速度ベクトルに相当する。上記ステップS51において最新の加速度データが加速度履歴データ77に追加されると、図22に示す検出加速度ベクトルVa(1)〜Va(n)の数が1つ増加することになる。そして、上記ステップS52において最新のブロックのブロック平均ベクトルVav(40)が算出される。したがって、最新のブロックのブロック平均ベクトルVav(40)は、必ずしも40個の検出加速度ベクトルVaの平均ではない。また、ステップS53において検出加速度ベクトルVa(1)〜Va(n)の数が40個に達したと判断されると、ステップS54において、各ブロックが更新される。すなわち、最も古いブロックのブロック平均ベクトルVav(1)が削除される。そして、次の処理ループにおいて実行されるステップS51およびS52において、新たなブロックのブロック平均ベクトルが算出される。   As shown in FIG. 22, one or more detected acceleration vectors Va (1) to Va (n) (n is an integer satisfying 1 ≦ n ≦ 40) indicated by the acceleration history data 77 are detected accelerations included in the latest block. Corresponds to a vector. When the latest acceleration data is added to the acceleration history data 77 in step S51, the number of detected acceleration vectors Va (1) to Va (n) shown in FIG. 22 increases by one. In step S52, the block average vector Vav (40) of the latest block is calculated. Therefore, the block average vector Vav (40) of the latest block is not necessarily the average of the 40 detected acceleration vectors Va. If it is determined in step S53 that the number of detected acceleration vectors Va (1) to Va (n) has reached 40, each block is updated in step S54. That is, the block average vector Vav (1) of the oldest block is deleted. Then, in steps S51 and S52 executed in the next processing loop, a block average vector of a new block is calculated.

図21の説明に戻り、ステップS55において、CPU10は、各ブロック平均ベクトルVavおよび加速度履歴データ77に含まれる各加速度ベクトルを、ジャイロセンサ55および56によって検出された角速度に応じて回転させる。具体的には、CPU10は、メインメモリに記憶されている角速度データ63、加速度履歴データ77、およびブロック平均データ78を読み出す。そして、各ブロック平均ベクトルVavおよび加速度履歴データ77に含まれる各加速度ベクトルを、角速度の回転方向とは逆方向に角速度の大きさだけ回転するように補正する。CPU10は、補正後の各ブロック平均ベクトルVavを示すデータを、ブロック平均データ78としてメインメモリに記憶し、補正後の加速度履歴データ77に含まれる各加速度ベクトルによって加速度履歴データ77も更新する。ここで、各ブロック平均ベクトルVavおよび各加速度ベクトルが示すベクトルは、入力装置8を基準として(XYZ座標系によって)表される。そのため、当該ベクトルを空間に対して固定とする(空間における方向が変化しないようにする)ためには、入力装置8が回転した分だけベクトルの方向を元に戻す(入力装置8の回転方向とは逆に回転させる)必要がある。このように、ステップS55の処理は、各ブロック平均ベクトルVavおよび各加速度ベクトルが示すベクトルの方向を、現在の姿勢に応じた正しい方向へと補正するための処理である。ステップS55の次にステップS56の処理が実行される。   Returning to the description of FIG. 21, in step S55, the CPU 10 rotates each block average vector Vav and each acceleration vector included in the acceleration history data 77 in accordance with the angular velocity detected by the gyro sensors 55 and 56. Specifically, the CPU 10 reads angular velocity data 63, acceleration history data 77, and block average data 78 stored in the main memory. Then, each block average vector Vav and each acceleration vector included in the acceleration history data 77 are corrected so as to rotate by the magnitude of the angular velocity in the direction opposite to the rotational direction of the angular velocity. The CPU 10 stores data indicating each corrected block average vector Vav in the main memory as the block average data 78, and also updates the acceleration history data 77 with each acceleration vector included in the corrected acceleration history data 77. Here, each block average vector Vav and the vector indicated by each acceleration vector are expressed with reference to the input device 8 (by the XYZ coordinate system). Therefore, in order to fix the vector with respect to the space (so that the direction in the space does not change), the vector direction is restored to the original amount corresponding to the rotation of the input device 8 (the rotation direction of the input device 8 and Need to be rotated in reverse). Thus, the process of step S55 is a process for correcting the direction of the vector indicated by each block average vector Vav and each acceleration vector to a correct direction according to the current posture. Following step S55, the process of step S56 is executed.

なお、本実施形態では、所定期間(約8秒)内の複数の検出加速度ベクトルをブロックにまとめて管理するので、上記ステップS55においては、CPU10は、ベクトルを回転させる計算処理をブロックの数(40個)だけ実行すればよい。これに対して、同数の検出加速度ベクトルをブロックで管理しない(そのまま記憶する)場合には、CPU10は、(1つのブロックにつき40個の検出加速度ベクトルが含まれるので)約1600個の検出加速度ベクトルのそれぞれに対してベクトルを回転させる計算処理を実行しなければならない。このように、本実施形態では、検出加速度ベクトルをブロックにまとめて管理することによって、ステップS55の計算処理の負担を軽減することができる。なお、他の実施形態において、ブロックの個数やブロック内の加速度ベクトルの個数は別の個数であってもよいし、特に計算処理の負担を軽減する必要がない場合には、全ての検出加速度ベクトルの平均を算出するようにしてもよい。   In the present embodiment, since a plurality of detected acceleration vectors within a predetermined period (about 8 seconds) are managed in blocks, in step S55, the CPU 10 performs a calculation process for rotating the vectors by the number of blocks ( 40). On the other hand, when the same number of detected acceleration vectors are not managed in blocks (stored as they are), the CPU 10 determines that about 1600 detected acceleration vectors (since 40 detected acceleration vectors are included in one block). A computational process must be performed to rotate the vector for each of. As described above, in the present embodiment, by managing the detected acceleration vectors in blocks, it is possible to reduce the calculation processing load in step S55. In other embodiments, the number of blocks and the number of acceleration vectors in the block may be different numbers, and all the detected acceleration vectors may be used when it is not particularly necessary to reduce the burden of calculation processing. You may make it calculate the average of.

ステップS56において、CPU10は、各ブロック平均ベクトルVavの平均である全平均ベクトルVallを算出する。すなわち、CPU10は、メインメモリに記憶されているブロック平均データ78を読み出す。ブロック平均データ78により示される各ブロック平均ベクトルVavはそれぞれ正規化される。さらに、CPU10は、全平均ベクトルVallとして、正規化された各ブロック平均ベクトルVavの平均を算出する。平均を算出する際、実際に全ての検出加速度ベクトルの平均を算出したものと同じ結果になるように、各ブロック平均ベクトルVavは、それに含まれる加速度ベクトルの数に応じた重み付けがされる。すなわち、最新のブロック以外のブロック(図22に示すVav(1)〜Vav(39)のブロック)については、ブロック内の加速度ベクトルの個数分である40倍の重み付けがされ、最新のブロック(図22に示すVav(40)のブロック)については、当該ブロック内の加速度ベクトルの現時点での個数に応じた重み付け(図22ではn個なので、n倍)がされる。そして、算出された全平均ベクトルVallを示すデータが、全平均データ69としてメインメモリに記憶される。ステップS56の次にステップS57の処理が実行される。   In step S56, the CPU 10 calculates a total average vector Vall that is an average of the block average vectors Vav. That is, the CPU 10 reads the block average data 78 stored in the main memory. Each block average vector Vav indicated by the block average data 78 is normalized. Further, the CPU 10 calculates the average of each normalized block average vector Vav as the total average vector Vall. When calculating the average, each block average vector Vav is weighted according to the number of acceleration vectors included in the block average vector Vav so that the same result as that obtained by actually calculating the average of all the detected acceleration vectors is obtained. That is, blocks other than the latest block (blocks Vav (1) to Vav (39) shown in FIG. 22) are weighted by 40 times that is the number of acceleration vectors in the block, and the latest block (FIG. (Vav (40) block shown in FIG. 22) is weighted according to the current number of acceleration vectors in the block (n times in FIG. 22 because it is n). Data indicating the calculated total average vector Vall is stored in the main memory as total average data 69. Following step S56, the process of step S57 is executed.

ステップS57において、CPU10は、重力ベクトルVgを全平均ベクトルVallに近づけるように補正する。具体的には、CPU10は、重力ベクトルVgを示す重力方向データ69と、全平均ベクトルVallを示す全平均データ79とをメインメモリから読み出す。そして、重力ベクトルVgを全平均ベクトルVallへと所定の度合C3で近づける補正を行う。この補正は、上記ステップS27と同様の方法で行うことができる。すなわち、CPU10は、補正前の重力ベクトルVgと全平均ベクトルVallとのなす角度をθ3[deg]とすると、全平均ベクトルVallの方向へ“C3・θ3[deg]”だけ補正前の重力ベクトルVgを回転させることによって、補正後の重力ベクトルVg’を算出する。なお、上記ステップS27と同様、補正後の重力ベクトルVg’の算出方法はどのような方法であってもよい。例えば、他の実施形態においては、補正前の重力ベクトルVgの終点から全平均ベクトルVallの終点までを結ぶ線分をC3:(1−C3)に内分する点を終点とするベクトルを算出し、算出されたベクトルを正規化することによって、補正後の重力ベクトルVg’を得るようにしてもよい。   In step S57, the CPU 10 corrects the gravity vector Vg so as to approach the total average vector Vall. Specifically, the CPU 10 reads out the gravity direction data 69 indicating the gravity vector Vg and the total average data 79 indicating the total average vector Vall from the main memory. Then, correction is performed so that the gravity vector Vg approaches the total average vector Vall at a predetermined degree C3. This correction can be performed by the same method as in step S27. That is, when the angle formed between the gravity vector Vg before correction and the total average vector Vall is θ3 [deg], the CPU 10 moves the gravity vector Vg before correction by “C3 · θ3 [deg]” in the direction of the total average vector Vall. Is rotated to calculate a corrected gravity vector Vg ′. As in step S27, any method may be used for calculating the corrected gravity vector Vg ′. For example, in another embodiment, a vector whose end point is a point that internally divides a line segment connecting the end point of the gravity vector Vg before correction to the end point of the total average vector Vall into C3: (1-C3) is calculated. The corrected gravity vector Vg ′ may be obtained by normalizing the calculated vector.

なお、本実施形態においては、上記ステップS57における所定の度合C3は、上記静的補正処理における第1補正度Aの最大値、および、上記動的補正処理における第2補正度Bの最大値に比べて、小さい値に設定される。たとえば、第1補正度Aの最大値は“0.03”であり(ステップS26の式(4)参照)、第2補正度Bの最大値は“0.03”である(ステップS31参照)のに対して、上記所定の度合C3は“0.001”に設定される。長期平均補正処理は、入力装置8の運動状態に依らずに補正を行う処理である一方、平均を算出する期間において加速度センサに加えられる運動により、当該期間内における運動加速度が完全にはに相殺されない場合があったり、誤差が含まれる場合があるという特徴を有する。すなわち、ある程度まで信頼できる補正を継続的に行うことができる一方で、厳密な補正を行うには適さないという特徴がある。したがって、本実施形態では、所定の度合C3を第1および第2補正度AおよびBの最大値に比べて小さく設定することによって、静的補正処理および動的補正処理に対して長期平均補正処理を補助的に用いている。これによって、長期平均補正処理による補正が不正確である場合に、当該補正が入力装置8の姿勢に大きく反映されることが防止される。したがって、結果として様々な状況においてゲーム装置3は入力装置8の姿勢を正確に補正・算出することができる。   In the present embodiment, the predetermined degree C3 in step S57 is the maximum value of the first correction degree A in the static correction process and the maximum value of the second correction degree B in the dynamic correction process. In comparison, it is set to a small value. For example, the maximum value of the first correction degree A is “0.03” (see equation (4) in step S26), and the maximum value of the second correction degree B is “0.03” (see step S31). On the other hand, the predetermined degree C3 is set to “0.001”. The long-term average correction process is a process for correcting without depending on the motion state of the input device 8. On the other hand, the motion acceleration in the period is completely canceled by the motion applied to the acceleration sensor in the period for calculating the average. In some cases, it may not be performed or an error may be included. That is, there is a feature that it is possible to continuously perform a reliable correction to some extent, but is not suitable for performing a strict correction. Therefore, in the present embodiment, by setting the predetermined degree C3 to be smaller than the maximum values of the first and second correction degrees A and B, the long-term average correction process is compared with the static correction process and the dynamic correction process. Is used as an auxiliary. Thus, when the correction by the long-term average correction process is inaccurate, the correction is prevented from being largely reflected in the attitude of the input device 8. Therefore, as a result, the game apparatus 3 can accurately correct and calculate the attitude of the input apparatus 8 in various situations.

上記ステップS57の処理によって得られた補正後の重力ベクトルVgを示すデータは、重力方向データ69としてメインメモリに記憶される。以上によって、長期平均補正処理において重力ベクトルVgの補正が行われたこととなる。上記ステップS57の後、CPU10は長期平均補正処理を終了する。   Data indicating the corrected gravity vector Vg obtained by the process of step S57 is stored in the main memory as gravity direction data 69. As described above, the gravity vector Vg is corrected in the long-term average correction process. After step S57, the CPU 10 ends the long-term average correction process.

図15の説明に戻り、ステップS14の次のステップS15において、CPU10は、静的補正処理、動的補正処理、および長期平均補正処理で補正された重力ベクトルに基づいて補正行列Maを算出する。補正行列Maは、入力装置8の第1の姿勢を補正するための回転行列である。具体的には、補正行列Maは、現在の入力装置8の第1の姿勢から決められる重力方向を、静的補正処理、動的補正処理、および長期平均補正処理で補正された重力ベクトルVgが表す方向と一致するように回転させる回転行列である。ここで、現在の入力装置8の第1の姿勢から決められる重力方向は、上記空間座標系における重力方向(0,−1,0)をコントローラ座標系に変換したベクトル、すなわち、(0,−1,0)を第1姿勢行列M1(上式(1)参照)で回転させたベクトル(−Xy,−Yy,−Zy)によって表される。   Returning to the description of FIG. 15, in step S15 following step S14, the CPU 10 calculates a correction matrix Ma based on the gravity vector corrected by the static correction process, the dynamic correction process, and the long-term average correction process. The correction matrix Ma is a rotation matrix for correcting the first attitude of the input device 8. Specifically, the correction matrix Ma indicates that the gravity vector Vg corrected by the static correction process, the dynamic correction process, and the long-term average correction process is the gravity direction determined from the first attitude of the current input device 8. This is a rotation matrix that is rotated so as to coincide with the direction to be represented. Here, the gravitational direction determined from the first orientation of the current input device 8 is a vector obtained by converting the gravitational direction (0, -1, 0) in the spatial coordinate system into the controller coordinate system, that is, (0,- 1,0) is represented by a vector (-Xy, -Yy, -Zy) obtained by rotating the first attitude matrix M1 (see the above equation (1)).

ステップS15の具体的な処理としては、CPU10はまず、メインメモリに記憶されている第1姿勢データ68を読み出し、第1姿勢データ68により示される第1姿勢行列M1を用いて、上記空間座標系における重力方向(0,−1,0)をコントローラ座標系に変換したベクトルVhを算出する。次に、CPU10は、メインメモリに記憶されている重力方向データ69を読み出し、上記ベクトルVhを、重力方向データ69により示される重力ベクトルVgに一致するように回転させる回転行列を補正行列Maとして算出する。算出された補正行列Maは、補正行列データ76としてメインメモリに記憶される。ステップS15の次にステップS16の処理が実行される。   As a specific process of step S15, the CPU 10 first reads the first attitude data 68 stored in the main memory, and uses the first attitude matrix M1 indicated by the first attitude data 68 to use the spatial coordinate system. A vector Vh obtained by converting the gravitational direction (0, −1, 0) in the controller coordinate system is calculated. Next, the CPU 10 reads the gravity direction data 69 stored in the main memory, and calculates a rotation matrix for rotating the vector Vh so as to coincide with the gravity vector Vg indicated by the gravity direction data 69 as the correction matrix Ma. To do. The calculated correction matrix Ma is stored in the main memory as correction matrix data 76. Following step S15, the process of step S16 is executed.

ステップS16において、CPU10は、入力装置8の第1の姿勢(第1姿勢行列M1)を補正行列Maで補正する。具体的には、メインメモリに記憶されている第1姿勢データ68および補正行列データ76を読み出し、第1姿勢データ68により示される補正前の第1姿勢行列M1を、補正行列データ76により示される補正行列Maで回転させることによって、補正後の第1姿勢行列M1’を算出する。なお、このとき、CPU10は、補正行列Maに所定の定数C2を掛け、補正量を調節するようにしてもよい。この定数C2は、0<C2≦1の範囲で予め定められており、例えばC2=0.3に設定される。補正後の第1姿勢行列M1’を示すデータが、新たな第1姿勢データ68としてメインメモリに記憶される。以上のステップS16によって、加速度に基づく補正処理において入力装置8の第1の姿勢が補正されたこととなる。ステップS16の後、CPU10は加速度に基づく補正処理を終了する。   In step S16, the CPU 10 corrects the first posture (first posture matrix M1) of the input device 8 with the correction matrix Ma. Specifically, the first attitude data 68 and the correction matrix data 76 stored in the main memory are read, and the first attitude matrix M1 before correction indicated by the first attitude data 68 is indicated by the correction matrix data 76. By rotating the correction matrix Ma, the corrected first posture matrix M1 ′ is calculated. At this time, the CPU 10 may adjust the correction amount by multiplying the correction matrix Ma by a predetermined constant C2. The constant C2 is predetermined in the range of 0 <C2 ≦ 1, and is set to C2 = 0.3, for example. Data indicating the corrected first posture matrix M <b> 1 ′ is stored in the main memory as new first posture data 68. Through the above step S16, the first posture of the input device 8 is corrected in the correction process based on the acceleration. After step S16, the CPU 10 ends the correction process based on the acceleration.

以上のように、加速度に基づく補正処理においては、静的補正処理(ステップS12)、動的補正処理(ステップS13)、および長期平均補正処理(ステップS14)において重力方向を補正し、補正後の重力方向を用いて入力装置8の第1の姿勢を補正した。このように、静的補正処理と動的補正処理との両方の補正処理を行うことによって、入力装置8が静止している場合であっても動かされている場合であっても、加速度センサ37の検出結果を用いて第1の姿勢を補正することができる。   As described above, in the correction process based on acceleration, the direction of gravity is corrected in the static correction process (step S12), the dynamic correction process (step S13), and the long-term average correction process (step S14). The first posture of the input device 8 was corrected using the direction of gravity. Thus, by performing both the static correction process and the dynamic correction process, the acceleration sensor 37 can be used regardless of whether the input device 8 is stationary or moved. The first posture can be corrected using the detection result.

また、本実施形態においては、上記静的補正処理および動的補正処理に加えて、長期平均補正処理(ステップS14)が実行される。上記静的補正処理および動的補正処理は、入力装置8の姿勢に対して補正が反映される度合が入力装置8の運動状態によって変化する補正処理である。そのため、入力装置8の運動状態によっては(例えば、上記加加速度Jが大きい状態が継続する場合等)、静的補正処理および動的補正処理のいずれもが行われない、または正確に行われないこともあり得る。これに対して、長期平均補正処理による補正は、入力装置8の運動状態に依らず常に一定の度合で入力装置の姿勢に対して反映される。したがって、長期平均補正処理を行うことによって、静的補正処理および動的補正処理の両方の補正が行われない場合であっても、継続的に入力装置8の姿勢を補正することができる。すなわち、長期平均補正処理によって、入力装置8の姿勢の補正を行う機会を増やすことができ、入力装置8の姿勢(重力方向)をより正確に算出することができる。   In the present embodiment, in addition to the static correction process and the dynamic correction process, a long-term average correction process (step S14) is executed. The static correction process and the dynamic correction process are correction processes in which the degree to which the correction is reflected on the attitude of the input device 8 varies depending on the motion state of the input device 8. Therefore, depending on the movement state of the input device 8 (for example, when the jerk J is large), neither the static correction process nor the dynamic correction process is performed or accurately performed. It can happen. On the other hand, the correction by the long-term average correction process is always reflected on the posture of the input device at a certain degree regardless of the motion state of the input device 8. Therefore, by performing the long-term average correction process, it is possible to continuously correct the attitude of the input device 8 even when both the static correction process and the dynamic correction process are not corrected. That is, the long-term average correction process can increase the opportunities for correcting the posture of the input device 8, and the posture (gravity direction) of the input device 8 can be calculated more accurately.

また、本実施形態では、角速度から算出される重力方向(入力装置8の姿勢)を加速度によって補正する処理として、ゲーム装置3は、相対的に短い期間内に取得された加速度データに基づいて算出される重力方向によって補正する処理と、相対的に長い期間内に取得された(複数の)加速度データに基づいて算出される重力方向によって補正する処理(長期平均補正処理)という、2種類の補正処理を行う。前者の処理は、最新の加速度データにより示される加速度の方向を重力方向として用いる静的補正処理、あるいは、加速度と角速度との予め定義された関係に基づいて最新の角速度データおよび加速度データから推定される重力方向を用いる動的補正処理である。一方、後者の処理は、所定期間における加速度の平均の方向を重力方向として用いる長期平均補正処理である。このように、本実施形態では、ゲーム装置3は、複数の異なる方法によって異なる重力方向を加速度データから算出する。そして、これら複数の重力方向を補正に反映させる割合(比率)を、入力装置8の状況(運動状態)に応じて変化させる。これによって、入力装置8が様々な状況になっても入力装置8の重力方向(姿勢)を補正することができる。   In the present embodiment, as a process of correcting the gravitational direction (posture of the input device 8) calculated from the angular velocity by acceleration, the game apparatus 3 calculates based on acceleration data acquired within a relatively short period. Two types of corrections: a process that corrects according to the direction of gravity that is performed, and a process that corrects based on the direction of gravity calculated based on (multiple) acceleration data acquired within a relatively long period (long-term average correction process) Process. The former process is estimated from the latest angular velocity data and acceleration data based on a static correction process using the direction of acceleration indicated by the latest acceleration data as the direction of gravity, or based on a predefined relationship between acceleration and angular velocity. Dynamic correction processing using the direction of gravity. On the other hand, the latter process is a long-term average correction process that uses the average direction of acceleration over a predetermined period as the direction of gravity. Thus, in this embodiment, the game apparatus 3 calculates different gravity directions from acceleration data by a plurality of different methods. And the ratio (ratio) which reflects these several gravitational directions in correction | amendment is changed according to the condition (motion state) of the input device 8. FIG. As a result, the gravity direction (posture) of the input device 8 can be corrected even when the input device 8 is in various situations.

図14の説明に戻り、ステップS5の次のステップS6において、CPU10は、前述した撮像画像に基づく補正処理を実行する。撮像画像に基づく補正処理は、撮像画像から得られるマーカ座標データを用いて入力装置8の第1の姿勢を補正する処理である。以下、図23を参照して、撮像画像に基づく補正処理の詳細を説明する。   Returning to the description of FIG. 14, in step S <b> 6 subsequent to step S <b> 5, the CPU 10 executes the correction process based on the above-described captured image. The correction process based on the captured image is a process of correcting the first posture of the input device 8 using marker coordinate data obtained from the captured image. Hereinafter, the details of the correction processing based on the captured image will be described with reference to FIG.

図23は、図14に示す撮像画像に基づく補正処理(ステップS6)の流れを示すフローチャートである。撮像画像に基づく補正処理においては、まずステップS61において、CPU10は、入力装置8の撮像手段(撮像素子40)によってマーカ部6が撮像されているか否かを判定する。ステップS61の判定は、メインメモリに記憶されているマーカ座標データ65を参照することによって行うことができる。ここでは、マーカ座標データ65が2つのマーカ座標を示す場合、マーカ部6が撮像されていると判定し、マーカ座標データ65が1つのマーカ座標のみを示す場合、または、マーカ座標がないことを示す場合、マーカ部6が撮像されていないと判定する。ステップS61の判定結果が肯定である場合、以降のステップS62〜S67の処理が実行される。一方、ステップS61の判定結果が否定である場合、以降のステップS62〜S67の処理がスキップされ、CPU10は、撮像画像に基づく補正処理を終了する。このように、撮像素子40によってマーカ部6が撮像されていない場合には、撮像素子40から得られるデータを用いて入力装置8の姿勢を算出することができないので、この場合には撮像画像に基づく補正処理において補正は行われない。   FIG. 23 is a flowchart showing the flow of the correction process (step S6) based on the captured image shown in FIG. In the correction process based on the captured image, first, in step S61, the CPU 10 determines whether or not the marker unit 6 has been imaged by the imaging means (imaging element 40) of the input device 8. The determination in step S61 can be made by referring to the marker coordinate data 65 stored in the main memory. Here, when the marker coordinate data 65 indicates two marker coordinates, it is determined that the marker unit 6 is captured, and when the marker coordinate data 65 indicates only one marker coordinate, or there is no marker coordinate. When it shows, it determines with the marker part 6 not being imaged. If the determination result of step S61 is affirmative, the processes of subsequent steps S62 to S67 are executed. On the other hand, when the determination result of step S61 is negative, the processes of subsequent steps S62 to S67 are skipped, and the CPU 10 ends the correction process based on the captured image. Thus, when the marker unit 6 is not imaged by the image sensor 40, the orientation of the input device 8 cannot be calculated using data obtained from the image sensor 40. No correction is performed in the correction process based on the above.

ステップS62において、CPU10は、マーカ座標データに基づいてロール姿勢成分M3rを算出する。ロール姿勢成分M3rは、撮像画像内でのマーカ部6の向きに基づいて、すなわち、マーカ座標データ65により示される2つのマーカ座標を結ぶ線の傾きに基づいて算出される。以下、図24を参照して、ロール姿勢成分M3rの算出方法の例を説明する。   In step S62, the CPU 10 calculates a roll posture component M3r based on the marker coordinate data. The roll posture component M3r is calculated based on the orientation of the marker unit 6 in the captured image, that is, based on the slope of the line connecting the two marker coordinates indicated by the marker coordinate data 65. Hereinafter, an example of a method for calculating the roll posture component M3r will be described with reference to FIG.

図24は、撮像画像に対応する2次元座標を示す図である。図24に示されるように、本実施形態においては、撮像画像における位置を表すための2次元座標系(x’y’座標系)は、撮像画像の範囲を−1≦x’≦1、−1≦y’≦1で表すものとする。x’y’座標系は、入力装置8が基準姿勢(入力装置8の撮像方向がマーカ部6の中央を向き、かつ、コントローラ5のボタン面が鉛直上向きとなる姿勢)にある場合に、撮像画像において鉛直下向きがy’軸正方向となり、右向きがx’軸正方向となるように設定されるものとする。また、図24に示す点P1および点P2はマーカ座標の位置を示し、点P3は点P1と点P2との中点である。図24に示すベクトルv10は、点P1を始点とし、点P2を終点とするベクトルである。   FIG. 24 is a diagram illustrating two-dimensional coordinates corresponding to a captured image. As shown in FIG. 24, in the present embodiment, a two-dimensional coordinate system (x′y ′ coordinate system) for representing a position in a captured image has a range of the captured image of −1 ≦ x ′ ≦ 1, − 1 ≦ y ′ ≦ 1. The x′y ′ coordinate system captures images when the input device 8 is in a reference posture (an orientation in which the imaging direction of the input device 8 faces the center of the marker unit 6 and the button surface of the controller 5 is vertically upward). In the image, it is assumed that the vertically downward direction is the positive direction of the y ′ axis and the right direction is the positive direction of the x ′ axis. Further, the points P1 and P2 shown in FIG. 24 indicate the positions of the marker coordinates, and the point P3 is a midpoint between the points P1 and P2. A vector v10 illustrated in FIG. 24 is a vector having a point P1 as a start point and a point P2 as an end point.

ロール姿勢成分M3rを算出するために、CPU10はまず、マーカ座標データ65を読み出し、当該マーカ座標データ65により示される2つのマーカ座標から上記ベクトルv10を算出する。さらに、ベクトルv10を正規化したベクトル(hx,hy)を算出する。このベクトル(hx,hy)は、入力装置8が上記基準姿勢にある場合にx軸正方向を向き、入力装置8のロール方向の回転に応じて向きが変化する。ベクトル(hx,hy)がロール方向の姿勢に対応しているので、ロール姿勢成分M3rは、このベクトル(hx,hy)に基づいて算出することができる。具体的には、CPU10は、次の式(16)に従ってロール姿勢成分M3rを算出する。

Figure 0005630969
上式(16)によって算出された行列を示すデータは、ロール姿勢成分データ80としてメインメモリに記憶される。ステップS62の次にステップS63の処理が実行される。 In order to calculate the roll posture component M3r, the CPU 10 first reads the marker coordinate data 65, and calculates the vector v10 from the two marker coordinates indicated by the marker coordinate data 65. Further, a vector (hx, hy) obtained by normalizing the vector v10 is calculated. The vector (hx, hy) is directed in the positive x-axis direction when the input device 8 is in the reference posture, and the direction changes according to the rotation of the input device 8 in the roll direction. Since the vector (hx, hy) corresponds to the posture in the roll direction, the roll posture component M3r can be calculated based on the vector (hx, hy). Specifically, the CPU 10 calculates the roll posture component M3r according to the following equation (16).
Figure 0005630969
Data indicating the matrix calculated by the above equation (16) is stored in the main memory as roll posture component data 80. Following step S62, the process of step S63 is executed.

ステップS63において、CPU10は、マーカ座標データに基づいてヨー姿勢成分M3yを算出する。ヨー姿勢成分M3yは、撮像画像内でのマーカ部6の向きおよび位置に基づいて算出される。以下、図24を参照して、ヨー姿勢成分M3yの算出方法の例を説明する。   In step S63, the CPU 10 calculates a yaw posture component M3y based on the marker coordinate data. The yaw posture component M3y is calculated based on the orientation and position of the marker unit 6 in the captured image. Hereinafter, an example of a method for calculating the yaw posture component M3y will be described with reference to FIG.

まず、CPU10は、マーカ座標データ65を読み出し、当該マーカ座標データ65により示される2つのマーカ座標の中点を算出する。本実施形態では、マーカ部6の位置として当該中点の位置を用いる。さらに、CPU10は、算出された中点の座標を、x’y’座標系の原点を中心として、入力装置8のロール方向に関する回転角度だけ(入力装置8の回転方向とは逆方向に)回転させた座標(px,py)を算出する。換言すれば、中点の座標は、原点を中心として、上記ベクトル(hx,hy)がx軸正方向を向くように回転される。入力装置8が水平方向(x軸方向)に関してマーカ部6と同じ位置(すなわち、マーカ部6の正面の位置)にあるとすれば、上記のようにして得られた回転後の座標(px,py)から、ヨー方向に関する姿勢を算出することができる。   First, the CPU 10 reads the marker coordinate data 65 and calculates the midpoint between the two marker coordinates indicated by the marker coordinate data 65. In the present embodiment, the position of the middle point is used as the position of the marker unit 6. Further, the CPU 10 rotates the calculated midpoint coordinates by the rotation angle related to the roll direction of the input device 8 (in the direction opposite to the rotation direction of the input device 8) around the origin of the x′y ′ coordinate system. Calculated coordinates (px, py) are calculated. In other words, the coordinates of the midpoint are rotated around the origin so that the vector (hx, hy) faces the positive x-axis direction. If the input device 8 is at the same position as the marker unit 6 in the horizontal direction (x-axis direction) (that is, the front position of the marker unit 6), the coordinates (px, py) can be used to calculate the attitude related to the yaw direction.

次に、CPU10は、上記中点の回転後の座標(px,py)と、マーカ部6がx’軸方向の端に位置する場合のヨー方向の角度(限界角度)θy’とに基づいて、ヨー方向に関する回転角度θyを算出する。ここで、上記限界角度θy’と、上記限界角度θy1となる場合における上記中点の回転後のx座標値px’とは予め求めておくことができる。したがって、pxとpx’との比が、θyとθy’との比に等しくなることを用いて、ヨー方向に関する回転角度θyを算出することができる。具体的には、ヨー方向に関する回転角度θyは、次の式(17)によって算出することができる。
θy=px×θy’/px’ …(17)
なお、マーカ部6の水平方向の長さを無視する場合、上記限界角度θy’は、コントローラ5の画角の1/2とし、上記px’の値は“1”とすることができる。
Next, the CPU 10 based on the coordinates (px, py) after the rotation of the midpoint and the angle (limit angle) θy ′ in the yaw direction when the marker unit 6 is located at the end in the x′-axis direction. Then, the rotation angle θy related to the yaw direction is calculated. Here, the limit angle θy ′ and the x-coordinate value px ′ after the rotation of the midpoint when the limit angle θy1 is reached can be obtained in advance. Therefore, the rotation angle θy related to the yaw direction can be calculated using the fact that the ratio between px and px ′ is equal to the ratio between θy and θy ′. Specifically, the rotation angle θy related to the yaw direction can be calculated by the following equation (17).
θy = px × θy ′ / px ′ (17)
When the horizontal length of the marker unit 6 is ignored, the limit angle θy ′ can be set to ½ of the angle of view of the controller 5 and the value of px ′ can be set to “1”.

最後に、CPU10は、上式(17)により算出された角度θyの回転を行う回転行列をヨー姿勢成分M3yとして算出する。具体的には、ヨー姿勢成分M3yは次の式(18)によって算出される。

Figure 0005630969
上式(18)によって算出された行列を示すデータが、ヨー姿勢成分データ81としてメインメモリに記憶される。以上のステップS63の次にステップS64の処理が実行される。 Finally, the CPU 10 calculates a rotation matrix that rotates the angle θy calculated by the above equation (17) as the yaw attitude component M3y. Specifically, the yaw posture component M3y is calculated by the following equation (18).
Figure 0005630969
Data indicating the matrix calculated by the above equation (18) is stored in the main memory as yaw attitude component data 81. Following step S63, the process of step S64 is executed.

ステップS64において、CPU10は、ロール姿勢成分M3rとヨー姿勢成分M3yとを合成する。すなわち、メインメモリからロール姿勢成分データ80およびヨー姿勢成分データ81を読み出し、各データ80および81により示されるロール姿勢成分M3rとヨー姿勢成分M3yとを積算する。ステップS64の次にステップS65の処理が実行される。   In step S64, the CPU 10 combines the roll posture component M3r and the yaw posture component M3y. That is, the roll posture component data 80 and the yaw posture component data 81 are read from the main memory, and the roll posture component M3r and the yaw posture component M3y indicated by the data 80 and 81 are integrated. Following step S64, the process of step S65 is executed.

ステップS65において、CPU10は、第1の姿勢に基づいてピッチ姿勢成分M3pを算出する。なお、本実施形態の処理とは異なるが、ピッチ姿勢成分M3pについても、ヨー姿勢成分M3yと同様の方法で、上記座標(px,py)のy座標値に基づいて算出することが可能である。ただし、上記座標(px,py)を用いてヨー方向(ピッチ方向)の姿勢を算出する方法は、入力装置8が水平方向(ピッチ方向の場合は鉛直方向)に関してマーカ部6と同じ位置にあることを前提として成り立つ方法である。本実施形態のゲームシステム1においては、プレイヤは、水平方向に関してマーカ部6(テレビ2)のほぼ正面の位置で入力装置8を操作すると考えられるので、「入力装置8が水平方向に関してマーカ部6と同じ位置にある」ことを前提して、上記ステップS63の方法によってヨー方向の姿勢を算出することが可能である。一方、プレイヤは、立って入力装置8を操作することも座って入力装置8を操作することも考えられ、また、マーカ部6の位置もテレビ2の画面の上側に配置されることも下側に配置されることも考えられる。そのため、本実施形態のゲームシステム1においては、「入力装置8が鉛直方向に関してマーカ部6と同じ位置にある」ことを必ずしも前提にできないため、上記座標(px,py)を用いてピッチ方向の姿勢を算出することを行わないようにしてもよい。   In step S65, the CPU 10 calculates a pitch posture component M3p based on the first posture. Although different from the processing of the present embodiment, the pitch attitude component M3p can also be calculated based on the y coordinate value of the coordinates (px, py) in the same manner as the yaw attitude component M3y. . However, in the method of calculating the attitude in the yaw direction (pitch direction) using the coordinates (px, py), the input device 8 is at the same position as the marker unit 6 in the horizontal direction (vertical direction in the case of the pitch direction). This method is based on the assumption. In the game system 1 of the present embodiment, it is considered that the player operates the input device 8 at a position substantially in front of the marker unit 6 (TV 2) in the horizontal direction. It is possible to calculate the orientation in the yaw direction by the method of step S63 on the assumption that “the same position”. On the other hand, it is conceivable that the player stands and operates the input device 8 or sits down and operates the input device 8, and the position of the marker unit 6 is also arranged on the upper side of the screen of the television 2. It is also possible to arrange them in For this reason, in the game system 1 of the present embodiment, it is not necessarily assumed that “the input device 8 is in the same position as the marker unit 6 in the vertical direction”. The posture may not be calculated.

そこで、本実施形態においては、ピッチ姿勢成分M3pについては、加速度に基づく補正(ステップS5)後の姿勢をそのまま用いることとする(したがって、撮像画像に基づく補正処理においては、ピッチ方向に関しては補正が行われない)。具体的には、CPU10は、メインメモリから第1姿勢データ68を読み出す。そして、第1姿勢データ68により示される第1姿勢行列M1の各要素を用いて、ピッチ方向に関する回転角度θpを、次の式(19)に従って算出する。
cos(θp)=(Zx×Zx+Zz×Zz)1/2
sin(θp)=Zy …(19)
上式(19)における変数Zx,Zy,Zzは、上式(1)において示した第1姿勢行列M1の要素である。なお、ここで用いられる第1姿勢行列M1は、今回の処理ループにおいて加速度に基づく補正処理(ステップS5)が行われた後の第1姿勢行列M1である。さらに、CPU10は、上式(19)で算出したcos(θp)およびsin(θp)を用いて、次の式(20)に従ってピッチ姿勢成分M3pの行列を算出する。

Figure 0005630969
上式(20)によって算出された行列を示すデータが、ピッチ姿勢成分データ82としてメインメモリに記憶される。以上のステップS65の次にステップS66の処理が実行される。 Therefore, in this embodiment, for the pitch posture component M3p, the posture after the correction based on acceleration (step S5) is used as it is (therefore, in the correction processing based on the captured image, the pitch direction is corrected). Not done). Specifically, the CPU 10 reads the first attitude data 68 from the main memory. Then, using each element of the first posture matrix M1 indicated by the first posture data 68, the rotation angle θp with respect to the pitch direction is calculated according to the following equation (19).
cos (θp) = (Zx × Zx + Zz × Zz) 1/2
sin (θp) = Zy (19)
Variables Zx, Zy, and Zz in the above equation (19) are elements of the first posture matrix M1 shown in the above equation (1). Note that the first posture matrix M1 used here is the first posture matrix M1 after the correction processing based on acceleration (step S5) is performed in the current processing loop. Further, the CPU 10 calculates a matrix of the pitch posture component M3p according to the following equation (20) using cos (θp) and sin (θp) calculated by the above equation (19).
Figure 0005630969
Data indicating the matrix calculated by the above equation (20) is stored in the main memory as pitch attitude component data 82. Following step S65, the process of step S66 is executed.

ステップS66において、CPU10は、ロール方向、ヨー方向、およびピッチ方向の各姿勢成分に基づいて第3姿勢行列M3を算出する。第3姿勢行列M3は、ロール姿勢成分M3rとヨー姿勢成分M3yとの合成結果に、ピッチ姿勢成分M3pをさらに合成することによって得られる。具体的には、CPU10は、メインメモリからピッチ姿勢成分データ82を読み出し、当該ピッチ姿勢成分データ82により示されるピッチ姿勢成分M3pを、ステップS64で算出された行列に積算する。積算の結果得られた第3姿勢行列M3を示すデータは、第3姿勢データ83としてメインメモリに記憶される。ステップS66の次にステップS67の処理が実行される。   In step S66, the CPU 10 calculates a third posture matrix M3 based on the posture components in the roll direction, the yaw direction, and the pitch direction. The third attitude matrix M3 is obtained by further synthesizing the pitch attitude component M3p with the synthesis result of the roll attitude component M3r and the yaw attitude component M3y. Specifically, the CPU 10 reads the pitch attitude component data 82 from the main memory, and integrates the pitch attitude component M3p indicated by the pitch attitude component data 82 in the matrix calculated in step S64. Data indicating the third posture matrix M <b> 3 obtained as a result of the integration is stored in the main memory as third posture data 83. Following step S66, the process of step S67 is executed.

ステップS67において、CPU10は、第3姿勢行列M3を用いて入力装置8の第1の姿勢(第1姿勢行列M1)を補正する。ステップS67における補正は、第1姿勢行列M1を第3姿勢行列M3に所定の割合(下記の定数C4)で近づけることによって行われる。CPU10は、メインメモリから第1姿勢データ68および第3姿勢データ83を読み出す。そして、第1姿勢データ68により示される第1姿勢行列M1と、第3姿勢データ83により示される第3姿勢行列M3とを用いて、次の式(21)に従って補正を行う。
M1=(M3−M1’)×C4+M1’ …(21)
上式(21)において、変数M1’は補正前の第1姿勢行列である。また、定数C4は、0<C4≦1の範囲で予め設定され、例えば0.1に設定される。上式(21)によって算出された補正後の第1姿勢行列M1を示すデータが、新たな第1姿勢データ68としてメインメモリに記憶される。上記ステップS67の後、CPU10は撮像画像に基づく補正処理を終了する。
In step S67, the CPU 10 corrects the first posture (first posture matrix M1) of the input device 8 using the third posture matrix M3. The correction in step S67 is performed by bringing the first posture matrix M1 closer to the third posture matrix M3 at a predetermined ratio (the following constant C4). The CPU 10 reads the first attitude data 68 and the third attitude data 83 from the main memory. Then, using the first attitude matrix M1 indicated by the first attitude data 68 and the third attitude matrix M3 indicated by the third attitude data 83, correction is performed according to the following equation (21).
M1 = (M3-M1 ′) × C4 + M1 ′ (21)
In the above equation (21), the variable M1 ′ is the first posture matrix before correction. The constant C4 is preset in the range of 0 <C4 ≦ 1, and is set to 0.1, for example. Data indicating the corrected first posture matrix M1 calculated by the above equation (21) is stored in the main memory as new first posture data 68. After step S67, the CPU 10 ends the correction process based on the captured image.

以上のように、撮像画像に基づく補正処理においては、撮像画像に基づく第3の姿勢を算出し、角速度に基づく第1の姿勢を第3の姿勢に近づけるように補正することとした。この補正によって、第1の姿勢をより正確な値となるように補正することができる。なお、本実施形態においては、ロール方向およびヨー方向の姿勢についてのみ撮像画像から第3の姿勢を算出したが、上述のように、ピッチ方向についても撮像画像から第3の姿勢を算出することは可能であり、他の実施形態においては、ロール方向、ヨー方向、およびピッチ方向について撮像画像から第3の姿勢を算出してもよい。また、撮像画像に基づく補正処理においては、ロール方向、ヨー方向、およびピッチ方向のうち少なくとも1方向について第3の姿勢を算出すればよい。   As described above, in the correction process based on the captured image, the third posture based on the captured image is calculated, and the first posture based on the angular velocity is corrected so as to approach the third posture. By this correction, the first posture can be corrected to be a more accurate value. In the present embodiment, the third posture is calculated from the captured image only for the posture in the roll direction and the yaw direction. However, as described above, the third posture is calculated from the captured image also in the pitch direction. In other embodiments, the third orientation may be calculated from the captured image in the roll direction, the yaw direction, and the pitch direction. In the correction process based on the captured image, the third posture may be calculated in at least one of the roll direction, the yaw direction, and the pitch direction.

なお、他の実施形態においては、撮像画像に基づく補正処理は、入力装置8がマーカ部6を撮像していると推測される場合にのみ、実行されるようにしてもよい。具体的には、CPU10は、撮像画像に基づく補正処理を実行する前に、入力装置8(撮像手段)がマーカ部6を撮像可能な向きを向いているか否かを判定する。この判定は、撮像画像に基づく補正処理を行う前の姿勢を用いて行うことができる。例えば、当該姿勢が、入力装置8の撮像方向が入力装置8からマーカ部6への向きに対して同じ向きかそれとも逆向きかを判定するようにしてもよい。また、上記の判定に用いられる姿勢は、前回の処理ループにおいて最終的に得られた姿勢であってもよいし、今回の処理ループにおいて加速度に基づく補正処理が行われた姿勢であってもよい。   In another embodiment, the correction process based on the captured image may be executed only when it is estimated that the input device 8 is capturing the marker unit 6. Specifically, the CPU 10 determines whether or not the input device 8 (imaging unit) faces a direction in which the marker unit 6 can be imaged before executing the correction process based on the captured image. This determination can be performed using the posture before performing the correction process based on the captured image. For example, the posture may be determined as to whether the imaging direction of the input device 8 is the same or opposite to the direction from the input device 8 to the marker unit 6. Further, the posture used for the above determination may be a posture finally obtained in the previous processing loop, or may be a posture in which correction processing based on acceleration is performed in the current processing loop. .

上記の判定の結果、CPU10は、入力装置8がマーカ部6を撮像可能な向きを向いていると判定される場合、撮像画像に基づく補正処理を実行し、マーカ部6を撮像可能な向きを向いていないと判定される場合、撮像画像に基づく補正処理をスキップする。なお、マーカ部6でない物(例えば、部屋の電灯や窓の外の太陽光等)がマーカ部6と誤検出されることがあり、誤検出によって得られたマーカ座標を用いて第3の姿勢が算出される場合、かかる第3の姿勢を用いて補正処理を行っても正しく補正を行うことができない。これに対して、上記の判定処理を行うことにより、誤検出によって得られたマーカ座標から算出される第3の姿勢を用いて補正処理が行われることを防止することができる。これによって、撮像画像に基づく補正処理を正しく行うことができる。   As a result of the above determination, when it is determined that the input device 8 faces the direction in which the marker unit 6 can be imaged, the CPU 10 executes a correction process based on the captured image and sets the direction in which the marker unit 6 can be imaged. When it is determined that it is not suitable, the correction process based on the captured image is skipped. Note that an object that is not the marker unit 6 (for example, an electric lamp in a room or sunlight outside a window) may be erroneously detected as the marker unit 6, and the third posture is obtained using the marker coordinates obtained by the erroneous detection. Is calculated, correct correction cannot be performed even if correction processing is performed using the third posture. On the other hand, by performing the above determination process, it is possible to prevent the correction process from being performed using the third posture calculated from the marker coordinates obtained by the erroneous detection. Thereby, the correction process based on the captured image can be correctly performed.

図14の説明に戻り、ステップS6の次のステップS7において、CPU10は、補正後の入力装置8の姿勢(第1姿勢行列M1)を用いたゲーム処理を実行する。本実施形態では、ゲーム空間内に配置されるカヌーのパドルの姿勢を、入力装置8の姿勢に応じて制御する処理が実行される。さらに、パドルの動きに応じてカヌーを移動させる処理が実行される。なお、他の実施形態においては、ゲーム処理は、補正後の入力装置8の姿勢を表す第1姿勢行列M1を入力値としてゲーム結果に反映させる処理であればどのような処理であってもよい。例えば、仮想のゲーム空間内のオブジェクトを、第1姿勢行列M1により示される姿勢となるように制御して表示する処理であってもよいし、第1姿勢行列M1により示される姿勢と所定の姿勢との角度に応じた速度で上記オブジェクトを移動させるように制御して表示する処理であってもよい。ステップS7の次にステップS8の処理が実行される。   Returning to the description of FIG. 14, in step S <b> 7 following step S <b> 6, the CPU 10 executes a game process using the corrected posture of the input device 8 (first posture matrix M <b> 1). In the present embodiment, a process of controlling the posture of the canoe paddle arranged in the game space according to the posture of the input device 8 is executed. Furthermore, a process of moving the canoe according to the movement of the paddle is executed. In other embodiments, the game process may be any process as long as the first attitude matrix M1 representing the corrected attitude of the input device 8 is reflected in the game result as an input value. . For example, it may be a process of controlling and displaying an object in the virtual game space so as to have the posture indicated by the first posture matrix M1, or the posture indicated by the first posture matrix M1 and a predetermined posture. It may be a process of controlling and displaying the object so as to move at a speed according to the angle. Following step S7, the process of step S8 is executed.

ステップS8において、CPU10は、ゲームを終了するか否かを判定する。ステップS8の判定は、例えば、ゲームがクリアされたか否か、ゲームオーバーとなったか否か、プレイヤがゲームを中止する指示を行ったか否か等によって行われる。ステップS8の判定結果が否定である場合、ステップS3の処理が再度実行される。以降、ステップS8でゲームを終了すると判定されるまで、ステップS3〜S8の処理ループが繰り返し実行される。一方、ステップS8の判定結果が肯定である場合、CPU10は、図14に示すゲーム処理を終了する。以上で、ゲーム処理の説明を終了する。   In step S8, the CPU 10 determines whether or not to end the game. The determination in step S8 is made based on, for example, whether or not the game has been cleared, whether or not the game is over, and whether or not the player has given an instruction to stop the game. If the determination result of step S8 is negative, the process of step S3 is executed again. Thereafter, the processing loop of steps S3 to S8 is repeatedly executed until it is determined in step S8 that the game is to be ended. On the other hand, if the determination result of step S8 is affirmative, the CPU 10 ends the game process shown in FIG. This is the end of the description of the game process.

以上のように、本実施形態においては、ジャイロセンサ55および56によって検出された角速度から入力装置8の第1の姿勢を算出し(ステップS4)、第1の姿勢を加速度に基づく補正処理(S5)および撮像画像に基づく補正処理(S6)によって補正した。そして、補正後の第1の姿勢を用いてゲーム処理を実行する(ステップS7)ので、CPU10は、入力装置8の正確な姿勢に基づいたゲーム処理を実行することができる。これによれば、例えば、入力装置8の姿勢をゲーム空間内のオブジェクトの姿勢に対して正確に反映させることができるので、ゲーム操作の操作性を向上することができる。   As described above, in the present embodiment, the first posture of the input device 8 is calculated from the angular velocities detected by the gyro sensors 55 and 56 (step S4), and the first posture is corrected based on acceleration (S5). ) And correction processing (S6) based on the captured image. Since the game process is executed using the corrected first attitude (step S7), the CPU 10 can execute the game process based on the accurate attitude of the input device 8. According to this, for example, the posture of the input device 8 can be accurately reflected on the posture of the object in the game space, so that the operability of the game operation can be improved.

[変形例]
なお、上記実施形態においては、動的補正処理によって補正された重力ベクトルは、ジャイロセンサ55および56が検出した角速度に基づいて算出された入力装置8の姿勢を補正するために用いられた。つまり、上記実施形態においては、ゲーム装置3は、動的補正処理よりも先に算出された入力装置8の第1の姿勢を上記重力ベクトルを用いて補正することによって、入力装置8の姿勢を算出するものであった。ここで、上記重力ベクトルは、先に算出された姿勢を補正するために用いられる必要はなく、入力装置8の姿勢を算出するために用いられればよい。例えば、他の実施形態においては、ゲーム装置3は、次の(1)〜(4)の処理によって入力装置8の姿勢を算出することも可能である。
(1)検出加速度ベクトルVaに基づいて重力ベクトルVgを算出する(検出加速度ベクトルVaを重力ベクトルVgとする)。
(2)上記ステップS24と同様の方法で、重力ベクトルVgと検出加速度ベクトルVaとに基づいて運動加速度ベクトルVAを算出する。
(3)上記動的補正処理と同様の処理によって重力ベクトルVgを補正する。
(4)補正された重力ベクトルVgに対応する入力装置8の姿勢を算出する。
上記(1)〜(4)の処理によれば、ジャイロセンサ55および56が検出した角速度等から先に入力装置8の姿勢を算出しなくとも、動的補正処理によって補正された重力ベクトルに基づいて入力装置8の姿勢を算出することができる。
[Modification]
In the above embodiment, the gravity vector corrected by the dynamic correction process is used to correct the attitude of the input device 8 calculated based on the angular velocity detected by the gyro sensors 55 and 56. That is, in the above embodiment, the game apparatus 3 corrects the first attitude of the input device 8 calculated prior to the dynamic correction process using the gravity vector, thereby changing the attitude of the input apparatus 8. It was to calculate. Here, the gravity vector need not be used to correct the previously calculated posture, but may be used to calculate the posture of the input device 8. For example, in another embodiment, the game apparatus 3 can calculate the attitude of the input apparatus 8 by the following processes (1) to (4).
(1) A gravity vector Vg is calculated based on the detected acceleration vector Va (the detected acceleration vector Va is set as the gravity vector Vg).
(2) The motion acceleration vector VA is calculated based on the gravity vector Vg and the detected acceleration vector Va by the same method as in step S24.
(3) The gravity vector Vg is corrected by a process similar to the dynamic correction process.
(4) The attitude of the input device 8 corresponding to the corrected gravity vector Vg is calculated.
According to the processes (1) to (4) described above, based on the gravity vector corrected by the dynamic correction process without calculating the attitude of the input device 8 from the angular velocities detected by the gyro sensors 55 and 56 first. Thus, the attitude of the input device 8 can be calculated.

また、上記実施形態においては、動的補正処理において補正の対象となる重力ベクトルを、角速度データ63から算出される第1の姿勢に基づいて算出した。ここで、他の実施形態においては、動的補正処理において補正の対象となる重力ベクトルは、入力装置8が備える各種センサの出力(すなわち、操作データ)を用いて算出されればよく、例えば上記(1)の処理のように、検出加速度ベクトルVaを用いて算出されてもよい。また、動的補正処理において補正の対象となる重力ベクトルの算出方法は、動的補正処理における補正方法とは異なる方法であれば、どのような方法であってもよい。   In the above embodiment, the gravity vector to be corrected in the dynamic correction process is calculated based on the first posture calculated from the angular velocity data 63. Here, in another embodiment, the gravity vector to be corrected in the dynamic correction process may be calculated using outputs (that is, operation data) of various sensors included in the input device 8. It may be calculated using the detected acceleration vector Va as in the process (1). In addition, the calculation method of the gravity vector to be corrected in the dynamic correction process may be any method as long as it is different from the correction method in the dynamic correction process.

また、上記実施形態においては、重力方向(重力ベクトル)を算出した後、算出した重力方向に基づいて入力装置8の姿勢を算出した。ここで、重力方向は、入力装置8の姿勢を表すものであるので、他の実施形態においては、重力方向とは別に姿勢を算出せずに、重力方向(重力ベクトル)自体を入力装置8の姿勢として用いてもよい。   Moreover, in the said embodiment, after calculating the gravity direction (gravity vector), the attitude | position of the input device 8 was calculated based on the calculated gravity direction. Here, since the gravitational direction represents the attitude of the input device 8, in other embodiments, the gravitational direction (gravity vector) itself is used as the input device 8 without calculating the attitude separately from the gravitational direction. It may be used as a posture.

以上のように、本発明は、ジャイロセンサを用いて入力装置の姿勢を正確に算出すること等を目的として、例えば入力装置の姿勢に応じたゲーム処理を行うゲーム装置またはゲームプログラム等として利用することが可能である。   As described above, the present invention is used, for example, as a game device or a game program for performing game processing according to the posture of the input device, for example, for accurately calculating the posture of the input device using a gyro sensor. It is possible.

1 ゲームシステム
2 テレビ
3 ゲーム装置
4 光ディスク
5 コントローラ
6 マーカ部
7 ジャイロセンサユニット
8 入力装置
10 CPU
11c GPU
11e 内部メインメモリ
12 外部メインメモリ
37 加速度センサ
55 2軸ジャイロセンサ
56 1軸ジャイロセンサ
60 ゲームプログラム
61 姿勢算出プログラム
63 角速度データ
64 加速度データ
68 第1姿勢データ
69 重力方向データ
74 運動加速度データ
DESCRIPTION OF SYMBOLS 1 Game system 2 Television 3 Game device 4 Optical disk 5 Controller 6 Marker part 7 Gyro sensor unit 8 Input device 10 CPU
11c GPU
11e Internal main memory 12 External main memory 37 Acceleration sensor 55 2-axis gyro sensor 56 1-axis gyro sensor 60 Game program 61 Attitude calculation program 63 Angular velocity data 64 Acceleration data 68 First attitude data 69 Gravity direction data 74 Motion acceleration data

Claims (16)

角速度センサと加速度センサとを少なくとも備えた入力装置から角速度データと加速度データとを逐次取得し、当該入力装置から見た重力方向を表す重力ベクトルを逐次算出する姿勢算出装置であって、
前記角速度データが示す角速度に基づいて前記重力ベクトルを算出する重力ベクトル算出手段と、
前記加速度データが示す加速度ベクトルの方向へ第1の度合で近づくように前記重力ベクトルを補正する第1補正手段と、
前記入力装置が所定の回転運動を行う場合において、前記加速度データに基づいて得られる運動加速度ベクトルと前記角速度データに基づいて得られる角速度ベクトルが垂直になる関係から推定される重力方向へ第2の度合で近づくように前記重力ベクトルを補正する第2補正手段と、
所定期間における前記加速度ベクトルの平均の方向へ第3の度合で近づくように前記重力ベクトルを補正する第3補正手段とを備える、姿勢算出装置。
An attitude calculation device that sequentially acquires angular velocity data and acceleration data from an input device including at least an angular velocity sensor and an acceleration sensor, and sequentially calculates a gravity vector representing a gravity direction viewed from the input device,
Gravity vector calculating means for calculating the gravity vector based on the angular velocity indicated by the angular velocity data;
First correction means for correcting the gravity vector so as to approach the direction of the acceleration vector indicated by the acceleration data at a first degree;
In no event where the input device performs a predetermined rotary motion, to the direction of gravity and motion acceleration vector obtained based on the acceleration data and the angular velocity vector obtained based on the angular velocity data is estimated from the relation of the vertical Second correction means for correcting the gravity vector so as to approach the second degree;
An attitude calculation device comprising: a third correction unit that corrects the gravity vector so as to approach the average direction of the acceleration vectors in a predetermined period at a third degree.
前記第1補正手段は、前記加速度データが示す加速度の大きさが重力加速度の大きさに近いほど高くなるように前記第1の度合を設定する、請求項1記載の姿勢算出装置。   The posture calculation apparatus according to claim 1, wherein the first correction unit sets the first degree so that an acceleration magnitude indicated by the acceleration data is closer to a gravitational acceleration magnitude. 前記入力装置の運動による加速度を表す運動加速度ベクトルを前記加速度データと前記重力ベクトルとに基づいて算出する運動加速度算出手段をさらに備え、
前記第2補正手段は、前記角速度データが示す角速度と前記運動加速度ベクトルとが前記関係を満たす状態に対応する重力ベクトルへ前記第2の度合で近づくように前記重力ベクトルを補正する、請求項1または請求項2に記載の姿勢算出装置。
A motion acceleration calculating means for calculating a motion acceleration vector representing acceleration due to motion of the input device based on the acceleration data and the gravity vector;
The said 2nd correction | amendment means correct | amends the said gravity vector so that the angular velocity which the said angular velocity data and the said motion acceleration vector may approach to the gravity vector corresponding to the state which satisfy | fills the said relationship in the said 2nd degree. Or the attitude | position calculation apparatus of Claim 2.
前記第3補正手段は、前記第1の度合の最大値および前記第2の度合の最大値よりも低い値に前記第3の度合を設定する、請求項1から請求項3のいずれか1項に記載の姿勢算出装置。   4. The device according to claim 1, wherein the third correction unit sets the third degree to a value lower than the maximum value of the first degree and the maximum value of the second degree. 5. The posture calculation device described in 1. 前記第1補正手段は、前記加速度データおよび前記角速度データの少なくとも1つに応じて前記第1の度合を変化させ、
前記第2補正手段は、前記加速度データおよび前記角速度データの少なくとも1つに応じて前記第2の度合を変化させ、
前記第3補正手段は、前記第3の度合を固定値として設定する、請求項1から請求項4のいずれか1項に記載の姿勢算出装置。
The first correction means changes the first degree according to at least one of the acceleration data and the angular velocity data,
The second correction means changes the second degree according to at least one of the acceleration data and the angular velocity data,
The posture calculation apparatus according to any one of claims 1 to 4, wherein the third correction unit sets the third degree as a fixed value.
取得された加速度データを逐次記憶する加速度データ記憶手段と、
複数の加速度データを1つのブロックとして、ブロックに含まれる各加速度データが示す加速度ベクトルの平均となるブロック平均ベクトルを算出するブロック平均算出手段とをさらに備え、
前記第3補正手段は、新しいものから順に所定数のブロックのブロック平均ベクトルの平均となる全平均ベクトルの方向へ前記第3の度合で近づくように前記重力ベクトルを補正する、請求項1から請求項5のいずれか1項に記載の姿勢算出装置。
Acceleration data storage means for sequentially storing the acquired acceleration data;
A block average calculating means for calculating a block average vector that is an average of acceleration vectors indicated by each acceleration data included in the block as a plurality of acceleration data;
The said 3rd correction | amendment means correct | amends the said gravity vector so that it may approach in the said 3rd degree in the direction of the total average vector used as the average of the block average vector of a predetermined number of blocks in order from a new thing. Item 6. The attitude calculation device according to any one of items 5 to 6.
前記ブロック平均ベクトルそれぞれに対して、前記角速度データが示す角速度と逆方向の回転を加える更新を行う更新手段をさらに備え、
前記第3補正手段は、前記更新手段による更新後の前記ブロック平均ベクトルを用いて前記全平均ベクトルを算出する、請求項6に記載の姿勢算出装置。
Update means for updating each block average vector by adding rotation in the direction opposite to the angular velocity indicated by the angular velocity data;
The posture calculation apparatus according to claim 6, wherein the third correction unit calculates the total average vector using the block average vector updated by the update unit.
角速度センサと加速度センサとを少なくとも備えた入力装置から角速度データと加速度データとを逐次取得し、当該入力装置から見た重力方向を表す重力ベクトルを逐次算出する姿勢算出装置のコンピュータにおいて実行される姿勢算出プログラムであって、
前記角速度データが示す角速度に基づいて前記重力ベクトルを算出する重力ベクトル算出手段と、
前記加速度データが示す加速度ベクトルの方向へ第1の度合で近づくように前記重力ベクトルを補正する第1補正手段と、
前記入力装置が所定の回転運動を行う場合において、前記加速度データに基づいて得られる運動加速度ベクトルと前記角速度データに基づいて得られる角速度ベクトルが垂直になる関係から推定される重力方向へ第2の度合で近づくように前記重力ベクトルを補正する第2補正手段と、
所定期間における前記加速度ベクトルの平均の方向へ第3の度合で近づくように前記重力ベクトルを補正する第3補正手段として前記コンピュータを機能させる、姿勢算出プログラム。
Attitude executed by a computer of an attitude calculation device that sequentially acquires angular velocity data and acceleration data from an input device having at least an angular velocity sensor and an acceleration sensor, and sequentially calculates a gravity vector representing the direction of gravity viewed from the input device. A calculation program,
Gravity vector calculating means for calculating the gravity vector based on the angular velocity indicated by the angular velocity data;
First correction means for correcting the gravity vector so as to approach the direction of the acceleration vector indicated by the acceleration data at a first degree;
In no event where the input device performs a predetermined rotary motion, to the direction of gravity and motion acceleration vector obtained based on the acceleration data and the angular velocity vector obtained based on the angular velocity data is estimated from the relation of the vertical Second correction means for correcting the gravity vector so as to approach the second degree;
An attitude calculation program for causing the computer to function as third correction means for correcting the gravity vector so as to approach the average direction of the acceleration vectors in a predetermined period at a third degree.
前記第1補正手段は、前記加速度データが示す加速度の大きさが重力加速度の大きさに近いほど高くなるように前記第1の度合を設定する、請求項8記載の姿勢算出プログラム。   The posture calculation program according to claim 8, wherein the first correction means sets the first degree so that the magnitude of the acceleration indicated by the acceleration data becomes closer to the magnitude of the gravitational acceleration. 前記入力装置の運動による加速度を表す運動加速度ベクトルを前記加速度データと前記重力ベクトルとに基づいて算出する運動加速度算出手段として前記コンピュータをさらに機能させ、
前記第2補正手段は、前記角速度データが示す角速度と前記運動加速度ベクトルとが前記関係を満たす状態に対応する重力ベクトルへ前記第2の度合で近づくように前記重力ベクトルを補正する、請求項8または請求項9に記載の姿勢算出プログラム。
Causing the computer to further function as a motion acceleration calculating means for calculating a motion acceleration vector representing acceleration due to motion of the input device based on the acceleration data and the gravity vector;
The second correction means corrects the gravity vector so that the angular velocity indicated by the angular velocity data and the motion acceleration vector approach the gravity vector corresponding to a state satisfying the relationship in the second degree. Or the attitude | position calculation program of Claim 9.
前記第3補正手段は、前記第1の度合の最大値および前記第2の度合の最大値よりも低い値に前記第3の度合を設定する、請求項8から請求項10のいずれか1項に記載の姿勢算出プログラム。   11. The third correction unit according to claim 8, wherein the third correction unit sets the third degree to a value lower than the maximum value of the first degree and the maximum value of the second degree. The attitude calculation program described in 1. 前記第1補正手段は、前記加速度データおよび前記角速度データの少なくとも1つに応じて前記第1の度合を変化させ、
前記第2補正手段は、前記加速度データおよび前記角速度データの少なくとも1つに応じて前記第2の度合を変化させ、
前記第3補正手段は、前記第3の度合を固定値として設定する、請求項8から請求項11のいずれか1項に記載の姿勢算出プログラム。
The first correction means changes the first degree according to at least one of the acceleration data and the angular velocity data,
The second correction means changes the second degree according to at least one of the acceleration data and the angular velocity data,
The posture calculation program according to any one of claims 8 to 11, wherein the third correction unit sets the third degree as a fixed value.
取得された加速度データを逐次記憶する加速度データ記憶手段と、
複数の加速度データを1つのブロックとして、ブロックに含まれる各加速度データが示す加速度ベクトルの平均となるブロック平均ベクトルを算出するブロック平均算出手段として前記コンピュータをさらに機能させ、
前記第3補正手段は、新しいものから順に所定数のブロックのブロック平均ベクトルの平均となる全平均ベクトルの方向へ前記第3の度合で近づくように前記重力ベクトルを補正する、請求項8から請求項12のいずれか1項に記載の姿勢算出プログラム。
Acceleration data storage means for sequentially storing the acquired acceleration data;
The computer is further functioned as a block average calculating means for calculating a block average vector that is an average of acceleration vectors indicated by each acceleration data included in the block as a plurality of acceleration data.
The said 3rd correction | amendment means correct | amends the said gravity vector so that it may approach in the said 3rd degree to the direction of the total average vector used as the average of the block average vector of a predetermined number of blocks in order from a new thing. Item 13. The attitude calculation program according to any one of item 12 above.
前記ブロック平均ベクトルそれぞれに対して、前記角速度データが示す角速度と逆方向の回転を加える更新を行う更新手段として前記コンピュータをさらに機能させ、
前記第3補正手段は、前記更新手段による更新後の前記ブロック平均ベクトルを用いて前記全平均ベクトルを算出する、請求項13に記載の姿勢算出プログラム。
Further causing the computer to function as an update means for performing an update that adds rotation in the direction opposite to the angular velocity indicated by the angular velocity data for each of the block average vectors,
The attitude calculation program according to claim 13, wherein the third correction unit calculates the total average vector using the block average vector updated by the updating unit.
角速度センサと加速度センサとを少なくとも備えた入力装置から角速度データと加速度データとを逐次取得し、当該入力装置から見た重力方向を表す重力ベクトルを逐次算出する姿勢算出システムであって、  An attitude calculation system that sequentially acquires angular velocity data and acceleration data from an input device including at least an angular velocity sensor and an acceleration sensor, and sequentially calculates a gravity vector representing a gravity direction viewed from the input device,
前記角速度データが示す角速度に基づいて前記重力ベクトルを算出する重力ベクトル算出手段と、  Gravity vector calculating means for calculating the gravity vector based on the angular velocity indicated by the angular velocity data;
前記加速度データが示す加速度ベクトルの方向へ第1の度合で近づくように前記重力ベクトルを補正する第1補正手段と、  First correction means for correcting the gravity vector so as to approach the direction of the acceleration vector indicated by the acceleration data at a first degree;
前記入力装置が所定の回転運動を行う場合において、前記加速度データに基づいて得られる運動加速度ベクトルと前記角速度データに基づいて得られる角速度ベクトルとが垂直になる関係から推定される重力方向へ第2の度合で近づくように前記重力ベクトルを補正する第2補正手段と、  When the input device performs a predetermined rotational motion, the second direction in the gravity direction estimated from the relationship in which the motion acceleration vector obtained based on the acceleration data and the angular velocity vector obtained based on the angular velocity data are perpendicular to each other. Second correction means for correcting the gravity vector so as to approach the degree of
所定期間における前記加速度ベクトルの平均の方向へ第3の度合で近づくように前記重力ベクトルを補正する第3補正手段とを備える、姿勢算出システム。  And a third correction unit that corrects the gravity vector so as to approach the average direction of the acceleration vectors in a predetermined period at a third degree.
角速度センサと加速度センサとを少なくとも備えた入力装置から角速度データと加速度データとを逐次取得し、当該入力装置から見た重力方向を表す重力ベクトルを逐次算出する情報処理装置において実行される姿勢算出方法であって、  Posture calculation method executed in an information processing apparatus that sequentially acquires angular velocity data and acceleration data from an input device having at least an angular velocity sensor and an acceleration sensor, and sequentially calculates a gravity vector representing the direction of gravity viewed from the input device Because
前記角速度データが示す角速度に基づいて前記重力ベクトルを算出する重力ベクトル算出ステップと、  A gravity vector calculating step for calculating the gravity vector based on the angular velocity indicated by the angular velocity data;
前記加速度データが示す加速度ベクトルの方向へ第1の度合で近づくように前記重力ベクトルを補正する第1補正ステップと、  A first correction step of correcting the gravity vector so as to approach the direction of the acceleration vector indicated by the acceleration data by a first degree;
前記入力装置が所定の回転運動を行う場合において、前記加速度データに基づいて得られる運動加速度ベクトルと前記角速度データに基づいて得られる角速度ベクトルとが垂直になる関係から推定される重力方向へ第2の度合で近づくように前記重力ベクトルを補正する第2補正ステップと、  When the input device performs a predetermined rotational motion, the second direction in the gravity direction estimated from the relationship in which the motion acceleration vector obtained based on the acceleration data and the angular velocity vector obtained based on the angular velocity data are perpendicular to each other. A second correction step for correcting the gravity vector so as to approach the degree of
所定期間における前記加速度ベクトルの平均の方向へ第3の度合で近づくように前記重力ベクトルを補正する第3補正ステップとを備える、姿勢算出方法。  And a third correction step of correcting the gravity vector so as to approach the average direction of the acceleration vector in a predetermined period at a third degree.
JP2009115156A 2008-06-30 2009-05-12 Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method Active JP5630969B2 (en)

Priority Applications (3)

Application Number Priority Date Filing Date Title
JP2009115156A JP5630969B2 (en) 2009-05-12 2009-05-12 Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method
EP09163725.6A EP2140917B1 (en) 2008-06-30 2009-06-25 Orientation calculation apparatus and storage medium having orientation calculation program stored therein
US12/493,434 US8219347B2 (en) 2008-06-30 2009-06-29 Orientation calculation apparatus and storage medium having orientation calculation program stored therein

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2009115156A JP5630969B2 (en) 2009-05-12 2009-05-12 Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method

Publications (2)

Publication Number Publication Date
JP2010263930A JP2010263930A (en) 2010-11-25
JP5630969B2 true JP5630969B2 (en) 2014-11-26

Family

ID=43361489

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2009115156A Active JP5630969B2 (en) 2008-06-30 2009-05-12 Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method

Country Status (1)

Country Link
JP (1) JP5630969B2 (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5893254B2 (en) * 2011-03-24 2016-03-23 Kddi株式会社 Portable device, program and method for correcting gravity vector used for autonomous positioning
JP5875069B2 (en) * 2012-03-22 2016-03-02 任天堂株式会社 GAME SYSTEM, GAME PROCESSING METHOD, GAME DEVICE, AND GAME PROGRAM
JP6044099B2 (en) 2012-04-02 2016-12-14 カシオ計算機株式会社 Attitude detection apparatus, method, and program
JP2013213744A (en) 2012-04-02 2013-10-17 Casio Comput Co Ltd Device, method and program for detecting attitude
EP2687955B1 (en) * 2012-07-20 2018-08-22 Nintendo Co., Ltd. Information processing program, information processing system and attitude calculation method for calculating an attitude of an input unit
JP6519578B2 (en) * 2016-12-27 2019-05-29 カシオ計算機株式会社 Posture detection apparatus and posture detection method
WO2019026099A1 (en) * 2017-07-31 2019-02-07 株式会社石野サーキット Fall detection means, fall alarm means, and fall report means
KR102150973B1 (en) * 2019-05-22 2020-09-02 포항공과대학교 산학협력단 Method and apparatus for providing excercise information

Also Published As

Publication number Publication date
JP2010263930A (en) 2010-11-25

Similar Documents

Publication Publication Date Title
JP5630969B2 (en) Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method
JP5060798B2 (en) Information processing program and information processing apparatus
JP4265814B1 (en) Posture calculation device, posture calculation program, game device, and game program
JP4918376B2 (en) Information processing program and information processing apparatus
US8749490B2 (en) Orientation calculation apparatus, storage medium having orientation calculation program stored therein, game apparatus, and storage medium having game program stored therein
US7925467B2 (en) Orientation calculation apparatus, storage medium having orientation calculation program stored therein, game apparatus, and storage medium having game program stored therein
EP2140919B1 (en) Orientation calculation apparatus, storage medium having orientation calculation program stored therein, game apparatus, and storage medium having game program stored therein
JP5005627B2 (en) Information processing program and information processing apparatus
JP5872137B2 (en) Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method
JP5525177B2 (en) Information processing program and information processing apparatus
JP2010207329A (en) Coordinate calculation device and coordinate calculation program
JP5541851B2 (en) Posture calculation device, posture calculation program, game device, and game program
JP5455191B2 (en) Posture calculation apparatus, posture calculation program, posture calculation system, and posture calculation method
JP5872136B2 (en) Posture calculation device, posture calculation program, game device, game program, posture calculation system, and posture calculation method
JP6042394B2 (en) Coordinate calculation apparatus and coordinate calculation program
EP2140917B1 (en) Orientation calculation apparatus and storage medium having orientation calculation program stored therein
JP5669294B2 (en) Coordinate calculation apparatus and coordinate calculation program
JP5424400B2 (en) Information processing apparatus, information processing program, information processing system, and display range control method
JP5872135B2 (en) Posture calculation device, posture calculation program, game device, game program, posture calculation system, and posture calculation method
JP6280390B2 (en) Information processing program, information processing apparatus, information processing system, and information processing method
JP6262563B2 (en) Information processing program, information processing apparatus, information processing system, and information processing method
JP5420955B2 (en) GAME DEVICE AND GAME PROGRAM

Legal Events

Date Code Title Description
RD04 Notification of resignation of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7424

Effective date: 20111019

RD02 Notification of acceptance of power of attorney

Free format text: JAPANESE INTERMEDIATE CODE: A7422

Effective date: 20111104

A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20120404

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20131203

A521 Request for written amendment filed

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20140131

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20140929

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20141007

R150 Certificate of patent or registration of utility model

Ref document number: 5630969

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R150

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250