dennisss / cfbridge Goto Github PK
View Code? Open in Web Editor NEWConnector for MAVLink on Crazyflies running PX4
License: MIT License
Connector for MAVLink on Crazyflies running PX4
License: MIT License
Hi,
I am using your cfbridge.py that seems to work better (i.e. with less than 0.5% data loss) as compared to the cpp source code while communicating with crazyflie using crazyradio PA. The only modifications I made was to set the number of retries in radiodriver.py to 3 and to only send CRTP messages containing mavlink packets to QGC in here i.e. by checking if the pk.port== CRTP_PORT_MAVLINK
I will open a PR soon for these changes once bitcraze replies how I can set_arc using their crazyflie class and hence in cfbridge rather than hardcoding in radiodriver.py
Data loss while sending msgs from QGC to Crazyflie (via cfbridge c++) is around 5-7% , even with sending joystick commands at 5Hz. This seems to be the significant factor in creating issues with radio communication, such as arming/disarming command is not received by crazyflie. However, cfbridge.py works fine with the modifications discussed above, changes in syslink, and in QGC to send joystick messages at constant rate of 10Hz (will open a PR soon).
It would be nice to add optional command line args for specifying a host / port other than localhost:14550. As it is now, I have my own hack which modified the cfclient_open function, and added optional vars to the Makefile like so
$make run DEST=<host ip address>
This would add desirable flexibility, particularly for people working in mixed OS environments, such as with a host machine and guest vm.
I would be happy to implement this on a branch for you to test.
Hi , I want to put px4 software on the crazyflie 2.0
and I follow this instruction
https://docs.px4.io/en/flight_controller/crazyflie2.html#quick-summary
I have done to the step that
cfbridge can make run and the console show connected
and now I have some problems:
I cannot roslaunch mavros px4.launch fcu_url:="udp://:[email protected]:14555"
in ROS
It show error like this
ncrl@ncrl-VirtualBox:~/cfbridge$ roslaunch mavros px4.launch fcu_url:="udp://:[email protected]:14555"
... logging to /home/ncrl/.ros/log/f845a84c-b55b-11e7-829b-0800273f37ab/roslaunch-ncrl-VirtualBox-17411.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://ncrl-VirtualBox:41977/
SUMMARY
========
CLEAR PARAMETERS
* /mavros/
PARAMETERS
* /mavros/cmd/use_comp_id_system_control: False
* /mavros/conn/heartbeat_rate: 1.0
* /mavros/conn/system_time_rate: 1.0
* /mavros/conn/timeout: 10.0
* /mavros/conn/timesync_rate: 10.0
* /mavros/distance_sensor/hrlv_ez4_pub/field_of_view: 0.0
* /mavros/distance_sensor/hrlv_ez4_pub/frame_id: hrlv_ez4_sonar
* /mavros/distance_sensor/hrlv_ez4_pub/id: 0
* /mavros/distance_sensor/hrlv_ez4_pub/orientation: ROLL_180
* /mavros/distance_sensor/hrlv_ez4_pub/send_tf: True
* /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/x: 0.0
* /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/y: 0.0
* /mavros/distance_sensor/hrlv_ez4_pub/sensor_position/z: -0.1
* /mavros/distance_sensor/laser_1_sub/id: 3
* /mavros/distance_sensor/laser_1_sub/orientation: ROLL_180
* /mavros/distance_sensor/laser_1_sub/subscriber: True
* /mavros/distance_sensor/lidarlite_pub/field_of_view: 0.0
* /mavros/distance_sensor/lidarlite_pub/frame_id: lidarlite_laser
* /mavros/distance_sensor/lidarlite_pub/id: 1
* /mavros/distance_sensor/lidarlite_pub/orientation: ROLL_180
* /mavros/distance_sensor/lidarlite_pub/send_tf: True
* /mavros/distance_sensor/lidarlite_pub/sensor_position/x: 0.0
* /mavros/distance_sensor/lidarlite_pub/sensor_position/y: 0.0
* /mavros/distance_sensor/lidarlite_pub/sensor_position/z: -0.1
* /mavros/distance_sensor/sonar_1_sub/id: 2
* /mavros/distance_sensor/sonar_1_sub/orientation: ROLL_180
* /mavros/distance_sensor/sonar_1_sub/subscriber: True
* /mavros/fake_gps/eph: 2.0
* /mavros/fake_gps/epv: 2.0
* /mavros/fake_gps/fix_type: 3
* /mavros/fake_gps/geo_origin/alt: 408.0
* /mavros/fake_gps/geo_origin/lat: 47.3667
* /mavros/fake_gps/geo_origin/lon: 8.55
* /mavros/fake_gps/gps_rate: 5.0
* /mavros/fake_gps/mocap_transform: True
* /mavros/fake_gps/satellites_visible: 5
* /mavros/fake_gps/tf/child_frame_id: fix
* /mavros/fake_gps/tf/frame_id: map
* /mavros/fake_gps/tf/listen: False
* /mavros/fake_gps/tf/rate_limit: 10.0
* /mavros/fake_gps/tf/send: False
* /mavros/fake_gps/use_mocap: True
* /mavros/fake_gps/use_vision: False
* /mavros/fcu_url: udp://:14550@127....
* /mavros/gcs_url:
* /mavros/global_position/frame_id: map
* /mavros/global_position/rot_covariance: 99999.0
* /mavros/global_position/tf/child_frame_id: base_link
* /mavros/global_position/tf/frame_id: map
* /mavros/global_position/tf/global_frame_id: earth
* /mavros/global_position/tf/send: False
* /mavros/global_position/use_relative_alt: True
* /mavros/image/frame_id: px4flow
* /mavros/imu/angular_velocity_stdev: 0.000349065850399
* /mavros/imu/frame_id: base_link
* /mavros/imu/linear_acceleration_stdev: 0.0003
* /mavros/imu/magnetic_stdev: 0.0
* /mavros/imu/orientation_stdev: 1.0
* /mavros/local_position/frame_id: map
* /mavros/local_position/tf/child_frame_id: base_link
* /mavros/local_position/tf/frame_id: map
* /mavros/local_position/tf/send: False
* /mavros/local_position/tf/send_fcu: False
* /mavros/mission/pull_after_gcs: True
* /mavros/mocap/use_pose: True
* /mavros/mocap/use_tf: False
* /mavros/odometry/estimator_type: 3
* /mavros/odometry/frame_tf/desired_frame: ned
* /mavros/plugin_blacklist: ['safety_area', '...
* /mavros/plugin_whitelist: []
* /mavros/px4flow/frame_id: px4flow
* /mavros/px4flow/ranger_fov: 0.118682389136
* /mavros/px4flow/ranger_max_range: 5.0
* /mavros/px4flow/ranger_min_range: 0.3
* /mavros/safety_area/p1/x: 1.0
* /mavros/safety_area/p1/y: 1.0
* /mavros/safety_area/p1/z: 1.0
* /mavros/safety_area/p2/x: -1.0
* /mavros/safety_area/p2/y: -1.0
* /mavros/safety_area/p2/z: -1.0
* /mavros/setpoint_accel/send_force: False
* /mavros/setpoint_attitude/reverse_thrust: False
* /mavros/setpoint_attitude/tf/child_frame_id: target_attitude
* /mavros/setpoint_attitude/tf/frame_id: map
* /mavros/setpoint_attitude/tf/listen: False
* /mavros/setpoint_attitude/tf/rate_limit: 50.0
* /mavros/setpoint_attitude/use_quaternion: False
* /mavros/setpoint_position/tf/child_frame_id: target_position
* /mavros/setpoint_position/tf/frame_id: map
* /mavros/setpoint_position/tf/listen: False
* /mavros/setpoint_position/tf/rate_limit: 50.0
* /mavros/startup_px4_usb_quirk: True
* /mavros/sys/disable_diag: False
* /mavros/sys/min_voltage: 10.0
* /mavros/target_component_id: 1
* /mavros/target_system_id: 1
* /mavros/tdr_radio/low_rssi: 40
* /mavros/time/time_ref_source: fcu
* /mavros/time/timesync_avg_alpha: 0.6
* /mavros/time/timesync_mode: MAVLINK
* /mavros/vibration/frame_id: base_link
* /mavros/vision_pose/tf/child_frame_id: vision_estimate
* /mavros/vision_pose/tf/frame_id: map
* /mavros/vision_pose/tf/listen: False
* /mavros/vision_pose/tf/rate_limit: 10.0
* /mavros/vision_speed/listen_twist: False
* /rosdistro: kinetic
* /rosversion: 1.12.7
NODES
/
mavros (mavros/mavros_node)
ROS_MASTER_URI=http://localhost:11311
core service [/rosout] found
process[mavros-1]: started with pid [17430]
[FATAL] [1508479805.283950117]: UAS: GeographicLib exception: File not readable /usr/share/GeographicLib/geoids/egm96-5.pgm | Run install_geographiclib_dataset.sh script in order to install Geoid Model dataset!
================================================================================REQUIRED process [mavros-1] has died!
process has finished cleanly
log file: /home/ncrl/.ros/log/f845a84c-b55b-11e7-829b-0800273f37ab/mavros-1*.log
Initiating shutdown!
================================================================================
[mavros-1] killing on exit
shutting down processing monitor...
... shutting down processing monitor complete
done
Is it normal that when I turn on the crazyflie2.0 than the propellers start to rotate constantly?
the firmware version is
https://github.com/dennisss/Firmware branch:cf2-rc
Is this version correct?
when cfbridge connected successfully , I cannot see my cf2 in QGC , am I really connect successfully?
I will thank you for your replying
Hi,
I've been trying to run cfbridge and use a joystick to control my CF2.
While CF2 is connected to the computer via USB, everything seems to be working fine. I can calibrate sensors, even arm/disarm and switch flight modes. So I think the firmware side should be working fine. But once I disconnect the USB cable, I couldn't get the cfbridge to run properly with PA radio. The command line output is either
"Waiting for messages...
error in transfer: LIBUSB_TRANSFER_TIMED_OUT"
or nothing at all. I can use my cellphone to connect to CF2 but I cannot control it using the screen touch pads. I think maybe it's because the quad is not armed.
BTW, I'm using Ubuntu 14.04 64-bit.
Any suggestions?
Thanks,
rxdu
hi,
when i try to build cfbridge, there is an error:
[ 25%] Building CXX object CMakeFiles/bridge.dir/src/bridge.cpp.o
/home/zbf/cfbridge/src/bridge.cpp: In member function ‘void Bridge::run()’:
/home/zbf/cfbridge/src/bridge.cpp:109:28: error: ‘libusb_free_pollfds’ was not declared in this scope
libusb_free_pollfds(usbfds);
^
how can i solve it?
Hi, I'm trying to setup the cfbridge and I'm getting the following "bind failed: Address already in use Failed to open client"
I have tried changing to different addresses and I can't make it work. Any suggestions would be greatly appreciated.
Thanks!
Hi Denniss,
I have created a PR for crazyflie-lib-python to include cfbridge.py in it. This will allow users to use cfbridge.py with cflib. Needed your approval on it.
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.