You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As far as I've been reading source code (visualsenderplayer.h/.cpp and bodysender.h/.cpp to be more precise) regarding noise generation on angle information received by players it seems there are some differences in angle quantization.
When sending visual information, any angles are first rounded to the nearest integer and then truncated to int. This seems to be some correction from V7 version of the visualsender as some comments describe it
/*!
//===================================================================
//
// CLASS: VisualSensorPlayerV7
//
// DESC: Class for the version 7 visual protocol. This version
// fixed a bug in the generation of directions in that they
// were truncated to int, rather than rounded. This meant
// error in the direction pointed was at most times between
// -0.5 and +0.5 degrees, but occationally between -1.0 and
// +1.0 degrees and at other times exact. With the new method
// of rounding, the error is always between -0.5 and +0.5.
//
//===================================================================
*/
This makes sense as simply truncating would give a -0.9 difference if the actual angle was 1.9 and a +0.9 difference if actual angle was -1.9 for example. Rounding garantee 0.5 absolute difference in any situation.
However, SenseBody gives information about neck angles and velocity directions and there seems to be no rounding of this info before truncating.
On bodysender.cpp:
void
BodySenderPlayerV5::sendNeck()
{
int ang = Rad2IDeg( self().angleNeckCommitted() );
serializer().serializeNeckAngle( transport(),
ang );
}
void
BodySenderPlayerV6::sendVelocity()
{
double mag = Quantize( self().vel().r(), 0.01 );
int head = Rad2IDeg( normalize_angle
( self().vel().th()
- self().angleBodyCommitted()
- self().angleNeckCommitted() ) );
serializer().serializeBodyVelocity( transport(), mag, head );
}
On utility.h:
inline
int
Rad2IDeg( const double & a )
{
return static_cast< int >( a * RAD2DEG );
}
Is there any reason for this or is it a bug?
The text was updated successfully, but these errors were encountered:
It may have been discussed in the past. But, I don't know that.
In my opinion, this would be a potential bug.
If we like to fix this, it is necessary to update the protocol version after some discussions in the community.
wbwatkinson
pushed a commit
to wbwatkinson/rcssserver
that referenced
this issue
Jun 20, 2020
As far as I've been reading source code (visualsenderplayer.h/.cpp and bodysender.h/.cpp to be more precise) regarding noise generation on angle information received by players it seems there are some differences in angle quantization.
When sending visual information, any angles are first rounded to the nearest integer and then truncated to int. This seems to be some correction from V7 version of the visualsender as some comments describe it
This makes sense as simply truncating would give a -0.9 difference if the actual angle was 1.9 and a +0.9 difference if actual angle was -1.9 for example. Rounding garantee 0.5 absolute difference in any situation.
However, SenseBody gives information about neck angles and velocity directions and there seems to be no rounding of this info before truncating.
On bodysender.cpp:
On utility.h:
Is there any reason for this or is it a bug?
The text was updated successfully, but these errors were encountered: