return 0;
}
+/**
+ * Sends #CAN_HOKUYO_PITCH message.
+ *
+ * - data[1] = orte_data->pusher.pos & 0xFF; // lower byte
+ * - data[0] = orte_data->pusher.pos >> 8; // upper byte
+ */
+int set_hokuyo_pitch(struct robottype_orte_data *orte_data)
+{
+ unsigned char data = orte_data->hokuyo_pitch.angle;
+
+ can_send(CAN_HOKUYO_PITCH, sizeof(data), &data);
+ return 0;
+}
+
int can_send(canid_t id, unsigned char length, unsigned char *data)
{
}
}
+void rcv_hokuyo_pitch_cb (const ORTERecvInfo *info, void *vinstance,
+ void *recvCallBackParam)
+{
+ struct robottype_orte_data *orte_data = (struct robottype_orte_data *)recvCallBackParam;
+
+ switch (info->status) {
+ case NEW_DATA:
+ set_hokuyo_pitch(orte_data);
+ break;
+ case DEADLINE:
+// printf("ORTE deadline occurred - hokuyo pitch receive\n");
+ break;
+ }
+}
+
+
int main(int argc, char *argv[])
{
fd_set read_fd_set;
robottype_subscriber_belts_create(&orte, rcv_belts_cb, &orte);
robottype_subscriber_holder_create(&orte, rcv_holder_cb, &orte);
robottype_subscriber_pusher_create(&orte, rcv_pusher_cb, &orte);
+ robottype_subscriber_hokuyo_pitch_create(&orte, rcv_hokuyo_pitch_cb, &orte);
printf("subscribers OK\n");