Starting simulation with own model

@dagar

Hi, I can add it, but it is based on our Model of an autonomous underwater vehicle (AUV). The manual recommends to get my modified submodule of sitl_gazebo (which may be not up to date with the actual sitl_gazebo submodule) as well as our modified version of the PX4 Firmware (just added a start_up script and some applications, but this may also be not up to date with the actual PX4 Firmware).

Best regards
Nils

Thank you very much @NRottmann. It solved my problem.

@dagar

I would abstract the guide a bit and then I can put it on the official developers guide. How and where shall I add this?

Best
Nils

Hi @NRottmann (& @dagar),

Awesome. The docs should certainly be abstracted and refer only to official repo’s.

The existing doc on Gazebo we have on gazebo is here. The best thing would be to merge your instructions into those (this may be tough given that they are structured differently). Can you have a first look at how this might be best achieved. If you find that hard let me know and I’ll take a shot at it (very happy to do so).

Ideally the end result would be generic instructions, with a section on running the simulator for your sub much like the other ones here.

NOTE: On quick scan my take on the current PX4 docs is that they are very “thin and linky” meaning that there is the assumption you will be happy to go to linked docs and find required dependencies etc. While this approach has the benefit that you link to official docs that should be kept up to date, in this case it looks like the linked docs make a lot of assumptions about your existing knowledge of gazebo packaging/dependencies. Upshot, I’d be more than happy to extend our docs with your approach explicitly listing out dependencies and how things are installed (unless there is strong disagreement from others)

Let me know how/when I can help. I’m at hamishwillee at gmail dot com if you want to discuss offline.

Cheers
Hamish

Hi guys,

I will try to abstract the manual but this may take some time. I will be getting in touch as soon as I am ready with the first version.

Best regards,
Nils

Thanks very much. Here if you need help. I’m a good “dumb tester” of instructions :slight_smile:

@hamishwillee

Hi I have started to adjust the manual. Therefore I just copied the actual manual from the devGuide and included some parts of my manual. It would be nice if you can test and commend it.

https://docs.google.com/document/d/1nDQzA-2e8pno8hQj4iuCoBUhcHooqf7oKZbT3rSSBls/edit?usp=sharing

Also if I start the simulation using

roslaunch px4 posix_sitl.launch

I get the error message

WARN  [modules__systemlib__mixer] file not found
ERROR [mixer] can't load mixer file: ROMFS/px4fmu_common/mixers/quad_dc.main.mix
ERROR [mixer] failed to load mixer

since the mixer can not be found.

Best Nils

Thanks Nils. I probably won’t find time until early next week. Feel free to remind me if you don’t hear back by late next week :-0

Hi,

I have just added the simulation for our own underwater vehicle to the fork repository of the actual Firmware. I will have a look into your comments to the manual next week.

Best
Nils

@dagar, @hamishwillee

I have added our own autonomous underwater vehicle to the actual Firmware (sitl_gazebo submodule and PX4 main). I would be glad to write a manual (as proposed before) with an additional example section for an own simulation model. Is it possible to add our model of the AUV to the Firmware?

Best
Nils Rottmann

@NRottmann I am working on getting a tiltrotor tricopter running. In my setup the model tree is as follows:

  • Baselink
    ----FR Motor
    ----FL Motor
    ----Servo for back motor
    ---------back motor

The problem that I am facing is that the back motor cannot be controlled if I set a channel in the mavlink_controller plugin for the servo. Only if I lock the joint and remove the channel, I am able to actuate the back motor.

I see you have some experience in modifying the code for your custom frame. Any advice as to how to get this working ?

Thanks in advance.

Yes I think that would be fine. I’m curious to see how you implemented an underwater vehicle.

@dagar

nice, I will just fix some further issues. I hope I am done at the end of the week. How will it work? Shall I just send a pull request?

BTW: Do you know how to enable reverse thrust such that the output is from [-1 to 1] instead of [0 to 1]?

Best Nils

@ganeshrk95

I am not quite sure if I have understood your problem, but maybe you can just write a plugin for gazebo which replaces the servo for the back motor.

Best
Nils

@NRottmann My problem is that the backmotor’s parent is SERVO_LINK and it’s parent is the BASE_LINK. The Motor model, base plugin etc. doesnt support this type of serial linkage. I am looking to bypass that.

Not off the top of my head. Have you tried giving the thrust mixer the full range? Once I see which controllers you’re using we can step through the code and figure out where it’s being constrained to [0, 1].

@dagar

I have added a pull request for my simulation model (Mixers in .ros/ROMFS/... are not actualized automatically).

I also solved the problem with the output being constrained to [0, 1]. The chosen MAV_TYPE is there crucial, it may be possible to integrate an own MAV_TYPE for the AUV. Right now I just chose a convenient one to get the simulation working.

One last problem which I am facing is described here: Mixers in .ros/ROMFS/... are not actualized automatically . Maybe you have an idea why this happen?

Best
Nils

i can not open the "PX4 ROS Simulation Instructions NRottmann " docs, can you upload again? @NRottmannJun '17

Hello,

Does anyone still has the manual for gazebo simulation NRottmann wrote? It is no longer available in the provided links and I think it would help me a lot.

Thanks in advance!

I have the manual somewhere, I gonna upload it when I have access to my computer.