WO2018010521A1 - 一种控制服务机器人跳舞的方法和装置 - Google Patents

一种控制服务机器人跳舞的方法和装置 Download PDF

Info

Publication number
WO2018010521A1
WO2018010521A1 PCT/CN2017/088725 CN2017088725W WO2018010521A1 WO 2018010521 A1 WO2018010521 A1 WO 2018010521A1 CN 2017088725 W CN2017088725 W CN 2017088725W WO 2018010521 A1 WO2018010521 A1 WO 2018010521A1
Authority
WO
WIPO (PCT)
Prior art keywords
command
dance
control
song
service robot
Prior art date
Application number
PCT/CN2017/088725
Other languages
English (en)
French (fr)
Inventor
张亮
Original Assignee
歌尔股份有限公司
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 歌尔股份有限公司 filed Critical 歌尔股份有限公司
Priority to US16/301,055 priority Critical patent/US10828784B2/en
Publication of WO2018010521A1 publication Critical patent/WO2018010521A1/zh

Links

Images

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J11/00Manipulators not otherwise provided for
    • B25J11/003Manipulators for entertainment
    • B25J11/0035Dancing, executing a choreography
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J11/00Manipulators not otherwise provided for
    • B25J11/008Manipulators for service tasks
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1656Programme controls characterised by programming, planning systems for manipulators
    • B25J9/1664Programme controls characterised by programming, planning systems for manipulators characterised by motion, path, trajectory planning

