Skip to content

calculation #6

@ALA96

Description

@ALA96

Excuse me Sir, I want to ask about this. What does these lines mean? How to get calculation for pitch and roll?

Thank you for your attention

// Update at 20Hz
var increment = 0;
setInterval(function() {
// Attitude update
attitude.setRoll(30Math.sin(increment/10));
attitude.setPitch(50
Math.sin(increment/20));

// Heading update
heading.setHeading(increment);

// Private methods
function _setRoll(roll){
placeholder.each(function(){
$(this).find('div.instrument.attitude div.roll').css('transform', 'rotate('+roll+'deg)');
});
}

	function _setPitch(pitch){
		// alert(pitch);
		if(pitch>constants.pitch_bound){pitch = constants.pitch_bound;}
		else if(pitch<-constants.pitch_bound){pitch = -constants.pitch_bound;}
		placeholder.each(function(){
			$(this).find('div.instrument.attitude div.roll div.pitch').css('top', pitch*0.7 + '%');
		});
	}

	function _setHeading(heading){
		placeholder.each(function(){
			$(this).find('div.instrument.heading div.heading').css('transform', 'rotate(' + -heading + 'deg)');
		});	
	}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions