I suggest taking a look at ROS and Dronekit. The latter has nice Python binding to issue Mavlink command that can help you control landing speed.
From my understanding, even Raspi and Navio2 fit together, they can not communicate with each other. Is that right?
ardupilot runs on rpi - navio translates signals to your esc’s and your other sensors;
you can control landing speed with land speed high and land speed (2 values - they are named something like that);
land speed high is for descending to something like 5m and for the final the descend there is LAND_SPEED which controls the final descend to ground!
Control_land.cpp refers to land_speed_down, but if you set it it will be static; (like setting the missionplanner variables)
dronekit is a possibility if you need to change the descend/ascend dynamically during a flight (http://python.dronekit.io/guide/copter/guided_mode.html) - but i’m not sure if it is supported yet;
So the navio is just a bridge between pi and all sensors and escs? The ardupilot runs on pi, navio is not responsible for ardupilot?
For the two parameters, land speed high and land speed, I am confused. Which one should I use? And which cpp file are these parameters from?
i believe land speed refers to control_land.cpp;
you can just use missionplanner; land speed high is for descent rates in higher altitudes;
for altitudes below 10m land_speed will be the descend speed;
RPI runs Ardupilot Software;
Navio2 has 2 IMU, 2 Compass, GPS, an RGB LED; SBUS/PPM input; 14x PWM OUT , ADC PINS, triple power redundancy, protection and more;
RPI calculates, Navio provides and translates;
any scripts on rpi can talk to ardupilot using mavlink; dronekit and ROS should provide further functionality; they are nodes connecting to ardupilot;
Thanks panky, do you know if there is example for c++ scripts talk to ardupilot using mavlink for beginner to refer? I tried to use ros but there is problem to install it(I have searched for solution but none works for me)
and I heard that dronekit uses python and python is not realtime, so I think it may not work for my task.
New beta has preinstalled ROS by default.Take a look!
I can understand where do these assumptions come from but in this particular situation you’re fine using Python. You run Python scripts alongside ArduPilot which controls servos and motors that need a deterministic response time. Python doesn’t need to be realtime.
Realtime is a wrong term here! Sorry.
You can use other Mavlink bindings. There’s of course C bindings. Your application won’t benefit from using those, though.
Thanks, I would prefer the new beta with ROS.
I came across new problem. After reinstall the new beta, how could I use the ROS node. I referred to this webpage: http://docs.erlerobotics.com/simulation/vehicles/erle_copter/tutorial_4 .
But after I type:
catkin_make --pkg ros_erle_teleoperation
The raspberry pi shows
-bash catkin_make: command not found
Then I went to the ROS configuration page: http://docs.erlerobotics.com/simulation/configuring_your_environment. I began with the
Getting latest version of JSBSim part,
./autogen.sh --enable-libraries, it shows
Error: You must have libtool installed to compile jsbsim, but I think the last command before this one has already install libtool (Before I reinstalled the new beta, I tried this tutorial and stopped here too )
So, could you tell me how to run the ROS node on the new beta?
Please, follow our docs and read carefully the release message! We have an elaborate tutorial how to launch mavros node.
I checked that information and followed the tutorial. It worked. And I also browsed the ros wiki tutorial for the basic knowledge. I still have something confusing me. 1. Nodes are executable, so does that mean all the nodes in navio beta4 are only executable files? There is no source code for the nodes? If there is, in which directory are they? If there is not, where could I find the source for the nodes? 2. Is it possible to use the raspi camera in the new written nodes?
Sorry for so many questions.
Node is a concept taken from publisher-subscriber lingo that means an entity that can do something on its own. Nodes can be written in C++/Python/Java, you name it.
Source code for Mavros node is open.
Most of the code needed for ROS is located at
Sure, take a look at Python bindings to control it with ease.
Nothing to worry about! We’re always here to help you out.
In the tutorial video, at the end after typing “rostopic echo /mavros/”, there are many options(I think they are nodes under mavros package) listed. I am wondering how to get access the source code to these topics and modify, then build them. I checked all the packages are in /ndigo/share directory. But it seems there is no source for the nodes listed by “rostopic echo /mavros/”. In github(GitHub - mavlink/mavros: MAVLink to ROS gateway with proxy for Ground Control Station), I found the corresponding code under mavros/mavros/src/plugins/. But it is not exactly the same as shown in the video, there is no “rc/override”, but a “rc_io.cpp” containing rc_in rc_out and rc_override.
My idea is find the source code in pi and modify it, but I can’t find them in pi.
After browsing the ros.org again, I came up with the general idea. Create a new node, used for control the camera to take images and generate acceleration or deceleration command based on my algorithm, use it as a publisher, and use rcoverride as the subscriber to control the thrust. Is it a right way?
Hi staroselskiy, maybe you didn’t notice my last reply. Even you told me that the source files are under /opt/ros/indigo, I still can’t find them, I only found some python srcipts under /opt/ros/indigo/bin, but I did not find the source file corresponding to mavros/rc/override.
I followed the tutorial on ros.wiki and succeed the “hello world” example. In this case, the source file is in /workspace name/src/packagename.
Corresponding to this, I think indigo(maybe /indigo/share) is the workspace, and all the packages are under “indigo/share”, so /indigo/share/mavros is the package I need. But I can not find the source in that directory.
I am planning to copy all the files(including source files) in package mavros to a new workspace so that the building will be faster.
Sorry it’s taken me so long to reply.
I suggest you need to go over the sub-pub thing one more. The basic concept is that you write your node that subscribes to the data that is fetched from mavros and then publish your processed data, so this [quote=“zhanghaijason, post:22, topic:4869”]
Create a new node, used for control the camera to take images and generate acceleration or deceleration command based on my algorithm, use it as a publisher, and use rcoverride as the subscriber to control the thrust.
bit sounds pretty close.
I wouldn’t really recommend use rcoverride because it might be quite dangerous to control the PWM values yourself. You’re better off issuing some kind of a more high-level command.
This doesn’t make a lot of sense, though. I think you’ll need to create your own catkin workspace.
Hi, I am working on a similar project. How far have you gotten with this?
I tried to use rc override in ros to control its throttle. But it seems that it is knid of dangerous to override the throttle. I did not try this project. I still looking for a safer solution.
suggest you look at how they handle this use case in the precision landing code in arducopter. study the drivers for ir lock device. and sonar range/lidar support in precision landing mode. might help with general ideas.