Definitions

  • the present invention relates to the field of service robot technology, and in particular, to a method and apparatus for controlling service robot dancing.
  • Service-type robots such as companion robots and entertainment robots, can provide services such as storytelling, singing, and dancing.
  • the present invention provides a method and apparatus for controlling the dancing of a service robot to solve the problem of poor user experience caused by the limited preset action of the existing music entertainment robot.
  • an embodiment of the present invention provides a method for controlling a service robot to dance, setting a corresponding part control command for a predetermined action of each part of the service robot, and setting a dance control order indicating a number of command transmission times of the part control command and a command transmission interval.
  • Strategy also includes:
  • the randomly selected part control command is sent to the corresponding part of the service robot until the number of command transmissions of the dance control policy is reached, and the control service robot follows the song to dance. .
  • an embodiment of the present invention further provides a device for controlling a service robot to dance, the device comprising:
  • a storage unit configured to store a part control command corresponding to a predetermined action of each part of the service robot, and store a dance control strategy for setting a command transmission number and a command transmission interval indicating the part control command;
  • a connecting unit configured to establish a wireless connection with a speaker located outside the service robot when receiving the dance start command
  • a loading unit configured to load a song from a song library of the service robot when receiving the dance start command, and determine that the song currently loaded by the service robot is consistent with the song to be played by the external speaker;
  • a selection unit for selecting a dance control policy used by the service robot from the storage unit according to the song Slightly, and determine the timing of the command transmission command of the part control command of the dance control strategy;
  • a control unit configured to play the song in the external speaker, and when the command transmission timing of the dance control strategy arrives, send a randomly selected part control command to the corresponding part of the service robot until the command transmission number of the dance control strategy is reached, and the service robot is controlled Follow the song to dance.
  • the present invention controls the time point of randomly sending a command to the corresponding part of the service robot and the number of command transmissions on the basis of setting the part control command and the dance control strategy, so that the service robot follows the song and dances, thereby A complete set of service robot dance control schemes is implemented.
  • the service robot of the present invention can cooperate with an external speaker, the robot dances with the music played by the speaker, which better simulates the scene of the human dance, is easy to resonate with the user, ensures the music effect, enhances the dance atmosphere, is suitable for the home, etc.
  • the present invention can also enable the service robot to follow the loaded songs to jump out of different dance poses, and the dance posture of the same song service robot is not the same, greatly enriching the dance action of the robot and improving the user experience.
  • FIG. 1 is a flowchart of a method for controlling a service robot to dance according to an embodiment of the present invention
  • FIG. 2 is a flowchart of a method for performing dance control on a service robot according to another embodiment of the present invention
  • FIG. 3 is a flowchart of a method for controlling a service robot to follow a song beat dance in a fixed dance mode according to another embodiment of the present invention
  • FIG. 4 is a flowchart of a method for controlling a service robot to follow a song beat and dance in a regular dance mode according to another embodiment of the present invention
  • FIG. 5 is a structural block diagram of an apparatus for controlling a service robot to dance according to still another embodiment of the present invention.
  • FIG. 6 is a schematic diagram showing the hardware structure of an apparatus for controlling dancing of a service robot according to an embodiment of the present invention.
  • FIG. 1 is a flowchart of a method for controlling a service robot to dance according to an embodiment. As shown in FIG. 1 , the method includes the following steps:
  • a corresponding part control command is set for a predetermined action of each part of the service robot, and a dance control policy indicating the number of command transmissions of the part control command and the command transmission interval is set.
  • the present embodiment sets a corresponding part control command for a predetermined action of each movable part of the head, the body, the arm, the leg, and the like of the service robot before the control service robot dances;
  • the rotation action of the part can set corresponding head control commands for the horizontal rotation motion and the vertical rotation motion of the service robot head, and each head control command indicates the range of the head rotation, for example, the rotation angle can be rotated, or Rotate a random angle.
  • any two dance control strategies or command transmission interval is different, or the number of command transmissions is different, or the command transmission interval and the command transmission times are different.
  • setting the jump in step S100 The dance control strategy is specifically: setting the number of times the command to send the dance control strategy is a fixed value, or setting the number of times the command to send the dance control policy is a random value.
  • This embodiment can load various types of songs and dances from the song library of the service robot, and does not limit the file format of the loaded songs.
  • the currently loaded song can also be played directly by using the speaker of the service robot itself.
  • the present invention considers the performance limitation of the speaker of the service robot itself, and the playing effect is worse than that of the external speaker. Therefore, the present embodiment preferably uses the external speaker to play the loaded song. Among them, the external speakers that meet the relevant communication protocol can establish a connection with the service robot to play the song loaded by the service robot.
  • S120 Select a dance control strategy used by the service robot according to the loaded song, and determine a command transmission timing of the part control command of the selected dance control policy.
  • the tempo of the loaded song can be obtained, and the dance control strategy used by the service robot is selected according to the tempo of the song.
  • the present invention specifically describes the dance control strategy used by the service robot according to the tempo of the song.
  • the implementation scheme obviously can also store the correspondence between the song and the dance control strategy, and select the dance control strategy used by the service robot according to the correspondence relationship.
  • the corresponding part control command is sent to control the motor of the corresponding part of the service robot to complete a complete rotation sequence to achieve the desired control effect.
  • this embodiment since the service robot of the embodiment can cooperate with the external speaker, the robot dances with the music played by the speaker, and the scene of the human dance is better simulated, which is easy for the user to resonate, ensure the music effect, and enhance the dance atmosphere. It is suitable for home and other scenes.
  • this embodiment can also enable the service robot to follow the songs in real time to jump out of different dances according to the loaded songs, and the dance posture of the same song service robot is not the same, which greatly enriches the dance movements of the robot. , improved user experience.
  • a preferred embodiment of the present embodiment selects a dance control strategy used by the service robot according to the tempo of the song, so that during the process of playing the song, the service robot is controlled to follow the beat of the song.
  • the command transmission interval of the dance control strategy is preferably set in units of song beats, such as a command can be set.
  • the transmission interval is the length of time taken for half a beat, the duration of one beat, the duration of two beats, or the duration of three beats. It should be noted,
  • the command transmission interval of the dance control strategy should not be too long. The too long command transmission interval easily affects the dancing effect of the service robot and weakens the dance rhythm. The command transmission interval should not be too short, and the robot's tolerance to fast motion needs to be considered.
  • control commands :
  • the command transmission interval of the adjacent two parts control commands is greater than or equal to one beat; when the tempo of the song is less than the motor speed of the service robot, the two adjacent ones are determined.
  • the command transmission interval of the secondary part control command is less than one beat or the command transmission interval of the adjacent two part control commands is determined to be greater than or equal to one beat.
  • the command transmission interval of the adjacent two-part control command is determined.
  • the minimum time interval is satisfied as one beat; when the tempo of the song is greater than the first multiple motor speed, the command transmission interval of the two adjacent part control commands is determined to satisfy the minimum time interval of two beats; the tempo of the song is less than the second beat
  • the motor speed is multiplied, it is determined that the command transmission interval of the adjacent two-part control command satisfies the minimum time interval of half a beat; wherein the first multiple motor speed is greater than the second multiple motor speed.
  • a dance control strategy that satisfies the command transmission interval of the adjacent two-part control command is selected, and the command transmission timing of the first transmission of the part control command in the selected dance control policy is determined.
  • a dance control strategy with a command transmission interval of one beat or more than one beat may be randomly selected as the service robot.
  • the command transmission timing of the part control command of the selected dance control strategy is determined by the following method:
  • Determining a command transmission timing of the first transmission part control command in the selected dance control strategy starting from the command transmission timing of the first transmission part control command, and determining the next time according to the command transmission interval of the selected dance control policy
  • the command transmission timing of the transmission part control command is sent until the number of command transmissions of the selected dance control policy is reached.
  • the first effective beat of the song may be sent as the first command to send the part control command in the selected dance control strategy.
  • a song can correspond to a dance control strategy, it can also correspond to more than two dance control strategies.
  • the service robot is controlled to follow the song dance in accordance with each dance control strategy. Therefore, after the number of command transmissions of the selected dance control policy is reached, the preferred solution further determines whether the command transmission timing of the final transmission part control command of the current dance control policy is the end point of the song, if not the end of the song.
  • the command transmission timing of the dance control strategy wherein the command transmission interval of the dance control strategy after switching is different from that before the switching; if it is the playback end point of the song, switching to the song reset control strategy, determining the position control command indicated by the reset control policy, resetting
  • the part control command indicated by the control strategy restores the parts of the service robot to the posture before the dance or to the specified posture.
  • the part control command may be selected by using at least one of the following two methods:
  • Method 1 When a command transmission timing of the dance control strategy comes, randomly select a part control command, or randomly select two or more different parts of the position control command;
  • Manner 2 When the command transmission timing of the dance control strategy arrives, a part control command is selected according to the number of transmission orders of the part control command corresponding to the timing of the incoming command transmission, or two or more different part control commands are selected.
  • the dance control strategy can also be divided into multiple sub-control strategies, each of which includes a pre-control strategy and a post-control strategy with the same number of command transmissions; at this time, the corresponding location of the timing can be sent according to the incoming command. Control the number of transmission orders of the command, and determine the sub-control strategy to which the incoming command is sent:
  • the incoming command transmission timing belongs to the previous control strategy of the current sub-control strategy, randomly select a part control command, or select more than two parts control commands of different parts; when the incoming transmission timing belongs to the current sub-control strategy
  • the part control command corresponding to the action effect of the part control command corresponding to the previous control strategy is selected.
  • the part control command having the opposite action effect of the part control command corresponding to the previous control strategy may be selected.
  • a fixed position control command indicating that the body part of the service robot rotates is fixed, and a certain body part of the service robot is set.
  • the dance mode corresponding to the song is also parsed. If the song corresponds to the fixed dance mode, the dance control strategy in which the command transmission number is a fixed value is selected; if the song corresponds to the random dance mode Select a dance control strategy in which the number of command transmissions is a random number; if the song corresponds to a regular dance mode, select a dance control strategy in which the command number is a random number; if the song corresponds to a mixed dance mode, dance according to a fixed dance mode, a random dance mode, and a regular dance mode. A dance mode in the mode selects the dance control command.
  • the part control command can be selected by the following method:
  • the dance mode corresponding to the song is parsed. If the song corresponds to the fixed dance mode, when the command transmission timing of the dance control strategy comes, a fixed part control command is randomly selected, or two or more fixed part control commands of different parts are randomly selected.
  • the song corresponds to the random dance mode
  • the command timing of the dance control strategy arrives, randomly select a random part control command, or randomly select two or more different parts of the random part control Command.
  • the fixed order control command or the random part control command is selected according to the number of transmission order corresponding to the incoming command transmission timing, or two or more different ones are selected.
  • the part control command or the random part control command of the part that is, the sub-control policy to which the incoming command transmission timing belongs according to the number of transmission orders of the part control command corresponding to the arrival timing of the incoming command: when the incoming command transmission timing belongs to the current sub-control In the pre-control strategy of the strategy, randomly select a fixed part control command or a random part control command, or select two or more different parts of the fixed part control command or the random part control command; when the incoming transmission timing belongs to the current sub-control strategy In the post control strategy, the part control command corresponding to the action effect of the part control command corresponding to the previous control strategy is selected.
  • controlling the current dance control strategy selects the part control command according to one of the fixed dance mode, the random dance mode, and the regular dance mode.
  • a corresponding part control command is set in advance for a predetermined action of each part of the service robot, a dance control strategy for instructing the command transmission number of the part control command and the command transmission interval, and a dance mode corresponding to the song, and a dance mode indication part are set in advance.
  • the part control commands preset in this embodiment include a head control command, a body control command, a left arm control command, and a right arm control command.
  • Each part of the control command includes a fixed part control command and a random part control command.
  • the fixed part control command indicates that the angle of rotation of a certain body part of the service robot is fixed
  • the random part control command indicates that the angle of rotation of a certain body part of the service robot is random.
  • the head of the service robot can perform left-right rotation in the horizontal direction and up-and-down rotation in the vertical direction; the body of the service robot can perform left-right rotation in the horizontal direction; the arm of the service robot can Perform up and down rotation in the vertical direction.
  • the range of the left and right rotation of the head of the service robot is 15° in the horizontal direction, and the range of up and down rotation in the vertical direction is 10°.
  • the four fixed part control commands are the fixed part control command rotated 5° to the left, the fixed part control command rotated 5° to the right, the fixed part control command rotated upward by 5°, and the downward rotation by 5°.
  • the fixed part control command, the four random part control commands are a random part control command that randomly rotates 5° to 15° to the left, a random part control command that randomly rotates 5° to 15° to the right, and a random upward rotation 5 A random part control command of ° ⁇ 10° and a random part control command that rotates downward by 5° ⁇ 10°.
  • the range of the left and right rotation of the service robot in the horizontal direction is 15°.
  • the two fixed part control commands are respectively rotated to the left 3
  • the two random part control commands are random part control commands that are randomly rotated to the left by 3° to 15° and randomly rotated to the right by 3°. ⁇ 15° random part control command.
  • the left arm (or right arm) of the service robot rotates up and down in the vertical direction by 30°.
  • the left arm (or right arm) of the service robot includes two fixed part control commands and two random part control commands.
  • the fixed part control commands are a fixed part control command that rotates upward by 5° and a fixed part control command that rotates downward by 5°
  • the two random part control commands are random part control commands that are randomly rotated upward by 5° to 15°, respectively. Randomly rotate the random part control command from 5° to 15° downward.
  • the dance control strategy includes a dance control strategy that commands the transmission interval to be half a beat, a dance control strategy in which the command transmission interval is one beat, a dance control strategy in which the command transmission interval is two beats, and a dance control strategy in which the command transmission interval is three beats. A total of 4 types of dance control strategies are set.
  • the number of command transmissions for each dance control policy can be either a fixed value or a random value.
  • the dance control strategy can be divided into multiple sub-control strategies, and each sub-control strategy includes a pre-control strategy and a post-control strategy with the same number of command transmissions.
  • FIG. 2 is a flowchart of a method for performing dance control on a service robot according to an embodiment, where the method includes:
  • the service robot can receive the voice dancing start command sent by the user by means of voice interaction.
  • the control service robot sends a startup failure prompt tone to the user, and waits to receive the next dance start command; when the voice dance start command format or the right authority is correct, step S201 is performed.
  • control service robot establishes a wireless connection with the external speaker, and the service robot can establish a connection with the external speaker through a Bluetooth connection protocol, a Wifi connection protocol or a ZigBee connection protocol.
  • the robot loads songs from external audio sources.
  • the tempo in this embodiment requires the tempo of the loaded song to be determined by the metronome software provided by the third party.
  • step S201 may be performed first, and then step S202 may be performed, or step S202 may be performed first, then step S201 may be performed, or step S201 and step S202 may be performed at the same time.
  • step S203 comparing the tempo of the song with the motor rotation speed of each part of the service robot, and executing step S204 according to the comparison result.
  • Step S204 includes: if the tempo of the song is less than one motor speed and greater than 0.5 times the motor speed, step S2041 is performed; if the tempo of the song is greater than one motor speed, step S2042 is performed, if the tempo of the song is less than 0.5 times At speed, step S2043 is performed.
  • S2042 randomly select a dance control strategy from a dance control strategy in which the command transmission interval is two beats and the command transmission interval is three beats.
  • S2043 randomly select a dance control strategy from a dance control strategy in which the command transmission interval is half a beat, the command transmission interval is one beat, the command transmission interval is two beats, and the command transmission interval is three beats.
  • step S206 Determine whether the number of command transmissions of the current dance control policy is reached. If the number of command transmissions of the current dance control policy is reached, step S207 is performed, otherwise step S208 is performed.
  • step S207 Switch the dance control policy, and return to step S205; wherein the command transmission interval of the switched dance control policy is different from the command transmission interval of the dance control policy before the handover.
  • the method of FIG. 2 includes: upon reaching the end point of the playback of the song, transmitting a reset control command indicated by the reset control policy to each part of the server robot, restoring each part of the service robot to the posture before the dance or returning to the designated posture.
  • the dance mode corresponding to the song may also be parsed, and the service robot is controlled to follow the beat of the song according to the dance mode corresponding to the song.
  • the present embodiment separately illustrates the method for controlling the service robot to follow the song beat dance in the fixed dance mode and the control service in the regular dance mode through two specific implementation modes.
  • the robot follows the method of song beat dancing.
  • the method of controlling the service robot to follow the song beats and dances needs to establish a wireless connection with the speaker located outside the service robot when receiving the dance start command, load the song from the service robot's song library, and determine the service robot.
  • the currently loaded song matches the song that the external speaker is to play. That is, in the following two specific implementations of the embodiment, the steps S200 to S202 in FIG. 2 are performed. Therefore, in the following two specific implementations of the embodiment, the execution process is not described.
  • the method for controlling the service robot to follow the song beat dancing in the fixed dance mode is shown in FIG. 3.
  • the method in FIG. 3 includes:
  • Step S305 includes: if the tempo of the song is less than 1 times the motor speed, and is greater than 0.5 times the motor speed, step S3051 is performed; if the tempo of the song is greater than 1 times the motor speed, step S3052 is performed; if the tempo of the song is less than 0.5 times the motor At speed, step S3053 is performed.
  • S3051 randomly select a dance control strategy from a dance control strategy in which the command transmission interval is one beat, the command transmission interval is two beats, and the command transmission interval is three beats, and the command transmission times are fixed values.
  • S3052 randomly select a dance control strategy from a dance control strategy in which the command transmission interval is two beats and the command transmission interval is three beats, and the number of command transmissions is a fixed value.
  • the command sending interval is 1 beat
  • the number of command transmissions is 4 (or the number of command transmissions is 8, or the number of command transmissions is 12) the dance control strategy; it is also possible to select a dance control strategy with a command interval of 2 beats, a command transmission number of 2 (or a command transmission number of 4, or a command transmission number of 6, or a command transmission number of 8); You can also choose to send a dance control strategy with a command interval of 3 beats and a command transmission count of 1 (or the number of command transmissions is 2).
  • step S307. Determine whether the number of command transmissions of the current dance control policy is reached. If the number of command transmissions of the current dance control policy is reached, step S308 is performed, otherwise step S309 is performed.
  • step S308. Switch the dance control policy, and return to step S306; wherein the command transmission interval of the switched dance control policy is different from the command transmission interval of the dance control policy before the handover.
  • the command interval of the current dance control strategy is 1 beat
  • the number of command transmissions is 4.
  • the dance control strategy is switched, and the command transmission interval of the switched dance control policy is 2
  • the number of beats and command transmissions is 2 (or the number of command transmissions is 4, or the number of command transmissions is 6, or the number of command transmissions is 8); or, the command transmission interval of the switched dance control policy is 3 beats, and the number of command transmissions Is 1 (or the number of command sent is 2).
  • S309 randomly select a fixed part control command when the command transmission timing of the current dance control policy comes, or randomly select two or more fixed part control commands of different parts, and send the selected fixed part control command to the service.
  • the motor of the corresponding part of the robot controls the service robot to follow the song to dance.
  • the dance control of the service robot in the fixed dance mode is completed through steps S303 to S309.
  • the dance control method for the service robot in the random dance mode is basically the same as the control method in the fixed dance mode, except that in the random dance mode, the tempo according to the tempo of the song Comparison of motor speeds of various parts of the robot
  • the number of command transmissions of the selected dance control strategy is a random value; and when a command transmission timing of the current dance control strategy arrives, a random part is randomly selected. Control commands, or randomly select random part control commands for more than two different parts.
  • the method for controlling the service robot to follow the song beat dancing in the regular dance mode is shown in FIG. 4, and the method in FIG. 4 includes:
  • step S404 comparing the tempo of the song with the motor rotation speed of each part of the service robot, and executing step S405 according to the comparison result.
  • Step S405 includes: if the tempo of the song is less than 1 times the motor speed, and is greater than 0.5 times the motor speed, step S4051 is performed; if the tempo of the song is greater than 1 times the motor speed, step S4052 is performed; if the tempo of the song is less than 0.5 times the motor At speed, step S4053 is performed.
  • S4051 randomly select a dance control strategy from a dance control strategy in which the command transmission interval is one beat, the command transmission interval is two beats, and the command transmission interval is three beats, and the command transmission times are random values.
  • S4052 randomly select a dance control strategy from a dance control strategy in which the command transmission interval is two beats and the command transmission interval is three beats, and the command transmission times are random values.
  • You can also choose to send a dance control strategy with a command interval of 3 beats and a command transmission count of R N (N is a positive integer greater than or equal to 1, and less than or equal to 8).
  • a random factor value n is generated, and the command transmission number R of the dance control policy is determined according to the generated random factor value n.
  • step S407 judging the remaining command transmission times R' of the current dance control policy, if the remaining command transmission times R' ⁇ 1 of the current dance control policy, step S408 is performed, otherwise step S409 is performed.
  • step S408 switching the dance control strategy, and returning to step S406; wherein the command transmission interval of the switched dance control policy is different from the command transmission interval of the dance control policy before the handover.
  • the command transmission interval of the current dance control strategy is 1 beat
  • the value of the extraction factor M generated each time is not necessarily the same, as long as 1 ⁇ M ⁇ R' /2 is satisfied.
  • step S410 randomly selecting a fixed or random part control command when the command sending timing of the pre-control strategy comes, or randomly selecting two or more fixed or random part control commands of different parts, and sending the corresponding command to the corresponding part of the service robot
  • the motor arrives at the Mth command transmission timing of the previous control strategy; and after transmitting the part control command selected by the Mth command transmission timing to the motor of the corresponding part of the service robot, step S411 is performed.
  • step S413 when the command sending timing of the post-control strategy comes, select a part control command corresponding to the action effect of the part control command corresponding to the previous control policy, until the Mth command sending timing of the post-control policy arrives; After the part control command selected by the Mth command transmission timing of the control strategy is sent to the motor of the corresponding part of the service robot, step S413 is performed.
  • the part control command having the opposite action effect of the part control command corresponding to the previous control strategy may be selected.
  • the effect is a part control command that the head turns right by 8°, and when the second command transmission timing comes, the part control command whose action effect is 3° left turn and the part control command of the right arm up 5° are selected;
  • step S412 when the first command transmission timing of the post-control strategy comes, the part control command whose action effect is 8° left turn can be selected, and when the second command transmission timing arrives, the action effect can be selected as the body right. Turn the 3° part control command and the right arm down 5° part control command.
  • the remaining number of command transmissions R' R before the first sub-control strategy of the current dance control strategy is executed.
  • step S403 to step S413, the dance control of the service robot is completed in the regular dance mode, and the dance posture of the service robot can be controlled more regularly and coordinated in the regular dance mode.
  • an embodiment of the present invention also provides an apparatus for controlling the dancing of the service robot.
  • FIG. 5 is a structural block diagram of an apparatus for controlling a service robot to dance according to an embodiment of the present invention.
  • the apparatus 50 for controlling a service robot to dance includes:
  • the storage unit 51 is configured to store a part control command corresponding to a predetermined action of each part of the service robot, and store a dance control policy that sets a command transmission number indicating the part control command and a command transmission interval.
  • the connecting unit 52 is configured to establish a wireless connection with a speaker located outside the service robot when receiving the dance start command.
  • the loading unit 53 is configured to load a song from the song library of the service robot when receiving the dance start command, and determine that the song currently loaded by the service robot is consistent with the song to be played by the external speaker.
  • the selecting unit 54 is configured to select a dance control strategy used by the service robot from the storage unit 51 according to the song, and determine a command transmission timing of the part control command of the dance control policy.
  • the selecting unit 54 is configured to select a dance control strategy used by the service robot according to the tempo of the song; or the storage unit 51 is further configured to store a correspondence between the song and the dance control strategy, correspondingly The selecting unit 54 is configured to select a dance control strategy used by the service robot according to the correspondence relationship.
  • the selecting unit 54 includes: a command sending timing determining module;
  • the command sending timing determining module is configured to determine a command sending interval of the adjacent two parts control commands according to the relationship between the tempo of the song and the motor speed of each part of the service robot; wherein, when the tempo of the song is greater than or equal to the service robot The motor transmission speed determines that the command transmission interval of the adjacent two-part control command is greater than or equal to one beat; when the tempo of the song is less than the motor speed of the service robot, the command transmission interval of the adjacent two-part control command is determined to be less than one The beat, or the command transmission interval for determining the adjacent two part control commands is greater than or equal to one beat.
  • the tempo and motor speed comparison module determines that the command transmission interval of the adjacent two part control commands satisfies the minimum time interval when the tempo of the song is less than the first multiple motor speed and is greater than the second multiple motor speed. Beat; when the tempo of the song is greater than the first multiple motor speed, it is determined that the command transmission interval of the adjacent two-part control command satisfies the minimum time interval as two beats; when the tempo of the song is less than the second multiple motor speed, it is determined The command transmission interval of the adjacent two-part control command satisfies the minimum time interval of half a beat; wherein the first multiple motor speed is greater than the second multiple motor speed.
  • a command transmission timing determination module for selecting a command transmission interval that satisfies an adjacent two-part control command, determining a command transmission timing of the first transmission part control command in the selected dance control policy;
  • the command transmission timing of the transmission part control command is a starting point, and the command transmission timing of the next transmission part control command is determined according to the command transmission interval of the selected dance control policy until the command transmission number of the selected dance control policy is reached.
  • the command sending timing determining module is specifically configured to: when the tempo of the song is less than the first multiple motor speed, and greater than the second multiple motor speed, determine that the command sending interval of the adjacent two partial control commands meets the minimum time interval For one beat; when the tempo of the song is greater than the first multiple motor speed, the command transmission interval of the two adjacent part control commands is determined to satisfy the minimum time interval of two beats; when the tempo of the song is less than the second multiple motor speed The command transmission interval for determining the adjacent two-part control command satisfies the minimum time interval of half a beat; wherein the first multiple motor speed is greater than the second multiple motor speed.
  • the selection unit 54 of the embodiment further includes a dance control policy switching module
  • the dance control strategy switching module is configured to determine, after the number of command transmissions of the selected dance control policy, the command transmission timing of the last sent part control command of the current dance control policy is the end point of the song, if not for the song Playing the end point, switching the dance control strategy of the song, and re-determining the number of command transmission times, the command transmission interval, and the command transmission timing of the dance control policy after the switching by the command transmission timing determination module, wherein the command transmission interval of the dance control policy after the switching is Different before switching; if it is the end point of the song, switch to the song's reset control strategy, determine the reset control command indicated by the reset control strategy, and the reset control command restores the parts of the service robot to the pre-dancing posture or to the specified posture.
  • the control unit 55 is configured to play the song in the external speaker, and when the command transmission timing of the dance control strategy arrives, send the randomly selected part control command to the corresponding part of the service robot until the command transmission number of the dance control policy is reached, and the service robot is controlled.
  • the song to dance is configured to play the song in the external speaker, and when the command transmission timing of the dance control strategy arrives, send the randomly selected part control command to the corresponding part of the service robot until the command transmission number of the dance control policy is reached, and the service robot is controlled.
  • control unit 55 includes a part control command selection module
  • a part control command selection module for randomly selecting a part control command from the storage unit 51 when the command transmission timing of the dance control policy comes, or randomly selecting a part control of two or more different parts from the storage unit 51 Command; or,
  • a part control command selection module for selecting a part control command from the storage unit 51 according to the number of transmission orders of the part control command corresponding to the incoming command transmission timing, or selecting two or more different parts from the storage unit 51 control commands.
  • the dance control policy needs to be divided into a plurality of sub-control strategies in advance, and each sub-control strategy includes the number of command transmissions. The same pre-control strategy and post-control strategy.
  • the part control command selection module is configured to determine the sub-control policy to which the incoming command transmission timing belongs according to the number of transmission orders of the part control command corresponding to the timing of the incoming command, and when the incoming command transmission timing belongs to the current sub-control strategy In the pre-control strategy, a part control command is randomly selected from the storage unit 51, or two or more different part control commands are selected from the storage unit 51; when the incoming transmission timing belongs to the post-control of the current sub-control strategy At the time of the policy, the location control command corresponding to the action effect of the part control command corresponding to the previous control policy is selected from the storage unit 51.
  • the storage unit 51 further stores a skip mode indicating a selection mode of the part control command and/or the dance control policy.
  • the control unit 55 further includes a jump mode parsing module for parsing the dance mode corresponding to the song;
  • the part control command selection module is specifically configured to: if the dance mode of the dance mode parsing module parses the song is a fixed dance mode, when the command transmission timing of the dance control strategy arrives, a fixed part control command is randomly selected from the storage unit 51, Or randomly selecting two or more different parts of the fixed part control command; if the skip mode analysis module parses the dance mode of the song into a random dance mode, when the command transmission timing of the dance control policy comes, the storage unit 51 is randomly selected.
  • the jump mode analysis module parses the song's dance mode to the regular dance mode, the command timing of the dance control strategy is sent When the number of transmission orders corresponding to the timing of the incoming command is sent, the slave storage unit 51 Select a fixed part control command or random part control command, or select more than two different parts of the part control command or random part control command; if the jump mode analysis module parses the song's dance mode to the mixed dance mode, the current control The dance control strategy selects a part control command according to one of the fixed dance mode, the random dance mode, and the regular dance mode.
  • the device embodiment since it basically corresponds to the method embodiment, reference may be made to the partial description of the method embodiment.
  • the device embodiments described above are merely illustrative, wherein the units described as separate components may or may not be physically separate, and the components displayed as units may or may not be physical units, ie may be located A place, or it can be distributed to multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the solution of the embodiment. Those of ordinary skill in the art can understand and implement without any creative effort.
  • the device 50 for controlling the dancing of the service robot may be implemented by software, or may be implemented by hardware or a combination of hardware and software.
  • the machine executable instructions corresponding to the device 50 that controls the service robot dancing in the nonvolatile memory 40 can be read into the memory 60 by the processor 10.
  • the processor 10 From a hardware level, as shown in FIG. 6, a hardware structure diagram of the apparatus of the present invention, except for the processor 10, the internal bus 20, the network interface 30, the memory 60, and the non-volatile memory shown in FIG.
  • other hardware may be included according to the actual function of the network device, and details are not described herein again.
  • the non-volatile memory 40 may be: a storage drive (such as a hard drive), a solid state drive, any type of storage disk (such as a compact disc, a DVD, etc.), or a similar storage medium, or The combination.
  • the memory 60 may be a RAM (Radom Access Memory), a volatile memory, or a flash memory.

