Posts

Showing posts from January 22, 2019

Unused variables warning in address.call return tuple (bool, bytes memory)

Image
2 I have the following code fragment. function forward(address destination, bytes memory data) public { (bool res, bytes memory retData) = destination.call(data); assert(res); } Since retData is not used, I am getting the following warning (compiled with solidity 0.5.0): Compilation warnings encountered: /Users/ivica/Documents/deka/hekate.reloaded/digits-node/contracts/IdentityProxy.sol:55:20: Warning: Unused local variable. (bool res, bytes memory retData) = destination.call(data); ^------------------^ Question: how to get rid of it? solidity solidity-best-practices share | improve this question asked Dec 2...

Calculation of Nutation and Rotation from Pitch and roll (yaw is fixed to 0)

Image
0 $begingroup$ i am stuck attempting to convert two angles (pitch and roll) to represent tilt within a circle. Take a plane $(Z text{(Vertical)}, X text{(Roll)}, Y text{(Pitch)})$ If i have $45$ degrees of roll, $Z$ is $45$ degrees from vertical. If I have $-10$ degrees of Pitch, $Z$ is $-10$ degrees from vertical. Thats fine, but if I have BOTH $45$ degrees of roll, and $-10$ degrees of pitch, how do i find out how much i have? The application is an inclinometer. I need to combine pitch and roll angles to show how many degrees from vertical the object is, and in which direction it is leaning. ($0$ degrees up, $90$ degrees right, $180$ degrees down, $270$ left.) I have been googling for hours and i am sure i have looked straight past the solution but my brain is cooked and i can't find the solution...