Release thing method added
This commit is contained in:
		
							parent
							
								
									f77b00f639
								
							
						
					
					
						commit
						9b6bce5155
					
				| @ -31,7 +31,7 @@ Roboid::Roboid(Propulsion *propulsion) : Roboid() { | |||||||
|     propulsion->roboid = this; |     propulsion->roboid = this; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
| void Passer::RoboidControl::Roboid::SetName(char *name) { this->name = name; } | void Roboid::SetName(const char *name) { this->name = name; } | ||||||
| 
 | 
 | ||||||
| #include <Arduino.h> | #include <Arduino.h> | ||||||
| void Roboid::Update(unsigned long currentTimeMs) { | void Roboid::Update(unsigned long currentTimeMs) { | ||||||
| @ -119,3 +119,9 @@ void Roboid::AddChild(Thing *child) { | |||||||
|     this->perception->AddSensor(childSensor); |     this->perception->AddSensor(childSensor); | ||||||
|   } |   } | ||||||
| } | } | ||||||
|  | 
 | ||||||
|  | void Passer::RoboidControl::Roboid::Release(Thing *child) { | ||||||
|  |   if (RemoveChild(child) != nullptr) | ||||||
|  |     this->perception->AddTrackedObject(nullptr, Spherical16::zero, | ||||||
|  |                                        SwingTwist16::identity, child->type); | ||||||
|  | } | ||||||
|  | |||||||
							
								
								
									
										5
									
								
								Roboid.h
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								Roboid.h
									
									
									
									
									
								
							| @ -20,8 +20,8 @@ public: | |||||||
|   /// @param propulsion The Propulsion implementation to use for this Roboid
 |   /// @param propulsion The Propulsion implementation to use for this Roboid
 | ||||||
|   Roboid(Propulsion *propulsion); |   Roboid(Propulsion *propulsion); | ||||||
| 
 | 
 | ||||||
|   char *name = nullptr; |   const char *name = nullptr; | ||||||
|   void SetName(char *name); |   void SetName(const char *name); | ||||||
| 
 | 
 | ||||||
|   /// @brief Update the state of the Roboid
 |   /// @brief Update the state of the Roboid
 | ||||||
|   /// @param currentTimeMs The time in milliseconds when calling this
 |   /// @param currentTimeMs The time in milliseconds when calling this
 | ||||||
| @ -67,6 +67,7 @@ public: | |||||||
|   virtual void SetOrientation(SwingTwist16 worldOrientation); |   virtual void SetOrientation(SwingTwist16 worldOrientation); | ||||||
| 
 | 
 | ||||||
|   virtual void AddChild(Thing *child) override; |   virtual void AddChild(Thing *child) override; | ||||||
|  |   void Release(Thing *child); | ||||||
| 
 | 
 | ||||||
| private: | private: | ||||||
|   /// @brief The position of the roboid in carthesian coordinates in world space
 |   /// @brief The position of the roboid in carthesian coordinates in world space
 | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Pascal Serrarens
						Pascal Serrarens