Landscapes

  • Engineering & Computer Science (AREA)
  • Robotics (AREA)
  • Mechanical Engineering (AREA)
  • Manipulator (AREA)
  • Toys (AREA)

Abstract

一种控制服务机器人跳舞的方法和装置。方法为服务机器人各部位的预定动作设置对应的部位控制命令,并设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略(S100);在接收到跳舞启动命令时,与位于服务机器人外部的音箱建立无线连接,从服务机器人的歌曲库中加载歌曲,确定服务机器人当前加载的歌曲与外部音箱所要播放的歌曲一致(S110);根据加载的歌曲选择服务机器人使用的跳舞控制策略,并确定所选择跳舞控制策略的部位控制命令的命令发送时机(S120);在外部音箱播放歌曲,且跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命令,直至达到跳舞控制策略的命令发送次数,控制服务机器人跟随所述歌曲跳舞(S130)。能够根据加载的歌曲实时控制服务机器人跟随歌曲跳出不同的舞姿,极大的丰富了服务机器人的舞蹈动作,改善了用户体验。

Description

一种控制服务机器人跳舞的方法和装置 技术领域
本发明涉及服务机器人技术领域,特别涉及一种控制服务机器人跳舞的方法和装置。
发明背景
随着智能机器人技术的发展,家庭服务机器人也逐步起步,服务类型机器人,如陪伴机器人、娱乐机器人可提供如讲故事、唱歌、跳舞等服务。
目前,对音乐娱乐机器人的研究很少,市场上偶见一些能够随音乐做动作的音乐娱乐机器人,这类机器人提前为一个歌曲设置好机器人要执行的动作,机器人自身播放音乐,在播放音乐的同时执行预设的动作。
此类音乐娱乐机器人由于自身播放音乐,易于给使用者(如小孩)感受到其与自身的区别性,拟人效果较差,不能很好的融入家居环境,且由于机器人对每首歌曲执行的是同样的动作多次使用后用户会逐渐感觉枯燥,用户体验差。
发明内容
有鉴于此,本发明提供了一种控制服务机器人跳舞的方法和装置,以解决现有音乐娱乐机器人受限预设动作导致的用户体验差的问题。
为达到上述目的,本发明的技术方案是这样实现的:
一方面,本发明实施例提供了一种控制服务机器人跳舞的方法,为服务机器人各部位的预定动作设置对应的部位控制命令,并设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略;该方法还包括:
在接收到跳舞启动命令时,与位于服务机器人外部的音箱建立无线连接,从服务机器人的歌曲库中加载歌曲,确定服务机器人当前加载的歌曲与外部音箱所要播放的歌曲一致;
根据歌曲选择服务机器人使用的跳舞控制策略,并确定跳舞控制策略的部位控制命令的命令发送时机;
在外部音箱播放该歌曲,且该跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命令,直至达到跳舞控制策略的命令发送次数,控制服务机器人跟随该歌曲跳舞。
另一方面,本发明实施例还提供了一种控制服务机器人跳舞的装置,该装置包括:
存储单元,用于存储为服务机器人各部位的预定动作设置对应的部位控制命令,以及存储设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略;
连接单元,用于在接收到跳舞启动命令时,与位于服务机器人外部的音箱建立无线连接;
加载单元,用于在接收到跳舞启动命令时,从服务机器人的歌曲库中加载歌曲,确定服务机器人当前加载的歌曲与外部音箱所要播放的歌曲一致;
选择单元,用于根据歌曲从存储单元中选择服务机器人使用的跳舞控制策 略,并确定跳舞控制策略的部位控制命令的命令发送时机;
控制单元,用于在外部音箱播放该歌曲,且跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命令,直至达到跳舞控制策略的命令发送次数,控制服务机器人跟随该歌曲跳舞。
本发明实施例的有益效果是:本发明在设置部位控制命令和跳舞控制策略的基础上,控制向服务机器人的相应部位随机发送命令的时间点以及命令发送次数,使服务机器人跟随歌曲跳舞,从而实现了一套较完整的服务机器人跳舞控制方案。一方面由于本发明的服务机器人能够与外部音箱配合,机器人随着音箱播放的音乐起舞,较好地模拟了人类舞蹈的场景,易于使用户产生共鸣,保证音乐效果,加强舞蹈气氛,适合家居等场景,另一方面,本发明还能够使服务机器人跟随加载的歌曲跳出不同的舞姿,并且同一首歌曲服务机器人的舞姿并不相同,极大的丰富了机器人的舞蹈动作,改善了用户体验。
附图简要说明
附图用来提供对本发明的进一步理解,并且构成说明书的一部分,与本发明实施例一起用于解释本发明,并不构成对本发明的限制。在附图中:
图1为本发明一个实施例提供的控制服务机器人跳舞的方法流程图;
图2为本发明另一个实施例提供的对服务机器人进行跳舞控制的方法流程图;
图3为本发明另一个实施例提供的固定跳舞模式下控制服务机器人跟随歌曲节拍跳舞的方法流程图;
图4为本发明另一个实施例提供的规律跳舞模式下控制服务机器人跟随歌曲节拍跳舞的方法流程图;
图5为本发明又一个实施例提供的控制服务机器人跳舞的装置结构框图;
图6为本发明实施例示出的一种控制服务机器人跳舞的装置的硬件结构示意图。
实施本发明的方式
为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。
图1为本实施例提供的控制服务机器人跳舞的方法流程图,如图1所示,该方法包括如下步骤:
S100,为服务机器人各部位的预定动作设置对应的部位控制命令,并设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略。
为了提供丰富的舞姿,本实施例在控制服务机器人跳舞前,预先为服务机器人的头部、身躯、胳膊、腿部等各个可活动的部位的预定动作设置对应的部位控制命令;以服务机器人头部转动动作为例,可以为服务机器人头部的水平转动动作和垂直转动动作分别设置对应的头部控制命令,每种头部控制命令指示头部转动的范围,如可以转动固定角度,也可以转动随机角度。
其中,任意两种跳舞控制策略之间或命令发送间隔不同、或命令发送次数不同、或命令发送间隔和命令发送次数均不同。优选地,步骤S100中设置跳 舞控制策略具体为:设置跳舞控制策略的命令发送次数为固定数值,或设置跳舞控制策略的命令发送次数为随机数值。
对于本发明中涉及的一个节拍占用的时长,应理解为歌曲的每个节拍占用的平均播放时长。假如某歌曲共有120拍,播放时长为1分钟,则歌曲的拍速为60/120=0.5秒/拍,一个节拍占用的时长为0.5秒,两个节拍占用的时长为1秒,依此得到跳舞控制策略的命令发送间隔。
S110,在接收到跳舞启动命令时,与位于服务机器人外部的音箱建立无线连接,从服务机器人的歌曲库中加载歌曲,确定服务机器人当前加载的歌曲与外部音箱所要播放的歌曲一致。
本实施例可以从服务机器人的歌曲库中加载各种类型的歌舞,不限制加载歌曲的文件格式。当然,在实际应用中,在接收到跳舞启动命令时,还可以直接利用服务机器人本身的扬声器播放当前加载的歌曲。
本发明考虑服务机器人本身扬声器的性能限制,其播放效果差于外界音箱,因此本实施例优选地选用外界音箱播放加载的歌曲。其中,满足相关通信协议的外界音箱均可以与服务机器人建立连接,播放服务机器人加载的歌曲。
S120,根据加载的歌曲选择服务机器人使用的跳舞控制策略,并确定所选择跳舞控制策略的部位控制命令的命令发送时机。
在具体实现时,可以获得所加载歌曲的拍速,根据歌曲的拍速选择服务机器人使用的跳舞控制策略,本发明通过后续的实施例具体说明根据歌曲的拍速选择服务机器人使用的跳舞控制策略的实施方案;显然也可以存储歌曲与跳舞控制策略的对应关系,根据对应关系选择服务机器人使用的跳舞控制策略。
S130,在外部音箱播放歌曲,且跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命令,直至达到跳舞控制策略的命令发送次数,控制服务机器人跟随所述歌曲跳舞。
在实际控制过程中,可根据跳舞控制策略的每个命令发送时机对应的部位控制命令,控制服务机器人相应部位的电机完成一个完整的转动序列,以达到期望的控制效果。
本实施例一方面由于本实施例服务机器人能够与外部音箱配合,机器人随着音箱播放的音乐起舞,较好地模拟了人类舞蹈的场景,易于使用户产生共鸣,保证音乐效果,加强舞蹈气氛,适合家居等场景,另一方面,本实施例还能够使服务机器人根据加载的歌曲实时跟随歌曲跳出不同的舞姿,并且同一首歌曲服务机器人的舞姿并不相同,极大的丰富了机器人的舞蹈动作,改善了用户体验。
为了使服务机器人的舞姿合拍,本实施例的一个优选方案,根据歌曲的拍速选择服务机器人使用的跳舞控制策略,从而在播放歌曲的过程中,控制服务机器人跟随歌曲的节拍跳舞。
为使服务机器人的舞姿跟随歌曲的节拍,给用户以机器人根据歌曲的节奏跳舞的效果,在设置跳舞控制策略的命令发送间隔时,优选地以歌曲节拍为单位设置命令发送间隔,如可以设置命令发送间隔为半个节拍占用的时长、一个节拍占用的时长、两个节拍占用的时长或三个节拍占用的时长。需要说明的是, 跳舞控制策略的命令发送间隔不宜过长,过长的命令发送间隔容易影响服务机器人的舞姿效果,弱化舞蹈节奏。命令发送间隔也不宜过短,需要考虑机器人对快速运动的承受度。
在本优选方案中,首先,根据歌曲的拍速和服务机器人各部位的电机速度间的关系,确定相邻两次部位控制命令的命令发送间隔,保证服务机器人的各部位电机能够完整地执行部位控制命令:
当歌曲的拍速大于或等于服务机器人的电机速度时,确定相邻两次部位控制命令的命令发送间隔大于或等于一个节拍;当歌曲的拍速小于服务机器人的电机速度时,确定相邻两次部位控制命令的命令发送间隔小于一个节拍或者,确定相邻两次部位控制命令的命令发送间隔大于或等于一个节拍。
示例性的,在歌曲的拍速小于第一倍数电机速度(如一倍电机速度),且大于第二倍数电机速度(如0.5倍电机速度)时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为一个节拍;在歌曲的拍速大于第一倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为两个节拍;在歌曲的拍速小于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为半个节拍;其中第一倍数电机速度大于第二倍数电机速度。
其次,选择满足相邻两次部位控制命令的命令发送间隔的跳舞控制策略,并确定所选择的跳舞控制策略中第一次发送部位控制命令的命令发送时机。
示例性的,假如所加载的歌曲的拍速小于第一倍数电机速度,且大于第二倍数电机速度,那么可以随机选择命令发送间隔为一个节拍或大于一个节拍的一种跳舞控制策略作为服务机器人使用的跳舞控制策略。
在选择好服务机器人使用的跳舞控制策略后,通过下述方法确定所选择跳舞控制策略的部位控制命令的命令发送时机:
确定所选择的跳舞控制策略中第一次发送部位控制命令的命令发送时机,以第一次发送部位控制命令的命令发送时机为起点,根据所选择的跳舞控制策略的命令发送间隔,确定下一次发送部位控制命令的命令发送时机,直至达到所选择的跳舞控制策略的命令发送次数。
其中,在所选择的跳舞控制策略为所加载歌曲的第一种跳舞控制策略时,可以将歌曲的第一个有效的节拍作为所选择的跳舞控制策略中第一次发送部位控制命令的命令发送时机;在所选择的跳舞控制策略不是所加载歌曲的第一种跳舞控制策略时,将上一种跳舞控制策略的最后发送的部位控制命令的命令发送时机对应歌曲节拍的下一拍作为当前跳舞控制策略中第一次发送部位控制命令的命令发送时机。
由于一首歌曲可以对应一种跳舞控制策略,也可以对应两种以上的跳舞控制策略。当一首歌曲对应两种以上的跳舞控制策略时,在播放歌曲的过程中,依次按照每种跳舞控制策略控制服务机器人跟随歌曲跳舞。因此,在达到所选择跳舞控制策略的命令发送次数后,本优选方案还需判断当前跳舞控制策略的最终发送的部位控制命令的命令发送时机是否为歌曲的播放终点,若不为歌曲的播放终点,切换歌曲的跳舞控制策略,并按照上述方法重新确定切换后的跳 舞控制策略的命令发送时机,其中切换后的跳舞控制策略的命令发送间隔与切换前不同;若为歌曲的播放终点,切换到歌曲的复位控制策略,确定复位控制策略指示的部位控制命令,复位控制策略指示的部位控制命令将服务机器人各部位恢复至跳舞前的姿态或者恢复至指定的姿态。
为了丰富服务机器人的舞姿,在本实施例的另一优选方案中,可采用下述两种方式中的至少一种选择部位控制命令:
方式一:在跳舞控制策略的命令发送时机到来时,随机地选择一部位控制命令,或随机地选择两个以上的不同部位的部位控制命令;
方式二:在跳舞控制策略的命令发送时机到来时,根据到来的命令发送时机对应的部位控制命令的发送次序数,选择一部位控制命令,或者选择两个以上的不同部位的部位控制命令。
在方式二中,还可以将跳舞控制策略分为多个子控制策略,每个子控制策略均包括命令发送次数相同的前控制策略和后控制策略;此时,可以根据到来的命令发送时机对应的部位控制命令的发送次序数,判断到来的命令发送时机所属的子控制策略:
当到来的命令发送时机属于当前子控制策略的前控制策略时,随机地选择一部位控制命令,或选择两个以上的不同部位的部位控制命令;当到来的发送时机属于当前子控制策略的后控制策略时,选择与前控制策略对应的部位控制命令的动作效果相对应的部位控制命令。其中,在到来的发送时机属于当前子控制策略的后控制策略时,可以选择与前控制策略对应的部位控制命令的动作效果相反的部位控制命令。
在本优选方案中,在为服务机器人各部位的预定动作设置对应的部位控制命令时,设置指示服务机器人某一身体部位转动的角度固定的固定部位控制命令,以及设置指示服务机器人某一身体部位转动的角度随机的随机部位控制命令。在设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略时:设置跳舞控制策略的命令发送次数为固定数值或为随机数值。此外,还设置歌曲对应的跳舞模式,跳舞模式指示部位控制命令的选择方式。
那么,在根据加载的歌曲选择服务机器人使用的跳舞控制策略时,还解析歌曲对应的跳舞模式,若歌曲对应固定跳舞模式,选择命令发送次数为固定数值的跳舞控制策略;若歌曲对应随机跳舞模式,选择命令发送次数为随机数值的跳舞控制策略;若歌曲对应规律跳舞模式,选择命令发送次数为随机数值的跳舞控制策略;若歌曲对应混合跳舞模式,根据固定跳舞模式、随机跳舞模式和规律跳舞模式中的一种跳舞模式选择跳舞控制命令。
具体的,在跳舞控制策略的命令发送时机到来时,可以通过下述方式选择部位控制命令:
解析歌曲对应的跳舞模式,若歌曲对应固定跳舞模式,在跳舞控制策略的命令发送时机到来时,随机地选择一固定部位控制命令,或随机地选择两个以上的不同部位的固定部位控制命令。
若歌曲对应随机跳舞模式,在跳舞控制策略的命令发送时机到来时,随机地选择一随机部位控制命令,或随机地选择两个以上的不同部位的随机部位控 制命令。
若歌曲对应规律跳舞模式,在跳舞控制策略的命令发送时机到来时,根据到来的命令发送时机对应的发送次次序数,选择一固定部位控制命令或随机部位控制命令,或者选择两个以上的不同部位的部位控制命令或随机部位控制命令;即根据到来的命令发送时机对应的部位控制命令的发送次序数,判断到来的命令发送时机所属的子控制策略:当到来的命令发送时机属于当前子控制策略的前控制策略时,随机地选择一固定部位控制命令或随机部位控制命令,或选择两个以上的不同部位的固定部位控制命令或随机部位控制命令;当到来的发送时机属于当前子控制策略的后控制策略时,选择与前控制策略对应的部位控制命令的动作效果相对应的部位控制命令。
若歌曲对应混合跳舞模式,控制当前跳舞控制策略依据固定跳舞模式、随机跳舞模式和规律跳舞模式中的一种跳舞模式选择部位控制命令。
为了更加详细说明控制服务机器人跳舞的方法,本实施例通过下述实现方案进行具体说明。
本实施例预先为服务机器人各部位的预定动作设置对应的部位控制命令,预先设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略,以及设置歌曲对应的跳舞模式,跳舞模式指示部位控制命令和/或跳舞控制策略的选择方式。
为便于描述,假设服务机器人的头部、身躯和胳膊可以在电机的控制下进行相应的转动。基于该假设,本实施例预先设置的部位控制命令包括:头部控制命令、身躯控制命令、左胳膊控制命令和右胳膊控制命令。其中,每种部位控制命令均包括固定部位控制命令和随机部位控制命令,固定部位控制命令指示服务机器人某一身体部位转动的角度固定,随机部位控制命令指示服务机器人某一身体部位转动的角度随机。
示例性地,假设在电机的控制下,服务机器人的头部可以进行水平方向上的左右转动,垂直方向上的上下转动;服务机器人的身躯可以进行水平方向上的左右转动;服务机器人的胳膊可以进行垂直方向上的上下转动。
其中,服务机器人的头部水平方向上左右转动的范围均为15°,垂直方向上上下转动的范围均为10°,对于服务机器人的头部,包括4个固定部位控制命令和4个随机部位控制命令,4个固定部位控制命令分别为向左转动5°的固定部位控制命令、向右转动5°的固定部位控制命令、向上转动5°的固定部位控制命令和向下转动5°的固定部位控制命令,4个随机部位控制命令分别为随机向左转动5°~15°的随机部位控制命令、随机向右转动5°~15°的随机部位控制命令、随机向上转动5°~10°的随机部位控制命令和向下转动5°~10°的随机部位控制命令。
服务机器人的身躯水平方向上左右转动的范围均为15°,对于服务机器人的身躯,包括2个固定部位控制命令和2个随机部位控制命令,2个固定部位控制命令分别为向左转动3°的固定部位控制命令和向右转动3°的固定部位控制命令,2个随机部位控制命令分别为随机向左转动3°~15°的随机部位控制命令和随机向右转动3°~15°的随机部位控制命令。
服务机器人的左胳膊(或右胳膊)垂直方向上上下转动的范围均为30°,对于服务机器人的左胳膊(或右胳膊),包括2个固定部位控制命令和2个随机部位控制命令,2个固定部位控制命令分别为向上转动5°的固定部位控制命令和向下转动5°的固定部位控制命令,2个随机部位控制命令分别为随机向上转动5°~15°的随机部位控制命令和随机向下转动5°~15°的随机部位控制命令。
由于大部分歌曲的1个小节包括4个节拍,因此本实施例优选地设置命令发送间隔的最大时间间隔为三个节拍,命令发送间隔的最小时间间隔为半个节拍,即本实施例设置的跳舞控制策略包括命令发送间隔为半个节拍的跳舞控制策略、命令发送间隔为一个节拍的跳舞控制策略、命令发送间隔为两个节拍的跳舞控制策略和命令发送间隔为三个节拍的跳舞控制策略,共设置4种类型的跳舞控制策略。
每种跳舞控制策略的命令发送次数可以为固定数值,也可以为随机数值。示例性地,对于命令发送间隔为半个节拍的跳舞控制策略,若其命令发送次数为固定数值,该固定数值为4;若其命令发送次数为随机数值,该随机数值为R,R=N*2,N为大于等于1,且小于等于4的正整数。对于命令发送间隔为一个节拍的跳舞控制策略,若其命令发送次数为固定数值,该固定数值可以为4、8或12;若其命令发送次数为随机数值,该随机数值为R,R=N*4,N为大于等于1,且小于等于4的正整数。对于命令发送间隔为两个节拍的跳舞控制策略,若其命令发送次数为固定数值,该固定数值可以为2、4、6或8;若其命令发送次数为随机数值,该随机数值为R,R=N*2,N为大于等于1,且小于等于8的正整数。对于命令发送间隔为三个节拍的跳舞控制策略,若其命令发送次数为固定数值,该固定数值可以为1或2;若其命令发送次数为随机数值,该随机数值为R,R=N,N为大于等于1,且小于等于8的正整数;其中,N为随机因子,每种跳舞控制策略的随机因子取值范围相同或不同。
对于命令发送次数为随机数值的每种跳舞控制策略,可以将该种跳舞控制策略分为多个子控制策略,每个子控制策略均包括命令发送次数相同的前控制策略和后控制策略。
在设置好本实施例的部位控制命令、跳舞控制策略和跳摸模式后,按照图2所示的控制方法对服务机器人进行跳舞控制。图2为本实施例提供的对服务机器人进行跳舞控制的方法流程图,该方法包括:
S200,接收跳舞启动命令。
在具体实现时,可以服务机器人可以通过语音交互的方式接收用户发送的语音跳舞启动命令。在语音跳舞启动命令格式或权限不正确时,控制服务机器人向用户发送启动失败提示音,并等待接收下一次跳舞启动命令;在在语音跳舞启动命令格式或权限正确时,执行步骤S201。
S201,控制服务机器人与外部音箱建立无线连接,服务机器人可通过蓝牙连接协议、Wifi连接协议或ZigBee连接协议与外部音箱建立连接。
S202,加载歌曲,并确定歌曲的拍速。
在具体实现时,可以控制服务机器人从其歌曲库中加载歌曲,也可控制服 务机器人从外界音频源加载歌曲。
本实施例中的拍速需要通过第三方提供的节拍器软件确定所加载歌曲的拍速。
对于步骤S201和步骤S202的执行顺序,本实施例不做具体限定。在实际应用中,可以先执行步骤S201、后执行步骤S202,或者,先执行步骤S202、后执行步骤S201,或者,同时执行步骤S201和步骤S202。
S203,比较歌曲的拍速与服务机器人各部位的电机转速,根据比较结果执行步骤S204。
步骤S204包括:若歌曲的拍速小于一倍电机速度,且大于0.5倍电机速度,执行步骤S2041;若歌曲的拍速大于一倍电机速度,执行步骤S2042,若歌曲的拍速小于0.5倍电机速度,执行步骤S2043。
S2041,从命令发送间隔为一个节拍、命令发送间隔为两个节拍和命令发送间隔为三个节拍的跳舞控制策略中随机选择一种跳舞控制策略。
S2042,从命令发送间隔为两个节拍和命令发送间隔为三个节拍的跳舞控制策略中随机选择一种跳舞控制策略。
S2043,从命令发送间隔为半个节拍、命令发送间隔为一个节拍、命令发送间隔为两个节拍和命令发送间隔为三个节拍的跳舞控制策略中随机选择一种跳舞控制策略。
S205,确定当前跳舞控制策略的部位控制命令的命令发送时机。
S206,判断是否达到当前跳舞控制策略的命令发送次数,若达到当前跳舞控制策略的命令发送次数执行步骤S207,否则执行步骤S208。
S207,切换跳舞控制策略,并返回步骤S205;其中,切换后的跳舞控制策略的命令发送间隔不同于切换前的跳舞控制策略的命令发送间隔。
S208,在当前跳舞控制策略的命令发送时机到来时,向服务器机器人的相应部位发送随机选择的部位控制命令,控制服务机器人跟随歌曲跳舞。
图2中的方法包括:在到达歌曲的播放终点时,向服务器机器人的各部位发送复位控制策略指示的复位控制命令,将服务机器人各部位恢复至跳舞前的姿态或者恢复至指定的姿态。
在实际控制过程中,服务机器人加载歌曲后,还可以解析该歌曲对应的跳舞模式,根据该歌曲对应的跳舞模式控制服务机器人跟随歌曲的节拍跳舞。
为了详细说明在相应跳舞模式下控制服务机器人跟随歌曲节拍跳舞的方法,本实施例通过两个具体实现方案,分别说明固定跳舞模式下控制服务机器人跟随歌曲节拍跳舞的方法和规律跳舞模式下控制服务机器人跟随歌曲节拍跳舞的方法。
由于每种跳舞模式下,控制服务机器人跟随歌曲节拍跳舞的方法都需要在接收到跳舞启动命令时,与位于服务机器人外部的音箱建立无线连接,从服务机器人的歌曲库中加载歌曲,确定服务机器人当前加载的歌曲与外部音箱所要播放的歌曲一致。即本实施例的下述两个具体实现方案中,都执行图2中的步骤S200~步骤S202,因此,在本实施例的下述两个具体实现方案中,不在赘述此执行过程。
在本实施例的一个具体实现方案中,固定跳舞模式下控制服务机器人跟随歌曲节拍跳舞的方法参考图3所示,图3中的方法包括:
S303,解析歌曲对应的跳舞模式,确定该歌曲对应的跳舞模式为固定跳舞模式。
S304,比较歌曲的拍速与服务机器人各部位的电机转速,根据比较结果执行步骤S305。
步骤S305包括:若歌曲的拍速小于1倍电机速度,且大于0.5倍电机速度,执行步骤S3051;若歌曲的拍速大于1倍电机速度,执行步骤S3052;若歌曲的拍速小于0.5倍电机速度,执行步骤S3053。
S3051,从命令发送间隔为一个节拍、命令发送间隔为两个节拍和命令发送间隔为三个节拍,且命令发送次数为固定数值的跳舞控制策略中随机选择一种跳舞控制策略。
S3052,从命令发送间隔为两个节拍和命令发送间隔为三个节拍,且命令发送次数为固定数值的跳舞控制策略中随机选择一种跳舞控制策略。
S3053,从命令发送间隔为半个节拍、命令发送间隔为一个节拍、命令发送间隔为两个节拍和命令发送间隔为三个节拍,且命令发送次数为固定数值的跳舞控制策略中随机选择一种跳舞控制策略。
以所加载歌曲的拍速小于1倍电机速度,且大于0.5倍电机速度为例,可以选择命令发送间隔为1个节拍、命令发送次数为4(或命令发送次数为8、或命令发送次数为12)的跳舞控制策略;也可以选择命令发送间隔为2个节拍、命令发送次数为2(或命令发送次数为4、或命令发送次数为6、或命令发送次数为8)的跳舞控制策略;还可以选择命令发送间隔为3个节拍、命令发送次数为1(或命令发送次数为2)的跳舞控制策略。
S306,确定当前跳舞控制策略的部位控制命令的命令发送时机。
S307,判断是否达到当前跳舞控制策略的命令发送次数,若达到当前跳舞控制策略的命令发送次数执行步骤S308,否则执行步骤S309。
S308,切换跳舞控制策略,并返回步骤S306;其中切换后的跳舞控制策略的命令发送间隔不同于切换前的跳舞控制策略的命令发送间隔。
假设当前跳舞控制策略的命令发送间隔为1个节拍、命令发送次数为4,在达到当前跳舞控制策略的命令发送次数时,切换跳舞控制策略,切换后的跳舞控制策略的命令发送间隔为2个节拍、命令发送次数为2(或命令发送次数为4、或命令发送次数为6、或命令发送次数为8);或者,切换后的跳舞控制策略的命令发送间隔为3个节拍、命令发送次数为1(或命令发送次数为2)。
S309,在当前跳舞控制策略的命令发送时机到来时,随机地选择一种固定部位控制命令,或随机地选择两个以上的不同部位的固定部位控制命令,将选择的固定部位控制命令发送给服务机器人相应部位的电机,控制服务机器人跟随歌曲跳舞。
由上,通过步骤S303~步骤S309完成了固定跳舞模式下,对服务机器人的跳舞控制。本实施例中随机跳舞模式下对服务机器人的跳舞控制方法与固定跳舞模式下的控制方法基本相同,只是随机跳舞模式下,在根据歌曲的拍速和服 务机器人各部位的电机速度的比较结果选择跳舞控制策略时,所选择的跳舞控制策略的命令发送次数为随机数值;以及在当前跳舞控制策略的命令发送时机到来时,随机地选择一种随机部位控制命令,或随机地选择两个以上的不同部位的随机部位控制命令。
在本实施例的另一个具体实现方案中,规律跳舞模式下控制服务机器人跟随歌曲节拍跳舞的方法参考图4所示,图4中的方法包括:
S403,解析歌曲对应的跳舞模式,确定该歌曲对应的跳舞模式为规律跳舞模式。
S404,比较歌曲的拍速与服务机器人各部位的电机转速,根据比较结果执行步骤S405。
步骤S405包括:若歌曲的拍速小于1倍电机速度,且大于0.5倍电机速度,执行步骤S4051;若歌曲的拍速大于1倍电机速度,执行步骤S4052;若歌曲的拍速小于0.5倍电机速度,执行步骤S4053。
S4051,从命令发送间隔为一个节拍、命令发送间隔为两个节拍和命令发送间隔为三个节拍,且命令发送次数为随机数值的跳舞控制策略中随机选择一种跳舞控制策略。
S4052,从命令发送间隔为两个节拍和命令发送间隔为三个节拍,且命令发送次数为随机数值的跳舞控制策略中随机选择一种跳舞控制策略。
S4053,从命令发送间隔为半个节拍、命令发送间隔为一个节拍、命令发送间隔为两个节拍和命令发送间隔为三个节拍,且命令发送次数为随机数值的跳舞控制策略中随机选择一种跳舞控制策略。
以所加载歌曲的拍速小于1倍电机速度,且大于0.5倍电机速度为例,可以选择命令发送间隔为1个节拍、命令发送次数为R=N*4(N为大于等于1,且小于等于4的正整数)的跳舞控制策略;也可以选择命令发送间隔为2个节拍、命令发送次数为R=N*2(N为大于等于1,且小于等于8的正整数)的跳舞控制策略;还可以选择命令发送间隔为3个节拍、命令发送次数为R=N(N为大于等于1,且小于等于8的正整数)的跳舞控制策略。
S406,确定当前跳舞控制策略的命令发送次数,以及部位控制命令的命令发送时机。
根据当前跳舞控制策略的随机因子N的取值范围,生成随机因子数值n,并根据生成的随机因子数值n确定该跳舞控制策略的命令发送次数R。假设当前跳舞控制策略的命令发送间隔为1个节拍、命令发送次数为R=N*4(N为大于等于1,且小于等于4的正整数)。若随机取得的随机因子数值n=3,则该跳舞控制策略的命令发送次数R=6。
S407,判断当前跳舞控制策略剩余的命令发送次数R’,若当前跳舞控制策略剩余的命令发送次数R’≤1,执行步骤S408,否则执行步骤S409。
S408,切换跳舞控制策略,并返回步骤S406;其中,切换后的跳舞控制策略的命令发送间隔不同于切换前的跳舞控制策略的命令发送间隔。
假设当前跳舞控制策略的命令发送间隔为1个节拍、命令发送次数为R=N*4(N为大于等于1,且小于等于4的正整数),在当前跳舞控制策略剩余的命令 发送次数R’≤1,即当前跳舞控制策略剩余的命令发送次数R’=1或R’=0时,切换跳舞控制策略,切换后的跳舞控制策略的命令发送间隔为2个节拍、命令发送次数为R=N*2(N为大于等于1,且小于等于8的正整数);或者,切换后的跳舞控制策略的命令发送间隔为3个节拍、命令发送次数为R=N(N为大于等于1,且小于等于8的正整数)。
S409,随机生成抽取因子M,并根据抽取因子M生成子控制策略的前控制策略,生成的前控制策略包括M次命令发送次数;其中M为大于等于1,且小于等于R’/2的正整数。
需要说明的是,每次生成的抽取因子M的数值不一定相同,只要满足1≤M≤R’/2即可。
S410,在前控制策略的命令发送时机到来时,随机地选择一种固定或随机部位控制命令,或随机地选择两个以上的不同部位的固定或随机部位控制命令,发送给服务机器人相应部位的电机,直至前控制策略的第M次命令发送时机到来;并在将第M次命令发送时机选择的部位控制命令发送给服务机器人相应部位的电机后,执行步骤S411。
S411,获取该子控制策略的前控制策略对应的抽取因子M,生成当前子控制策略的后控制策略,生成的后控制策略也包括M次命令发送次数。即子控制策略的前控制策略和后控制策略包括相同的命令发送次数。
S412,在后控制策略的命令发送时机到来时,选择与前控制策略对应的部位控制命令的动作效果相对应的部位控制命令,直至后控制策略的第M次命令发送时机到来;并在将后控制策略的第M次命令发送时机选择的部位控制命令发送给服务机器人相应部位的电机后,执行步骤S413。
在到来的发送时机属于当前子控制策略的后控制策略时,可以选择与前控制策略对应的部位控制命令的动作效果相反的部位控制命令。
基于上述假设情况,当前控制策略的命令发送次数R=6,若步骤S409中随机生成的抽取因子M=2,步骤S410中,若前控制策略的第一次命令发送时机到来时,选择了动作效果为头部右转8°的部位控制命令,第二次命令发送时机到来时,选择了动作效果为身躯左转3°的部位控制命令和右胳膊上转5°的部位控制命令;则在步骤S412中,在后控制策略的第一次命令发送时机到来时,可以选择动作效果为头部左转8°的部位控制命令,第二次命令发送时机到来时,可以选择动作效果为身躯右转3°的部位控制命令和右胳膊下转5°的部位控制命令。
S413,根据R’-2M更新当前跳舞控制策略剩余的命令发送次数R’,并返回步骤S407。
当执行当前跳舞控制策略的第一个子控制策略前,剩余的命令发送次数R’=R。
由上,通过步骤S403~步骤S413完成了规律跳舞模式下,对服务机器人的跳舞控制,规律跳舞模式下能够控制服务机器人的舞姿更为规律、协调。
与前述控制服务机器人跳舞的方法的实施例相对应的,本发明的一个实施例还提供了一种控制服务机器人跳舞的装置。
图5为本实施例提供的控制服务机器人跳舞的装置结构框图,该控制服务机器人跳舞的装置50包括:
存储单元51,用于存储为服务机器人各部位的预定动作设置对应的部位控制命令,以及存储设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略。
连接单元52,用于在接收到跳舞启动命令时,与位于服务机器人外部的音箱建立无线连接。
加载单元53,用于在接收到跳舞启动命令时,从服务机器人的歌曲库中加载歌曲,确定服务机器人当前加载的歌曲与外部音箱所要播放的歌曲一致。
选择单元54,用于根据歌曲从存储单元51中选择服务机器人使用的跳舞控制策略,并确定跳舞控制策略的部位控制命令的命令发送时机。
在本实施例的一个优选方案中,选择单元54,用于根据歌曲的拍速选择服务机器人使用的跳舞控制策略;或者,存储单元51,还用于存储歌曲与跳舞控制策略的对应关系,相应的,选择单元54,用于根据对应关系选择服务机器人使用的跳舞控制策略。
具体的,选择单元54包括:命令发送时机确定模块;
命令发送时机确定模块,用于根据歌曲的拍速和服务机器人各部位的电机速度间的关系,确定相邻两次部位控制命令的命令发送间隔;其中,当歌曲的拍速大于或等于服务机器人的电机速度时,确定相邻两次部位控制命令的命令发送间隔大于或等于一个节拍;当歌曲的拍速小于服务机器人的电机速度时,确定相邻两次部位控制命令的命令发送间隔小于一个节拍,或者确定相邻两次部位控制命令的命令发送间隔大于或等于一个节拍。
示例性地,拍速与电机速度比较模块在歌曲的拍速小于第一倍数电机速度,且大于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为一个节拍;在歌曲的拍速大于第一倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为两个节拍;在歌曲的拍速小于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为半个节拍;其中第一倍数电机速度大于第二倍数电机速度。
命令发送时机确定模块,以及用于选择满足相邻两次部位控制命令的命令发送间隔的跳舞控制策略,确定所选择的跳舞控制策略中第一次发送部位控制命令的命令发送时机;并以第一次发送部位控制命令的命令发送时机为起点,根据所选择的跳舞控制策略的命令发送间隔,确定下一次发送部位控制命令的命令发送时机,直至达到所选择的跳舞控制策略的命令发送次数。
示例性的,命令发送时机确定模块,具体用于在歌曲的拍速小于第一倍数电机速度,且大于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为一个节拍;在歌曲的拍速大于第一倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为两个节拍;在歌曲的拍速小于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为半个节拍;其中第一倍数电机速度大于第二倍数电机速度。
优选的,本实施例的选择单元54还包括跳舞控制策略切换模块;
跳舞控制策略切换模块,用于在达到所选择的跳舞控制策略的命令发送次数后,判断当前跳舞控制策略的最后发送的部位控制命令的命令发送时机是否为歌曲的播放终点,若不为歌曲的播放终点,切换歌曲的跳舞控制策略,并通过命令发送时机确定模块重新确定切换后的跳舞控制策略的命令发送次数、命令发送间隔和命令发送时机,其中切换后的跳舞控制策略的命令发送间隔与切换前不同;若为歌曲的播放终点,切换到歌曲的复位控制策略,确定复位控制策略指示的复位控制命令,复位控制命令将服务机器人各部位恢复至跳舞前的姿态或者恢复至指定的姿态。
控制单元55,用于在外部音箱播放歌曲,且跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命令,直至达到跳舞控制策略的命令发送次数,控制服务机器人跟随歌曲跳舞。
在本实施例的另一优选方案中,控制单元55包括部位控制命令选择模块;
部位控制命令选择模块,用于在跳舞控制策略的命令发送时机到来时,随机地从存储单元51中选择一部位控制命令,或随机地从存储单元51中选择两个以上的不同部位的部位控制命令;或者,
部位控制命令选择模块,用于根据到来的命令发送时机对应的部位控制命令的发送次序数,从存储单元51中选择一部位控制命令,或者从存储单元51中选择两个以上的不同部位的部位控制命令。
在部位控制命令选择模块根据到来的命令发送时机对应的部位控制命令的发送次序数选择部位控制命令时,需要预先将将跳舞控制策略分为多个子控制策略,每个子控制策略均包括命令发送次数相同的前控制策略和后控制策略。相应的,部位控制命令选择模块,用于根据到来的命令发送时机对应的部位控制命令的发送次序数,判断到来的命令发送时机所属的子控制策略,当到来的命令发送时机属于当前子控制策略的前控制策略时,从存储单元51中随机地选择一部位控制命令,或从存储单元51中选择两个以上的不同部位的部位控制命令;当到来的发送时机属于当前子控制策略的后控制策略时,从存储单元51中选择与前控制策略对应的部位控制命令的动作效果相对应的部位控制命令。
在本实施例的一个具体实现方案中,存储单元51中还存储有指示部位控制命令和/或跳舞控制策略的选择方式的跳摸模式。
控制单元55还包括跳摸模式解析模块,用于解析歌曲对应的跳舞模式;
部位控制命令选择模块,具体用于若跳摸模式解析模块解析歌曲的跳舞模式为固定跳舞模式,在跳舞控制策略的命令发送时机到来时,从存储单元51中随机地选择一固定部位控制命令,或随机地选择两个以上的不同部位的固定部位控制命令;若跳摸模式解析模块解析歌曲的跳舞模式为随机跳舞模式时,在跳舞控制策略的命令发送时机到来时,从存储单元51中随机地选择一随机部位控制命令,或随机地选择两个以上的不同部位的随机部位控制命令;若跳摸模式解析模块解析歌曲的跳舞模式为规律跳舞模式时,在跳舞控制策略的命令发送时机到来时,根据到来的命令发送时机对应的发送次次序数,从存储单元51 中选择一固定部位控制命令或随机部位控制命令,或者选择两个以上的不同部位的部位控制命令或随机部位控制命令;若跳摸模式解析模块解析歌曲的跳舞模式为混合跳舞模式时,控制当前跳舞控制策略依据固定跳舞模式、随机跳舞模式和规律跳舞模式中的一种跳舞模式选择部位控制命令。
对于装置实施例而言,由于其基本对应于方法实施例,所以相关之处参见方法实施例的部分说明即可。以上所描述的装置实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。
本发明提供的控制服务机器人跳舞的装置50可以通过软件实现,也可以通过硬件或者软硬件结合的方式实现。以软件实现为例,参照图6所示,可通过处理器10将非易失性存储器40中与控制服务机器人跳舞的装置50对应的机器可执行指令读取到内存60中运行。从硬件层面而言,如图6所示,为本发明装置的一种硬件结构图,除了图6所示的处理器10、内部总线20、网络接口30、内存60、以及非易失性存储器40之外,根据该网络设备的实际功能,还可以包括其他硬件,对此不再赘述。
在不同的实施例中,所述非易失性存储器40可以是:存储驱动器(如硬盘驱动器)、固态硬盘、任何类型的存储盘(如光盘、DVD等),或者类似的存储介质,或者它们的组合。所述内存60可以是:RAM(Radom Access Memory,随机存取存储器)、易失存储器、闪存。
需要说明的是,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备不仅包括那些要素,而且还包括没有明确列出的其他要素,或者是还包括为这种过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括所述要素的过程、方法、物品或者设备中还存在另外的相同要素。
以上所述仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。凡在本发明的精神和原则之内所作的任何修改、等同替换、改进等,均包含在本发明的保护范围内。为使本发明的目的、技术方案和优点更加清楚,下面将结合附图对本发明实施方式作进一步地详细描述。

Claims (16)

  1. 一种控制服务机器人跳舞的方法,其中,为服务机器人各部位的预定动作设置对应的部位控制命令,并设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略;所述方法还包括:
    在接收到跳舞启动命令时,与位于所述服务机器人外部的音箱建立无线连接,从服务机器人的歌曲库中加载歌曲,确定服务机器人当前加载的歌曲与外部音箱所要播放的歌曲一致;
    根据所述歌曲选择服务机器人使用的跳舞控制策略,并确定所述跳舞控制策略的部位控制命令的命令发送时机;
    在外部音箱播放所述歌曲,且所述跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命令,直至达到所述跳舞控制策略的命令发送次数,控制所述服务机器人跟随所述歌曲跳舞。
  2. 根据权利要1所述的方法,其中,所述根据所述歌曲选择服务机器人使用的跳舞控制策略包括:
    获得所述歌曲的拍速,根据所述歌曲的拍速选择服务机器人使用的跳舞控制策略;或者,
    存储歌曲与跳舞控制策略的对应关系,根据所述对应关系选择服务机器人使用的跳舞控制策略。
  3. 根据权利要2所述的方法,其中,在根据所述歌曲的拍速选择服务机器人使用的跳舞控制策略时,所述确定所述跳舞控制策略的部位控制命令的命令发送时机包括:
    根据所述歌曲的拍速和所述服务机器人各部位的电机速度间的关系,确定相邻两次部位控制命令的命令发送间隔;其中,当所述歌曲的拍速大于或等于所述服务机器人的电机速度时,确定相邻两次部位控制命令的命令发送间隔大于或等于一个节拍;当所述歌曲的拍速小于所述服务机器人的电机速度时,确定相邻两次部位控制命令的命令发送间隔小于一个节拍,或者确定相邻两次部位控制命令的命令发送间隔大于或等于一个节拍;
    选择满足所述相邻两次部位控制命令的命令发送间隔的跳舞控制策略,并确定所选择的跳舞控制策略中第一次发送部位控制命令的命令发送时机;
    以第一次发送部位控制命令的命令发送时机为起点,根据所选择的跳舞控制策略的命令发送间隔,确定下一次发送部位控制命令的命令发送时机,直至达到所选择的跳舞控制策略的命令发送次数。
  4. 根据权利要求3所述的方法,其中,所述根据所述歌曲的拍速和所述服务机器人各部位的电机速度间的关系,确定相邻两次部位控制命令的命令发送间隔具体为:
    在所述歌曲的拍速小于第一倍数电机速度,且大于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为一个节拍;
    在所述歌曲的拍速大于第一倍数电机速度时,确定相邻两次部位控制命令 的命令发送间隔满足最小时间间隔为两个节拍;
    在所述歌曲的拍速小于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为半个节拍;其中第一倍数电机速度大于第二倍数电机速度。
  5. 根据权利要求3所述的方法,其中,在达到所选择的跳舞控制策略的命令发送次数后,所述根据所述歌曲的拍速选择服务机器人使用的跳舞控制策略还包括:
    判断当前跳舞控制策略的最后发送的部位控制命令的命令发送时机是否为所述歌曲的播放终点,
    若不为所述歌曲的播放终点,切换所述歌曲的跳舞控制策略,并重新确定切换后的跳舞控制策略的命令发送次数和命令发送间隔,其中切换后的跳舞控制策略的命令发送间隔与切换前不同;
    若为所述歌曲的播放终点,切换到所述歌曲的复位控制策略,确定所述复位控制策略指示的复位控制命令,所述复位控制命令将服务机器人各部位恢复至跳舞前的姿态或者恢复至指定的姿态。
  6. 根据权利要求5所述的方法,其中,所述在外部音箱播放所述歌曲,且所述跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命令包括:
    在所述跳舞控制策略的命令发送时机到来时,随机地选择一部位控制命令,或随机地选择两个以上的不同部位的部位控制命令;
    或者,根据到来的命令发送时机对应的部位控制命令的发送次序数,选择一部位控制命令,或者选择两个以上的不同部位的部位控制命令。
  7. 根据权利要求6所述的方法,其中,所述根据到来的命令发送时机对应的部位控制命令的发送次序数,选择一部位控制命令,或者选择两个以上的不同部位的部位控制命令具体为:
    将所述跳舞控制策略分为多个子控制策略,每个子控制策略均包括命令发送次数相同的前控制策略和后控制策略;
    根据到来的命令发送时机对应的部位控制命令的发送次序数,判断到来的命令发送时机所属的子控制策略,
    当到来的命令发送时机属于当前子控制策略的前控制策略时,随机地选择一部位控制命令,或选择两个以上的不同部位的部位控制命令;
    当到来的发送时机属于当前子控制策略的后控制策略时,选择与前控制策略对应的部位控制命令的动作效果相对应的部位控制命令。
  8. 根据权利要求7所述的方法,其中,所述为服务机器人各部位的预定动作设置对应的部位控制命令具体为:设置指示服务机器人某一身体部位转动的角度固定的固定部位控制命令,以及设置指示服务机器人某一身体部位转动的角度随机的随机部位控制命令;
    所述方法还包括:设置所述歌曲对应的跳舞模式,所述跳舞模式指示部位控制命令的选择方式,则所述在外部音箱播放所述歌曲,且所述跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命 令具体为:
    解析所述歌曲对应的跳舞模式,若所述歌曲对应固定跳舞模式,在所述跳舞控制策略的命令发送时机到来时,随机地选择一固定部位控制命令,或随机地选择两个以上的不同部位的固定部位控制命令;
    若所述歌曲对应随机跳舞模式,在所述跳舞控制策略的命令发送时机到来时,随机地选择一随机部位控制命令,或随机地选择两个以上的不同部位的随机部位控制命令;
    若所述歌曲对应规律跳舞模式,在所述跳舞控制策略的命令发送时机到来时,根据到来的命令发送时机对应的发送次次序数,选择一固定部位控制命令或随机部位控制命令,或者选择两个以上的不同部位的部位控制命令或随机部位控制命令;
    若所述歌曲对应混合跳舞模式,控制当前跳舞控制策略依据所述固定跳舞模式、随机跳舞模式和规律跳舞模式中的一种跳舞模式选择部位控制命令。
  9. 一种控制服务机器人跳舞的装置,其中,该装置包括:
    存储单元,用于存储为服务机器人各部位的预定动作设置对应的部位控制命令,以及存储设置指示部位控制命令的命令发送次数和命令发送间隔的跳舞控制策略;
    连接单元,用于在接收到跳舞启动命令时,与位于所述服务机器人外部的音箱建立无线连接;
    加载单元,用于在接收到跳舞启动命令时,从服务机器人的歌曲库中加载歌曲,确定服务机器人当前加载的歌曲与外部音箱所要播放的歌曲一致;
    选择单元,用于根据所述歌曲从所述存储单元中选择服务机器人使用的跳舞控制策略,并确定所述跳舞控制策略的部位控制命令的命令发送时机;
    控制单元,用于在外部音箱播放所述歌曲,且所述跳舞控制策略的命令发送时机到来时,向服务机器人的相应部位发送随机选择的部位控制命令,直至达到所述跳舞控制策略的命令发送次数,控制所述服务机器人跟随所述歌曲跳舞。
  10. 根据权利要求9所述的装置,其中,所述选择单元,具体用于根据所述歌曲的拍速选择服务机器人使用的跳舞控制策略;
    或者,
    存储单元,还用于存储歌曲与跳舞控制策略的对应关系;相应的,所述选择单元,用于根据所述对应关系选择服务机器人使用的跳舞控制策略。
  11. 根据权利要求10所述的装置,其中,所述选择单元包括:命令发送时机确定模块;
    所述命令发送时机确定模块,用于根据所述歌曲的拍速和所述服务机器人各部位的电机速度间的关系,确定相邻两次部位控制命令的命令发送间隔;其中,当所述歌曲的拍速大于或等于所述服务机器人的电机速度时,确定相邻两次部位控制命令的命令发送间隔大于或等于一个节拍;当所述歌曲的拍速小于所述服务机器人的电机速度时,确定相邻两次部位控制命令的命令发送间隔小 于一个节拍,或者确定相邻两次部位控制命令的命令发送间隔大于或等于一个节拍;
    所述命令发送时机确定模块,还用于选择满足所述相邻两次部位控制命令的命令发送间隔的跳舞控制策略,确定所选择的跳舞控制策略中第一次发送部位控制命令的命令发送时机;并以第一次发送部位控制命令的命令发送时机为起点,根据所选择的跳舞控制策略的命令发送间隔,确定下一次发送部位控制命令的命令发送时机,直至达到所选择的跳舞控制策略的命令发送次数。
  12. 根据权利要求11所述的装置,其中,所述命令发送时机确定模块,具体用于在所述歌曲的拍速小于第一倍数电机速度,且大于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为一个节拍;
    在所述歌曲的拍速大于第一倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为两个节拍;
    在所述歌曲的拍速小于第二倍数电机速度时,确定相邻两次部位控制命令的命令发送间隔满足最小时间间隔为半个节拍;其中第一倍数电机速度大于第二倍数电机速度。
  13. 根据权利要求11所述的装置,其中,所述选择单元还包括:跳舞控制策略切换模块;
    所述跳舞控制策略切换模块,用于在达到所选择的跳舞控制策略的命令发送次数后,判断当前跳舞控制策略的最后发送的部位控制命令的命令发送时机是否为所述歌曲的播放终点,若不为所述歌曲的播放终点,切换所述歌曲的跳舞控制策略,并通过所述命令发送时机确定模块重新确定切换后的跳舞控制策略的命令发送次数和命令发送间隔,其中切换后的跳舞控制策略的命令发送间隔与切换前不同;若为所述歌曲的播放终点,切换到所述歌曲的复位控制策略,确定所述复位控制策略指示的复位控制命令,所述复位控制命令将服务机器人各部位恢复至跳舞前的姿态或者恢复至指定的姿态。
  14. 根据权利要求13所述的装置,其中,所述控制单元包括:部位控制命令选择模块;
    所述部位控制命令选择模块,用于在所述跳舞控制策略的命令发送时机到来时,随机地选择一部位控制命令,或随机地选择两个以上的不同部位的部位控制命令;或者,用于根据到来的命令发送时机对应的部位控制命令的发送次序数,选择一部位控制命令,或者选择两个以上的不同部位的部位控制命令。
  15. 根据权利要求14所述的装置,其中,所述跳舞控制策略分为多个子控制策略,每个子控制策略均包括命令发送次数相同的前控制策略和后控制策略;
    所述部位控制命令选择模块,具体用于根据到来的命令发送时机对应的部位控制命令的发送次序数,判断到来的命令发送时机所属的子控制策略,当到来的命令发送时机属于当前子控制策略的前控制策略时,随机地选择一部位控制命令,或选择两个以上的不同部位的部位控制命令;当到来的发送时机属于当前子控制策略的后控制策略时,选择与前控制策略对应的部位控制命令的动作效果相对应的部位控制命令。
  16. 根据权利要求15所述的装置,其中,所述部位控制命令包括:指示服 务机器人某一身体部位转动的角度固定的固定部位控制命令和指示服务机器人某一身体部位转动的角度随机的随机部位控制命令;所述控制单元还用于解析所述歌曲对应的跳舞模式的跳舞模式解析模块,所述跳舞模式指示部位控制命令的选择方式;相应的,
    所述部位控制命令选择模块,具体用于若所述歌曲对应固定跳舞模式,在所述跳舞控制策略的命令发送时机到来时,随机地选择一固定部位控制命令,或随机地选择两个以上的不同部位的固定部位控制命令;
    若所述歌曲对应随机跳舞模式,在所述跳舞控制策略的命令发送时机到来时,随机地选择一随机部位控制命令,或随机地选择两个以上的不同部位的随机部位控制命令;
    若所述歌曲对应规律跳舞模式,在所述跳舞控制策略的命令发送时机到来时,根据到来的命令发送时机对应的发送次次序数,选择一固定部位控制命令或随机部位控制命令,或者选择两个以上的不同部位的部位控制命令或随机部位控制命令;
    若所述歌曲对应混合跳舞模式,控制当前跳舞控制策略依据所述固定跳舞模式、随机跳舞模式和规律跳舞模式中的一种跳舞模式选择部位控制命令。
