ethz-asl / mav_dji_ros_interface Goto Github PK
View Code? Open in Web Editor NEWInterface of DJI autopilot based on its OSDK (3.2)
License: Apache License 2.0
Interface of DJI autopilot based on its OSDK (3.2)
License: Apache License 2.0
DJI Support says that I cannot fly the M100 without the GPS connected. I do not need GPS for my application since it is indoor. Is there a way to get around this?
Some of the files for 3d-printing the NUC case seem to be missing. Particularly the lid for the box and part of the button. Thanks @inkyusa
Hi Community,
After reading your FSR paper I realized that you used classic PID for z control. I'm wondering if you have ever tried PID for x and y control under HORIZONTAL_ANGLE mode ( according the original Onboard-SDK-ROS)? I have a set of UltraSonic sensor to give me position and velocity, not as accurate as VICON but acceptable precision. I followed the traditional PID tuning guide to increase the P term from 0.1 to 5 and never had it converge. If you have tried classic PID, would you be able to provide some hints on the values? Many thanks.
BR,
rocklinsuv
Dear Author:
Recently, I git the mav_dji_ros_interface project in my computer, and I follow the wiki page you list. But I found it dosen't work, for example, I find the package mav_dji_ros_interface is none, it didn't contain any launch file, while the command in the wiki package shows that it dose exist, I don't know while, Could you please tell me how to deal with that. Thanks sincerely!
In this system, can I replace rovio with vins-mono? if it is possible,How to replace?
Hello,thanks for the sharing
I am really appreciate your amazing job,but I still have some questions about it.and I notice @inkyusa and @fmina you have been working on this.can you give me some light on this?
I've follow this tutorials for about 2 months,and I found some questions and I can't handle it by myself.
1.about "Dynamic System Identification (via VirtualRC)". I found some information from issues that it has been Deprecated since last year and I won't use the Logitec Gamepad F710 to control the M100 any more, because you use attitude thrust to replace z velocity.(#21).
so my first question is:should I use the DJI's remote control to control the M100 or others like keyboard?
The Dynamic System Identification (via attitudeThrust) page is not updated,I know it has been a long time since you have finished this section,and you must don't have time on it ,all I need to know is if this section is important to the flight?can I just skip this section and directly do the job in "First Autonomous Flight: Hover and Step Response"section after I finished the job in "MPC with MSF and ROVIO" section?because I found the "First Autonomous Flight: Hover and Step Response" just need the steps in the "MPC with MSF and ROVIO" section.
2.about First Autonomous Flight: Hover and Step Response:
1).when I do this job in simulation environment by using DJI Assistant2 software,I've a question about step6 :
Now all modules are up and running in position control mode (i.e., you send position commands via the transmitter not attitude commands). Slowly increase desired z position.
Does that mean I have to use the Dji's remote control to increase desired z position?if yes ,I've found I can't control the M100 nicely in simulation environment,no matter how Slowly I push the Remote control rod up,the z position will increase without stopping and no matter how Slowly I push the Remote control rod down,the z position will decrease without stopping.I can't make it stay in a fixed hight and it will drift a lot on x and y axles,but it can still response to my remote controller.when I publish topic message like fly 1 meter high via rqt the M100 in dji assistan2(simulation) didn't response. this question is crucial to me.I guess if there are some parameter files I missed.
I notice the launch file has load a dji_interface_params.yaml file in /cfg/raven/ folder but the frequency of some sensor are different from the parameters in params.yaml which is located in /cfg/ folder
Here is params.yaml:
device: "/dev/ttyUSB0"
app_id: 1040678
enc_key: "a41335b074411eb3408029cd0955324df2d3b84e5c0d80ed8344ae5c34e05cb2"
thrust_minimum: 10
thrust_maximum: 100
thrust_offset: 8.945
thrust_coefficient: 0.7389#available freq: 0 1 10 50 100 Hz
imu_update_rate: 50
gps_updae_rate: 10
time_stamp_update_rate: 1
magnetometer_update_rate: 10
rc_update_rate: 50
status_update_rate: 10
Here is dji_interface_params.yaml:
device: "/dev/ttyUSB0" #"/dev/tty.usbserial-A104JS3T"
app_id: 1040678
enc_key: "a41335b074411eb3408029cd0955324df2d3b84e5c0d80ed8344ae5c34e05cb2"
thrust_constant: 1.2
baudrate: 921600
#921600,
#available freq: 0 1 10 50 100 Hz
imu_update_rate: 50 #100
gps_updae_rate: 1
time_stamp_update_rate: 1
magnetometer_update_rate: 1
rc_update_rate: 10
status_update_rate: 1
the frequency of status_update_rate,rc_update_rate,magnetometer_update_rate,gps_updae_rate are different.so which one is correct? need I modify the parameters?and Do these parameters have connection with the fly drift?
Here are the screenshots of my experiment:(the world-imu(M100)-imu(zr300) coordinate is stable)
First, we changed the camera from zr300 to d435i,But I think this should not affect much?After we have completed the previous steps, we perform the First Autonomous Flight: Hover and Step Response step, complete the initialization, and then open rqt, set x=0, y=0, z=1 for position and x =0, y=0, z=0, w=1 for orientation,But the plane is still in place, and it has not taken off, and the speed of the motor has not changed.
sometimes it takes up to 10-20 ms to send one command over serial. It could be due to serial port configuration, or maybe other reason. To be investigated.
I would like some clarification. The linear MPC documentation says:
command/roll_pitch_yawrate_thrust of type mav_msgs/RollPitchYawrateThrust. This is the command to the low level controller. Angles are in rad and thrust is in N.
It publishes the z thrust component in Newtons, however the matlab scripts seems to treat it as velocity.
The falcon2_sysid_roll_pitch_onboard.m has a scaling constant
k_thrust = 0.0019965;
I presume the constant was evaluated using the regression scripts similar to the regression_height_falcon2.m that script scales the joystick input to match vertical velocity.
To confuse it more the DJIInterface::commandRollPitchYawrateThrustCallback that accepts the command seems to have limits (minimum_thrust_ and maximum_thrust_) suggesting it is 0-100%
The falcon2_sysid_height_onboard.m fits the throttle command with transfer function into vertical velocity as well.
So, should the thrust.z be a Force in [N], velocity [m/s] or [%]?
Or is does not really matter as long as as the values are the same for experiments and actual control?
Why I am asking ? I am trying to replicate your experiment with M100 with custom quadrotor frame and N3 controller. I created ros node that sends mav_msgs/RollPitchYawrateThrust with roll/pitch in [rad] and thrust.z as 0...100. I am creating those from /dji_sdk/rc topic.
Therefore, using the default height parameters in github files, the aircraft can take off normally,but in the step experiment, when setting x=1m or setting x=2m, the aircraft did not actually hover at the position of x=1m and x=2m in real world, it was only about 50cm, or 60cm.
I guess it may be caused by the inconsistency between the weight of our aircraft and the installation structure. Which parameters can I modify to accomplish the accuate height control?
Hello,
I have been trying to follow your tutorial and its really great! Thanks for sharing everything in a well documented manner. I have read the issue posted by @wqwanghanzhang and I think I have similar questions related to “Dynamic System Identification (via VirtualRC)”.
Although you have decribed the procedure in detail but I was not able to figure out some things, like the steps require the use of the previous SDK (ethz-asl/dji_onboard_sdk_ros), on which I think you are not working now and the latest version (ethz-asl/mav_dji_ros_interface) directly uses those params. I know you wanted to keep this version as consize as possible, so you removed those stuff.
I needed to do this since my configuration is a bit different. I am using Matrice100 with NVIDIA jetson TX2 and a different camera. So is it fine if I am using your older SDK just for performing Dynamic system Identification? as I am still facing some issues.
These are some things that I have tried,
While debugging it,
I have tried hovering and step response experiment with your calibration settings, although its able to fly but I think the system parameters need to be tuned.
Can you suggest any thing that I can try or might be doing wrong?
There's considerable drift in the M100 while flying indoors with A-mode on (manual control). Usually, we solve it using trimming in standard RCs. How can this problem be solved in the M100? I have already tried IMU recalibration. Any software fix?
Hi,thanks for your sharing:
my question is about msf,I can't get M100's imu's state information,and I've run the rovio with zr300 good ,when I roslaunch raven_indoor_rovio_nMPC_trj_realsense.launch the information of the screen like this:
wq@wqz:~/catkin_test/src/mav_dji_ros_interface/dji_interface/launch$ roslaunch raven_indoor_rovio_nMPC_trj_realsense.launch
... logging to /home/wq/.ros/log/61366954-6ec0-11e8-9583-e0d55e131bd1/roslaunch-wqz-12639.log
Checking log directory for disk usage. This may take awhile.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.
started roslaunch server http://wqz:43965/
CLEAR PARAMETERS
PARAMETERS
NODES
/raven/
dji_interface (dji_interface/dji_interface_node)
mav_linear_mpc (mav_linear_mpc/mav_linear_mpc_node)
pose_sensor_rovio (msf_updates/pose_sensor)
trajectory_sampler (mav_trajectory_generation_ros/trajectory_sampler_node)
world_to_odom (tf/static_transform_publisher)
world_to_vicon (tf/static_transform_publisher)
ROS_MASTER_URI=http://localhost:11311
core service [/rosout] found
process[raven/dji_interface-1]: started with pid [12660]
process[raven/pose_sensor_rovio-2]: started with pid [12661]
process[raven/mav_linear_mpc-3]: started with pid [12663]
process[raven/trajectory_sampler-4]: started with pid [12680]
process[raven/world_to_vicon-5]: started with pid [12687]
device: /dev/ttyUSB0
process[raven/world_to_odom-6]: started with pid [12706]
drone_version: M100
[ INFO] [1528875232.429506618]: Initialized trajectory sampler.
[ INFO] [1528875232.430707042]: parameters loaded correctly
ERROR openSerial,line 169: Failed to open serial device /dev/ttyUSB0
ERROR init,line 58: Failed to start serial device
[ INFO] [1528875232.430823644]: Succeed to create thread for readPoll and sendPoll
WARNING: Logging before InitGoogleLogging() is written to STDERR
E0613 15:33:52.439970 12680 trajectory_sampling.cpp:38] Dimension has to be 3 or 4, but is 0
[ INFO] [1528875232.440423603]: /raven/pose_sensor_rovio:
subscribed to topics:
advertised topics:
/rosout
/tf
/raven/pose_sensor_rovio/core/parameter_descriptions
/raven/pose_sensor_rovio/core/parameter_updates
/raven/msf_core/state_out
/raven/msf_core/correction
/raven/msf_core/pose
/raven/msf_core/odometry
/raven/msf_core/pose_after_update
/raven/msf_core/ext_state
/raven/msf_core/cov_core
/raven/msf_core/cov_aux
/raven/msf_core/cov_core_aux
and when I run rviz ,there is no state information of M100's imu demonstrate on the rviz
I guess "/raven/status" is related to the M100's IMU state information,but there is no data from it.
and I found some errors :
ERROR openSerial,line 169: Failed to open serial device /dev/ttyUSB0
ERROR init,line 58: Failed to start serial device
ERROR sendData,line 47: Port closedERROR sendData,line 47: Port closedERROR sendData,line 47: Port closed==============
DJI Comm initialized correctly.
ERROR activate,line 391: Please call getDroneVersion first.
ERROR sendData,line 47: Port closedBroadcast call back received
I guess maybe there are some problems related to hardware,and I'm sure i follow the Serial Wiring wiki,and here is the picture and the firmare is V1.3.1.00 (2016.04.13).and the status of the M100 is connected with remote controller .I'm not sure if this is right, because the wiki didn't tell if M100 should connet rc when I read the state of M100's IMU's parameters.(sorry,my english is not good) so can you help me with that?
@fmina @raghavkhanna We need to clean up our private repo (realsense wrapper, https://github.com/ethz-asl/realsense_ros) or test this repo (https://github.com/ethz-asl/realsense).
if work with the mpc_controller mav_control_rw, should we modify like below?
Hi, this might sound like a dumb question but I can't see any thrust coming from the Gamepad when I echo the roll pitch yaw thrust topic. I am trying to test it in the DJI Simulator, I don't know if that makes a difference. Any help will be greatly appreciated!
From Maurice:
To get started with this I would like to use the RealSense Z300. Do you have any logs and configuration files with that sensor?
From Inkyu:
In order to use Realsense ZR300 (Z300?) with MSF and Rovio presented in the work, you need to calibration it carefully.
I didn’t get what the logs imply but all configuration files are located at
https://github.com/ethz-asl/mav_dji_ros_interface/tree/master/dji_interface/cfg/raven
The RAM listed in the Parts List section is DDR3/DDR3L, whereas the NUC7i7BNH requires DDR4 memory.
Here's the link with the memory requirements for NUC7i7BNH:
https://www.intel.com/content/www/us/en/support/articles/000023165/mini-pcs/intel-nuc-kits.html
Thanks
I have successfully implemented the whole system following the wiki with vicon.
When I take off using Poses mode or Polynomial trajectory with a higher speed, everything seems perfect. However, when I try to take off at low speed, say I set the intermediate point separation at 0.01, it takes off slowly, but somehow begin to rotate continuously. I check the current_reference and roll_pitch_yawrate_thrust topics, the reference yaw is right and not changing, but the yawrate given by nMPC have a constant 1.5 value, then gradually decease to 0, then constant 1.5 again. If I turn the serial switch off and on again, it can go back to normal and stop rotating, but even this trick doesn't always work.
Any ideas of why this is happening and possible solutions?
Thanks!
it is not clear what DJI is publishing on the battery voltage variable. Seems to be a percentage. To be investigated
Hi,
In the Hardware and Software versions page, the official ROS packages for DJI onboard SDK is not included in the list, but later in the N1 Autopilot section, the MPC with MSF and ROVIO section and some others later, the dji-sdk package is mentioned in some of the commands (e.g. $roslaunch dji_sdk Onboard_exp_with_zr300_rw_indoor_falcon2.launch). I understand the official ROS package from DJI is then required, is that right? Or is it that the commands are maybe outdated? I saw in the deprecated repo there was a ROS package called dji_sdk.
Thanks in advance
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.