Ask Your Question
0

simulate UAV motor-off after a while

asked 2016-11-29 05:13:06 -0500

Fati gravatar image

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.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2016-11-29 15:45:03 -0500

petern3 gravatar image

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.

edit flag offensive delete link more

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?

audia8.sid gravatar image audia8.sid  ( 2017-10-24 04:26:25 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2016-11-29 05:13:06 -0500

Seen: 47 times

Last updated: Nov 29 '16