PCT/CN2017/088725 2016-07-14 2017-06-16 一种控制服务机器人跳舞的方法和装置 WO2018010521A1 (zh)

Priority Applications (1)

Application Number Priority Date Filing Date Title
US16/301,055 US10828784B2 (en) 2016-07-14 2017-06-16 Method and apparatus for controlling dancing of service robot

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201610555450.6 2016-07-14
CN201610555450.6A CN106217384B (zh) 2016-07-14 2016-07-14 一种控制服务机器人跳舞的方法和装置

Publications (1)

Publication Number Publication Date
WO2018010521A1 true WO2018010521A1 (zh) 2018-01-18

Family

ID=57520157

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/088725 WO2018010521A1 (zh) 2016-07-14 2017-06-16 一种控制服务机器人跳舞的方法和装置

Country Status (3)

Country Link
US (1) US10828784B2 (zh)
CN (1) CN106217384B (zh)
WO (1) WO2018010521A1 (zh)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114211485A (zh) * 2021-12-07 2022-03-22 深圳市优必选科技股份有限公司 机器人舞蹈控制方法、装置、机器人及存储介质

Families Citing this family (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106217384B (zh) * 2016-07-14 2019-03-15 歌尔股份有限公司 一种控制服务机器人跳舞的方法和装置
CN107009371B (zh) * 2017-06-14 2020-04-07 上海思依暄机器人科技股份有限公司 一种自动调节机器人舞蹈动作的方法及装置
CN107791262A (zh) * 2017-10-16 2018-03-13 深圳市艾特智能科技有限公司 机器人的控制方法、系统、可读存储介质及智能设备
CN109986552B (zh) * 2017-12-29 2021-01-08 深圳市优必选科技有限公司 机器人动作控制方法、智能终端及具有存储功能的装置
CN108527376A (zh) * 2018-02-27 2018-09-14 深圳狗尾草智能科技有限公司 控制机器人舞蹈动作的方法、装置、设备及介质
CN113246147A (zh) * 2021-04-30 2021-08-13 嘉应学院 一种基于视觉处理建立机器人舞蹈动作库的方法

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030069669A1 (en) * 2001-10-04 2003-04-10 Atsushi Yamaura Robot performing dance along music
CN1683122A (zh) * 2004-04-16 2005-10-19 上海科技馆 使机器人随音乐节奏跳舞的互动装置
CN101411948A (zh) * 2007-10-19 2009-04-22 鸿富锦精密工业(深圳)有限公司 电子玩具
CN105701196A (zh) * 2016-01-11 2016-06-22 北京光年无限科技有限公司 面向智能机器人的音频处理方法和智能机器人
CN106217384A (zh) * 2016-07-14 2016-12-14 歌尔股份有限公司 一种控制服务机器人跳舞的方法和装置

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5887120A (en) * 1995-05-31 1999-03-23 Oracle Corporation Method and apparatus for determining theme for discourse
JP2008090633A (ja) * 2006-10-02 2008-04-17 Sony Corp 動きデータ生成装置、動きデータ生成方法及び動きデータ生成プログラム
CN101524594B (zh) * 2009-04-17 2012-06-27 中国地质大学(武汉) 随节奏自主舞蹈的人形机器人
US9067132B1 (en) * 2009-07-15 2015-06-30 Archetype Technologies, Inc. Systems and methods for indirect control of processor enabled devices
CN101693371B (zh) * 2009-09-30 2011-08-24 深圳先进技术研究院 跟踪音乐节拍跳舞的机器人
US20120142429A1 (en) * 2010-12-03 2012-06-07 Muller Marcus S Collaborative electronic game play employing player classification and aggregation
US10096033B2 (en) * 2011-09-15 2018-10-09 Stephan HEATH System and method for providing educational related social/geo/promo link promotional data sets for end user display of interactive ad links, promotions and sale of products, goods, and/or services integrated with 3D spatial geomapping, company and local information for selected worldwide locations and social networking
US20180025664A1 (en) * 2016-07-25 2018-01-25 Anna Clarke Computerized methods and systems for motor skill training

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20030069669A1 (en) * 2001-10-04 2003-04-10 Atsushi Yamaura Robot performing dance along music
CN1683122A (zh) * 2004-04-16 2005-10-19 上海科技馆 使机器人随音乐节奏跳舞的互动装置
CN101411948A (zh) * 2007-10-19 2009-04-22 鸿富锦精密工业(深圳)有限公司 电子玩具
CN105701196A (zh) * 2016-01-11 2016-06-22 北京光年无限科技有限公司 面向智能机器人的音频处理方法和智能机器人
CN106217384A (zh) * 2016-07-14 2016-12-14 歌尔股份有限公司 一种控制服务机器人跳舞的方法和装置

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114211485A (zh) * 2021-12-07 2022-03-22 深圳市优必选科技股份有限公司 机器人舞蹈控制方法、装置、机器人及存储介质
CN114211485B (zh) * 2021-12-07 2024-05-17 深圳市优必选科技股份有限公司 机器人舞蹈控制方法、装置、机器人及存储介质

Also Published As

Publication number Publication date
US10828784B2 (en) 2020-11-10
CN106217384B (zh) 2019-03-15
CN106217384A (zh) 2016-12-14
US20190184575A1 (en) 2019-06-20

Similar Documents

Publication Publication Date Title
WO2018010521A1 (zh) 一种控制服务机器人跳舞的方法和装置
US9704491B2 (en) Storytelling environment: distributed immersive audio soundscape
US9621945B2 (en) Method and system for continuously playing media resource in device
JP2018121329A (ja) 動画再生方法及び装置
KR20150027806A (ko) 분포된 무선 장난감 기반 스킬 교환, 시스템들 및 방법들
JP5911613B2 (ja) 複数のスマート・デバイスによる同期再生のための方法、および装置
US9675888B2 (en) Storytelling environment: altering gameplay based on battery life
US20140358986A1 (en) Cloud Database-Based Interactive Control System, Method and Accessory Devices
CN105679341B (zh) 一种文件播放方法、装置及移动终端
US20230400928A1 (en) Haptics application programming interface
CN114026640B (zh) 用于提供动态媒体会话的方法、系统和介质
KR101112736B1 (ko) 휴대용 콘텐츠 재생 장치와 콘텐츠 저장 장치 간 콘텐츠상태 목록의 동기화 방법, 휴대용 콘텐츠 재생 장치,콘텐츠 저장 장치
CN103313127A (zh) 一种电视频道切换方法和装置
TW200823879A (en) Method and apparatus for playing video
JP7095597B2 (ja) 再生装置、再生方法、プログラム、及び再生システム
CN108182930A (zh) 音效处理方法、设备及音视频点播系统
JP7381856B2 (ja) 音声再生プログラム、音声再生装置、および音声生成方法
WO2020029524A1 (zh) 音乐编辑方法、装置、终端设备及计算机可读存储介质
JP2015107228A (ja) ビデオゲーム処理プログラム、ビデオゲーム処理システム、及びビデオゲーム処理装置
JP6868082B2 (ja) 音声処理方法及び装置
JP2016099502A (ja) コンテンツ再生システム
JP3699099B2 (ja) ゲームプログラム及びゲーム装置
KR20060098711A (ko) 이동통신 단말기의 오디오파일 반복 재생 구간 설정 방법
JP6679389B2 (ja) カラオケ装置及びプログラム
JP2002318581A (ja) 運動体制御システム、運動体及びそのプログラム

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17826859

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17826859

Country of ref document: EP

Kind code of ref document: A1