To receive notifications about scheduled maintenance, please subscribe to the mailing-list gitlab-operations@sympa.ethz.ch. You can subscribe to the mailing-list at https://sympa.ethz.ch

Commit aec59ab3 authored by tiagos's avatar tiagos
Browse files

started moving the CFs from channelLUT to the Hangar

parent 837867c9
......@@ -185,6 +185,9 @@ private:
CFLinker* cf_linker;
std::vector<UWBMarker*> anchor_markers;
std::map<std::string, std::string> channel_LUT;
std::vector<crazyFly*> CF_vector;
ros::ServiceClient UWBServiceClient;
ros::Publisher DBChangedPublisher;
......@@ -217,6 +220,8 @@ private:
bool updateUWBSettings(bool enableChecked);
void updateAnchors(const Anchors* const a);
void loadCFs(ros::NodeHandle& nh);
};
......
......@@ -266,6 +266,8 @@ void MainGUIWindow::_init()
invertCheckBoxes.push_back(ui->invA5);
invertCheckBoxes.push_back(ui->invA6);
loadCFs(nodeHandle);
#endif
}
......@@ -1044,7 +1046,10 @@ void MainGUIWindow::updateAnchors(const Anchors* const a)
ui->table_anchorPos->setRowCount(0);
for(int i = 0; i < anchor_markers.size(); ++i)
{
scene->removeItem(anchor_markers[i]);
delete anchor_markers[i];
}
anchor_markers.clear();
......@@ -1099,6 +1104,48 @@ void MainGUIWindow::updateAnchors(const Anchors* const a)
}
}
void MainGUIWindow::loadCFs(ros::NodeHandle& nh)
{
bool success = true;
unsigned int counter = 0;
XmlRpc::XmlRpcValue my_list;
while(success)
{
std::string param = "CF" + std::to_string(counter);
success = nh.getParam(param, my_list);
++counter;
if(success)
channel_LUT.insert(std::pair<std::string, std::string>(my_list[0], my_list[1]));
}
--counter;
for (std::map<std::string, std::string>::iterator it=channel_LUT.begin(); it!=channel_LUT.end(); ++it)
ROS_WARN("%s, %s", it->first.c_str(), it->second.c_str());
// TEST
/*XmlRpc::XmlRpcValue my_list;
if(!nodeHandle.getParam("CF_LUT", my_list))
ROS_ERROR("fail");*/
/*else
ROS_ERROR("sucksess: %s: %s", res[0][0].c_str(), res[0][1].c_str());//printf(res.c_str());
*/
//std::vector<std::string, std::string> res;
ROS_WARN("function called");
}
void MainGUIWindow::on_checkBox_enable_UWB_toggled(bool checked)
{
// Send Command to enable UWB to UWBManagerService
......@@ -1240,6 +1287,8 @@ void MainGUIWindow::on_set_invert_button_pressed()
void MainGUIWindow::on_comboBoxCFs_currentTextChanged(const QString &arg1)
{
ROS_WARN("Argument %s", arg1.toStdString().c_str());
std::string key = arg1.toStdString();
auto it = channel_LUT.find(key);
if(it != channel_LUT.end())
......
......@@ -12,6 +12,7 @@
<!-- When we have a GUI, this has to be adapted and included -->
<node pkg="d_fall_pps" name="my_GUI" output="screen" type="my_GUI" required="true">
<rosparam command="load" file="$(find d_fall_pps)/param/CFHangar.yaml" />
<!-- <rosparam command="load" file="$(find d_fall_pps)/launch/ControlParams.yaml" /> -->
</node>
......
# This is the LUT for matching
# CF names with their radio addresses
"CF0": ["UWB_CF01", "0/80/250K/E7E7E7E7E7"]
"CF1": ["UWB_CF02", "0/70/2M/E7E7E7E7E7"]
"CF2": ["demo", "asdasda"]
"CF3": ["UWB_CF0345", "0/70/2M/E7E7Efdsfdsfdsfs7E7E7"]
# CF_LUT: [
# ["UWB_CF01", "0/80/250K/E7E7E7E7E7"],
# ["UWB_CF02", "0/70/2M/E7E7E7E7E7"]
# ]
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment