| 123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class SubscribeSetpointGenerator : MonoBehaviour
- {
- public SteeringLineRobot Robot;
- public string topicname;
- //private Float32ArraySubscriber subscriber;
- void Start()
- {
- //subscriber = new Float32ArraySubscriber(topicname);
- }
- void FixedUpdate()
- {
- /*var values = subscriber.GetMessage();
- Debug.Log("in: " + values.data_.Length);
- Debug.Log("lastm lay dim l: " + values.layout_.dim_.Length);*/
- //var values = subscriber.GetArray();
- /*if (values.data_.Length == 2)
- {
- Debug.Log("uint n: " + values.layout_.dim_[0].size_);
- Debug.Log("lay d offset: " + values.layout_.data_offset_);
- Debug.Log("inL: " + values.data_[0]);
- Debug.Log("inR: " + values.data_[1]);
- }*/
- //if (values.Length == 2)
- //{
- // Debug.Log("speedsetpoint L : " + values[0]);
- // Debug.Log("speedsetpoint R : " + values[1]);
- // Robot.leftspeedsetpoint = values[0];
- // Robot.rightspeedsetpoint = values[1];
- //}
- }
- private void OnDisable()
- {
- //subscriber.Cleanup();
- }
- }
|