Skip to content
Snippets Groups Projects
Commit 2ff389b9 authored by Sergi Hernandez's avatar Sergi Hernandez
Browse files

Solved a problem with the start_scan() function.

parent ea843761
No related branches found
No related tags found
No related merge requests found
...@@ -163,6 +163,8 @@ void CDynamixelServer::set_bus_id(int bus_id) ...@@ -163,6 +163,8 @@ void CDynamixelServer::set_bus_id(int bus_id)
} }
serial=ftdi_server->get_serial_number(bus_id); serial=ftdi_server->get_serial_number(bus_id);
this->comm_dev=ftdi_server->get_device(serial); this->comm_dev=ftdi_server->get_device(serial);
// configure the communciation device by default
this->set_baudrate(1000000);
this->bus_info.bus_id=bus_id; this->bus_info.bus_id=bus_id;
} }
} }
...@@ -177,6 +179,7 @@ void CDynamixelServer::start_scan(void) ...@@ -177,6 +179,7 @@ void CDynamixelServer::start_scan(void)
} }
else else
{ {
this->stop_scan();
this->close(); this->close();
this->thread_server->start_thread(this->scan_thread_id); this->thread_server->start_thread(this->scan_thread_id);
} }
...@@ -290,6 +293,7 @@ CDynamixel *CDynamixelServer::get_device(int dev_id) ...@@ -290,6 +293,7 @@ CDynamixel *CDynamixelServer::get_device(int dev_id)
dynamixel->usb_access=&this->dynamixel_access; dynamixel->usb_access=&this->dynamixel_access;
dynamixel->node_address=dev_id; dynamixel->node_address=dev_id;
dynamixel->usb_rx_event_id=this->comm_dev->get_rx_event_id(); dynamixel->usb_rx_event_id=this->comm_dev->get_rx_event_id();
this->devices.push_back(dynamixel);
this->dynamixel_access.exit(); this->dynamixel_access.exit();
} }
}catch(CEventTimeoutException &e){ }catch(CEventTimeoutException &e){
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment