Skip to content

Commit

Permalink
AP_DDS: removed commented code in test and fixed comments on AP_DDS_C…
Browse files Browse the repository at this point in the history
…lient
  • Loading branch information
tizianofiorenzani committed Sep 21, 2024
1 parent 86564a1 commit 7a705f3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,8 @@ def __init__(self):
self.climbing_event_object = threading.Event()

self._client_arm = self.create_client(ArmMotors, "/ap/arm_motors")
# while not self._client_arm.wait_for_service(timeout_sec=1.0):
# self.get_logger().info('arm service not available, waiting again...')

self._client_mode_switch = self.create_client(ModeSwitch, "/ap/mode_switch")
# while not self._client_mode_switch.wait_for_service(timeout_sec=1.0):
# self.get_logger().info('mode switch service not available, waiting again...')

self._joy_pub = self.create_publisher(Joy, "/ap/joy", 1)

Expand All @@ -92,16 +88,13 @@ def geopose_cb(self, msg: GeoPoseStamped):
"""Process a GeoPose message."""
stamp = msg.header.stamp
if stamp.sec:
# self.get_logger().info("From AP : Geopose [sec:{}, nsec: {}]".format(stamp.sec, stamp.nanosec))

# Store current state
self._cur_geopose = msg

def twist_cb(self, msg: TwistStamped):
"""Process a Twist message."""
linear = msg.twist.linear
self._climb_rate = linear.z
# self.get_logger().info("From AP : Twist [x:{}, y: {}, z: {}]".format(linear.x, linear.y, linear.z))

def arm(self):
req = ArmMotors.Request()
Expand Down
4 changes: 2 additions & 2 deletions libraries/AP_DDS/AP_DDS_Client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -564,9 +564,9 @@ void AP_DDS_Client::on_topic(uxrSession* uxr_session, uxrObjectId object_id, uin
const uint32_t t_now = AP_HAL::millis();

for (uint8_t i = 0; i < MIN(8U, rx_joy_topic.axes_size); i++) {
// Ignore channels is NaN.
// Setting the override to 0U releases the channel back to the RC.
// Ignore channel override if NaN.
if (std::isnan(rx_joy_topic.axes[i])) {
// Setting the RC override to 0U releases the channel back to the RC.
RC_Channels::set_override(i, 0U, t_now);
} else {
const uint16_t mapped_data = static_cast<uint16_t>(
Expand Down

0 comments on commit 7a705f3

Please sign in to comment.