|
28 | 28 | "drill_seargent": "DGzg6RaUqxGRTHSBjfgF", |
29 | 29 | "knox": "dPah2VEoifKnZT37774q", |
30 | 30 | "pirate": "PPzYpIqttlTYA83688JI", |
31 | | - "michael": "ldTgmMTsxAK2Vs3NZO03" |
| 31 | + "michael": "ldTgmMTsxAK2Vs3NZO03", |
| 32 | + "scottish": "y6p0SvBlfEe2MH4XN7BP" |
32 | 33 | } |
33 | 34 |
|
34 | 35 | class Tool: |
@@ -121,13 +122,37 @@ async def act(self, params): |
121 | 122 | ) |
122 | 123 | return "Doggo is now stopping" |
123 | 124 |
|
| 125 | +class Dance(Trick): |
| 126 | + def __init__(self, dog): |
| 127 | + super().__init__(dog, "dance", "Make the dog dance", "tools/empty.json") |
| 128 | + |
| 129 | + async def act(self, params): |
| 130 | + await self.dog.maybe_reconnect() |
| 131 | + await self.dog.robot.datachannel.pub_sub.publish_request_new( |
| 132 | + RTC_TOPIC["SPORT_MOD"], {"api_id": SPORT_CMD["Dance"]} |
| 133 | + ) |
| 134 | + return "Doggo is now dancing" |
| 135 | + |
| 136 | +class Jump(Trick): |
| 137 | + def __init__(self, dog): |
| 138 | + super().__init__(dog, "jump", "Make the dog jump", "tools/empty.json") |
| 139 | + |
| 140 | + async def act(self, params): |
| 141 | + await self.dog.maybe_reconnect() |
| 142 | + await self.dog.robot.datachannel.pub_sub.publish_request_new( |
| 143 | + RTC_TOPIC["SPORT_MOD"], {"api_id": SPORT_CMD["FrontJump"]} |
| 144 | + ) |
| 145 | + return "Doggo is now jumping" |
| 146 | + |
124 | 147 | def trick_tools(dog): |
125 | 148 | tricks = [ |
126 | 149 | StandUp(dog), |
127 | 150 | Damp(dog), |
128 | 151 | Hello(dog), |
129 | 152 | Move(dog), |
130 | 153 | Stop(dog), |
| 154 | + Dance(dog), |
| 155 | + Jump(dog), |
131 | 156 | ] |
132 | 157 | return [trick.tool() for trick in tricks] |
133 | 158 |
|
|
0 commit comments