Example #1
0
    void Start()
    {
        odometryPublisher = node.CreatePublisher <nav_msgs.msg.Odometry>(OdometryTopic);
        tfPublisher       = node.CreatePublisher <tf2_msgs.msg.TFMessage>(TfTopic);

        clock = new rclcs.Clock();

        odometryMsg = new nav_msgs.msg.Odometry();
        odometryMsg.header.frame_id = "/odom";
        odometryMsg.child_frame_id  = "/base_footprint";
        robotPose  = odometryMsg.pose;
        robotTwist = odometryMsg.twist;

        tfMsg = new tf2_msgs.msg.TFMessage();
        tfMsg.transforms_init(1);
        tfTransformStamped = tfMsg.transforms[0];
        tfTransformStamped.header.frame_id = "/odom";
        tfTransformStamped.child_frame_id  = "/base_footprint";

        odometryMsg.pose.covariance  = poseCovarianceDiagonal.CovarianceMatrixFromDiagonal();
        odometryMsg.twist.covariance = twistCovarianceDiagonal.CovarianceMatrixFromDiagonal();

        if (BaseRigidbody == null)
        {
            BaseRigidbody = GetComponentInChildren <Rigidbody>();
        }
    }
 void Start()
 {
     jointStateMsg       = new sensor_msgs.msg.JointState();
     jointStatePublisher = node.CreatePublisher <sensor_msgs.msg.JointState>(JointStateTopicName);
     clock = new rclcs.Clock();
 }
Example #3
0
 private void Init()
 {
     CreateRosContext();
     Clock = new rclcs.Clock();
 }