Robotics StackExchange | Archived questions

simulate UAV motor-off after a while

Hi,

I am using a multi-rotor UAV platform and I want to simulate a failure. For example, after 5 sec i want to shut-off one motor. I am using (ros indigo gazebo) and i am not sure how this can be done.

Asked by Fati on 2016-11-29 06:13:06 UTC

Comments

Answers

This is a bit of a shot in the dark since I don't know anything about your system, but if there is some topic that the motor is subscribed to (maybe throttle), then you can manipulate that. (If you're lucky, there might be a service you can call instead).

Find out what topics are there with rostopic list, and if any look relevant, call rostopic info [/path/to/topic] to see what's subscribed to it. Alternatively if you know the node, rosnode info [node] will tell you what it's subscribed to.

You'll need to poke new values into the topic. If something is continuously publishing into the topic, you could change the publisher topic write your own node to act as a on/off valve. That is:

original_publisher(node) -> target_throttle(topic) -> throttle_on_off(node) -> actual_throttle(topic) -> original_subscriber(node)

You can do what you like with your node, such as stopping forwarding on the messages after 5s. You could possibly get away with not even subscribing to the target_throttle topic if you know what if should be.

Asked by petern3 on 2016-11-29 16:45:03 UTC

Comments

Hi, I'm also trying to simulate something similar in Gazebo with PX4. Actually I can publish directly to the motors using actuator_control topic but I don't want to do that. I want to check my high-level position controller's performance without going into the low-level control. How to do it?

Asked by audia8.sid on 2017-10-24 04:26:25 UTC