All new accounts created on Gitlab now require administrator approval. If you invite any collaborators, please let Flux staff know so they can approve the accounts.

grobot_sim.cc 1.46 KB
Newer Older
Timothy Stack's avatar
Timothy Stack committed
1 2 3 4 5
/*
 * EMULAB-COPYRIGHT
 * Copyright (c) 2005 University of Utah and the Flux Group.
 * All rights reserved.
 */
Timothy Stack's avatar
 
Timothy Stack committed
6 7 8 9 10 11 12 13 14 15 16 17 18 19

#include "config.h"

#include <stdio.h>
#include <sys/types.h>
#include <sys/time.h>
#include <unistd.h>

#define GROBOT_SIM

#include "grobot.h"

grobot::grobot()
{
Timothy Stack's avatar
 
Timothy Stack committed
20 21
    dx_est = 0.0f;
    dy_est = 0.0f;
Timothy Stack's avatar
 
Timothy Stack committed
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59
}

grobot::~grobot()
{
}

void grobot::estop()
{
}

void grobot::setWheels(float Vl, float Vr)
{
}

void grobot::setvPath(float Wv, float Wr)
{
}

void grobot::pbMove(float mdisplacement)
{
    
}

void grobot::pbPivot(float pangle)
{
}

void grobot::dgoto(float Dx, float Dy, float Rf)
{
    printf("goto %f, %f, %f\n", Dx, Dy, Rf);

    this->dx_est = Dx;
    this->dy_est = Dy;
    this->gotocomplete = 1;
}

void grobot::resetPosition()
{
Timothy Stack's avatar
Timothy Stack committed
60 61
    this->dx_est = 0;
    this->dy_est = 0;
Timothy Stack's avatar
 
Timothy Stack committed
62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
}

void grobot::updatePosition()
{
}

float grobot::getArclen()
{
    return 0.0f;
}

void grobot::getDisplacement(float &dxtemp, float &dytemp)
{
    dxtemp = this->dx_est;
    dytemp = this->dy_est;
}

int grobot::getGstatus()
{
    return 0;
}

int grobot::getGOTOstatus()
{
    int retval = this->gotocomplete;

    this->gotocomplete = 0;
    return retval;
}

void grobot::sleepy()
{
    struct timeval tv = { 0, 100 };

    select(0, NULL, NULL, NULL, &tv);
}

void grobot::setCBexec(int id)
{
}

Timothy Stack's avatar
 
Timothy Stack committed
103
void grobot::setCBstatus(int id, int status, cb_type_t cbt)
Timothy Stack's avatar
 
Timothy Stack committed
104 105 106 107 108 109 110
{
}

void grobot::createNULLbehavior()
{
}

Timothy Stack's avatar
 
Timothy Stack committed
111
void grobot::createPRIMbehavior(cb_type_t cbt)
Timothy Stack's avatar
 
Timothy Stack committed
112 113 114 115 116 117
{
}

void grobot::set_gotocomplete()
{
}