Hello.
I'm trying to connect the Arduino Duemilanove or Diecimila( with the ATmega328P )with ROS.
Yet I don't understand a bit in ROS so just tried it out.
5 minutes ago everything worked fine. I have not changed anything in the settings from the Arduino IDE, so set ports and set board and the cable typically work.
I've written a quite big sketch, where the Arduino IDE already told me, that stability problems may occur due to the low memory available.
But I could also load this sketch on my Arduino.
Now when I'm trying to load another sketch on my Arduino Duemilanove I am gettin every time the avrude: stk500_recv(): programmer is not responding avrude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00 error code.
Since then I'm not able to load ANY program even the blink program on the Duemilanove.
I remember to solve this problem by just pressing the reset button and then try it again, but now when I'm pressing the reset button the RX and TX or any other LED don't blink.
What happened to my board and can I repair it?
Maybe it is important:
I ran Roscore and Rosserial_arduino ....
When I tried to upload my new sketch, I forgot to stop those running terminals.
And here was the sketch from my last working upload to the Arduino::
#include <ros.h> #include <std_msgs/Empty.h> #include <Arduino.h> #include <MotorWheel.h> #include <Omni3WD.h> #include <Omni4WD.h> #include <PID_Beta6.h> #include <PinChangeInt.h> #include <PinChangeIntConfig.h> irqISR(irq4,isr4); // Interrupt function on the basis of the pulse, work for wheel1 MotorWheel wheel4(3,2,4,5,&irq4); // MotorWheel object called wheel1 // Motor PWM, DIR, Enocder A, B irqISR(irq3,isr3); MotorWheel wheel3(11,12,14,15,&irq3); irqISR(irq2,isr2); MotorWheel wheel2(9,8,16,17,&irq2); irqISR(irq1,isr1); MotorWheel wheel1(10,7,18,19,&irq1); Omni4WD Omni(&wheel1, &wheel2, &wheel3, &wheel4); int velocity = 200; ros::NodeHandle nh; void vorcb(const std_msgs::Empty& vormsg){ Omni.setCarSpeedMMPS(velocity); Omni.setCarAdvance(); } ros::Subscriber<std_msgs::Empty> sub1("vorwaerts", &vorcb); void rueckcb(const std_msgs::Empty& rueckmsg){ Omni.setCarSpeedMMPS(velocity); Omni.setCarBackoff(); } ros::Subscriber<std_msgs::Empty> sub2("ruckwaerts", &rueckcb); void rechtscb(const std_msgs::Empty& rechtsmsg){ Omni.setCarSpeedMMPS(velocity); Omni.setCarRight(); } ros::Subscriber<std_msgs::Empty> sub3("rechts", &rechtscb); void linkscb(const std_msgs::Empty& linksmsg){ Omni.setCarSpeedMMPS(velocity); Omni.setCarLeft(); } ros::Subscriber<std_msgs::Empty> sub4("links", &linkscb); void cwcb(const std_msgs::Empty& cwmsg){ Omni.setCarSpeedMMPS(velocity); Omni.setCarRotateRight(); } ros::Subscriber<std_msgs::Empty> sub5("clockwise", &cwcb); void ccwcb(const std_msgs::Empty& ccwmsg){ Omni.setCarSpeedMMPS(velocity); Omni.setCarRotateLeft(); } ros::Subscriber<std_msgs::Empty> sub6("countercw", &ccwcb); void setup() { //TCCR0B=TCCR0B&0xf8|0x01; wann muss ich das anmachen? TCCR1B=TCCR1B&0xf8|0x01; TCCR2B=TCCR2B&0xf8|0x01; Omni.PIDEnable(0.31,0.01,0,10); nh.initNode(); nh.subscribe(sub1); nh.subscribe(sub2); nh.subscribe(sub3); nh.subscribe(sub4); nh.subscribe(sub5); nh.subscribe(sub6); } void loop() { nh.spinOnce(); delay(1); }
Thanks for your help and sorry for all the english grammar mistakes.