ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Ok.

Your code snippet does this:

self.TX_cm = int(TX*100)
[..]
msg.x = tagpos.TX_cm

The message definition of AnchorScan shows this:

float64[] x

x is an array (or an unbounded list). You cannot assign a single int to a list.

You'll have to either use msg.x.append(..) or something like msg.x = [tagpos.TX_cm].

Please note btw: ROS uses (derived) SI units for everything, so positions use metres. It might be good not to use centimetres for anything.

Ok.

Your code snippet does this:

self.TX_cm = int(TX*100)
[..]
msg.x = tagpos.TX_cm

The message definition of AnchorScan shows this:

float64[] x

x is an array (or an unbounded list). You cannot assign a single int to a list.

You'll have to either use msg.x.append(..) or something like msg.x = [tagpos.TX_cm].

Please note btw: ROS uses (derived) SI units for everything, so positions use metres. It might be good not to use centimetres for anything.


Edit: btw: is this a different indoor_localization/AnchorScan than the one documented here? Because the one documented on the ROS wiki does not have float64[] x.