Coder Social home page Coder Social logo

Comments (1)

dridri avatar dridri commented on September 20, 2024

I did not finish it yet, but you could take a look at the Configuration wiki.
This is more than just a configuration file, the LUA engine actually spawn class (by allocating and calling constructors)) instances by itself. If you are not afraid of automatically-generated C++ code, you can take a look at flight/build/lua_init.cpp:lua_init()

Take a look to /flight/config.lua as an example.

Some variables are mandatory, but most of their values should be ok if left empty :

frame = Multicopter {
	maxspeed = 1.0,
	motors = {},
	matrix = {}
}

imu = IMU {
	gyroscopes = {},
	accelerometers = {},
	magnetometers = {},
	altimeters = {},
	gpses = {},
}

-- same scales as betaflight
PID.pscale = 0.032029
PID.iscale = 0.244381
PID.dscale = 0.000529
stabilizer = Stabilizer {
	loop_time = 500, -- 500 ยตs => 2000Hz stabilizer update
	rate_speed = 1000, -- deg/sec
	pid_roll = PID( 45, 70, 40 ),
	pid_pitch = PID( 46, 70, 40 ),
	pid_yaw = PID( 45, 90, 2 ),
	horizon_angles = Vector( 20.0, 20.0 ),
	pid_horizon = PID( 150, 0, 0 )
}

controller = Controller {
	expo = Vector(4, 4, 3.5, 2.25),
	link = Socket {
		type = Socket.UDP,
		port = 2020,
		read_timeout = 500
	}
}

For the camera, something like this should be what you are asking for :

camera_link = Socket {
	type = Socket.UDPLite,
	port = 2021,
	broadcast = false
}

camera = LinuxCamera {
	vflip = false,
	hflip = false,
	hdr = true, -- this forces framerate down to 30 (HW limitation)
	width = 1920,
	height = 1080,
	framerate = 50,
	sharpness = 0.5,
	preview_output = LiveOutput(), -- this live outputs to HDMI / DPI / CRT / etc, can be removed
	video_output = V4L2Encoder {
		video_device = "/dev/video11",
		bitrate = 8 * 1024 * 1024,
		width = 1920,
		height = 1080,
		framerate = 30,
		link = camera_link
	}
}

In the controller_pc app, go to File โ†’ Settings, Connection tab, then :

  • select TCP/IP mode
  • enter your PI4's IP adress
  • choose UDP port 2020 for controller
  • choose UDPLite port 2021 for video

You don't have to start video recording, the live stream should show up by itself without any action

from bcflight.

Related Issues (10)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.