neurali:ros_husky_laser_versione_20150804
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
Previous revision | |||
— | neurali:ros_husky_laser_versione_20150804 [2020/06/08 22:20] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | |||
+ | ricevo la propriocezione (accelerometro) | ||
+ | |||
+ | <code cpp> | ||
+ | |||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | # | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | #include < | ||
+ | |||
+ | class TeleopTurtle | ||
+ | { | ||
+ | public: | ||
+ | TeleopTurtle(); | ||
+ | |||
+ | private: | ||
+ | void laserCallback(const sensor_msgs:: | ||
+ | void velCallback(const sensor_msgs:: | ||
+ | ros:: | ||
+ | |||
+ | //int linear_, angular_; | ||
+ | //double l_scale_, a_scale_; | ||
+ | ros:: | ||
+ | ros:: | ||
+ | ros:: | ||
+ | }; | ||
+ | |||
+ | |||
+ | TeleopTurtle:: | ||
+ | { | ||
+ | /* | ||
+ | nh_.param(" | ||
+ | nh_.param(" | ||
+ | nh_.param(" | ||
+ | nh_.param(" | ||
+ | */ | ||
+ | |||
+ | //vel_pub_ = nh_.advertise< | ||
+ | |||
+ | laser_sub_ = nh_.subscribe< | ||
+ | |||
+ | vel_sub_ = nh_.subscribe< | ||
+ | |||
+ | } | ||
+ | |||
+ | void TeleopTurtle:: | ||
+ | { | ||
+ | // http:// | ||
+ | // geometry_msgs:: | ||
+ | float acc_lin = vel-> | ||
+ | float vel_ang = vel-> | ||
+ | |||
+ | | ||
+ | |||
+ | /* non esiste un sensore di velocita ma solo un accelerometro | ||
+ | che ti segnala una frenata improvvisa | ||
+ | per misurare la velocita, solo due soluzioni: | ||
+ | montare un gps o misurare la distanza con gli oggetti nel tempo, ma se non ci sono oggetti..... | ||
+ | */ | ||
+ | } | ||
+ | |||
+ | void TeleopTurtle:: | ||
+ | { | ||
+ | |||
+ | unsigned int quantita = laser-> | ||
+ | | ||
+ | unsigned int copia[9]; //le distanze si misurano in dm, da adesso in poi. | ||
+ | |||
+ | for(unsigned int i=0,j=0; i < quantita; j++, | ||
+ | / | ||
+ | v[0], | ||
+ | { | ||
+ | | ||
+ | } | ||
+ | | ||
+ | unsigned int* p_min = std:: | ||
+ | /* | ||
+ | std::cout << " | ||
+ | std::cout << (p_min-& | ||
+ | */ | ||
+ | } | ||
+ | |||
+ | int main(int argc, char** argv) | ||
+ | { | ||
+ | ros:: | ||
+ | TeleopTurtle teleop_turtle; | ||
+ | ros::Rate rate(10); | ||
+ | ros:: | ||
+ | } | ||
+ | </ |
neurali/ros_husky_laser_versione_20150804.txt · Last modified: 2020/06/08 22:20 by 127.0.0.1