Prove per il messaggio di startup

non carica il messaggio dal server dei parametri, no si può pubblicare
un tipo std::string in un topic ROS
This commit is contained in:
2019-10-28 16:37:20 +01:00
parent 5acd7d634d
commit db4a3fab14
8 changed files with 129 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.9.1, 2019-10-23T14:10:27. -->
<!-- Written by QtCreator 4.9.1, 2019-10-28T14:03:33. -->
<qtcreator>
<data>
<variable>EnvironmentId</variable>
@@ -124,7 +124,7 @@
<value type="QString">ROS_PACKAGE_PATH=/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src:/opt/ros/kinetic/share</value>
<value type="QString">ROS_ROOT=/opt/ros/kinetic/share/ros</value>
<value type="QString">ROS_VERSION=1</value>
<value type="QString">SHLVL=194</value>
<value type="QString">SHLVL=392</value>
<value type="QString">TERM=xterm</value>
<value type="QString">_=/usr/bin/env</value>
</valuelist>
@@ -550,6 +550,19 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.RunStepList</value>
<valuemap type="QVariantMap" key="ProjectExplorer.RunStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSAttachToNode</value>
<value type="bool" key="ProjectExplorer.RunStep.Enabled">true</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Arguments"></value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Command">debug</value>
<value type="bool" key="ROSProjectManager.ROSGenericStep.DebugContinueOnAttach">true</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Package">roboglue_ros</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.PackagePath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Target">roboglue_ros_recorder</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.TargetPath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/devel/lib/roboglue_ros/roboglue_ros_recorder</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.RunStepList.Step.1">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSLaunchStep</value>
@@ -562,7 +575,7 @@
<value type="QString" key="ROSProjectManager.ROSGenericStep.Target">roboglue_ros_urdriver_norviz.launch</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.TargetPath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros/launch/roboglue_ros_urdriver_norviz.launch</value>
</valuemap>
<value type="int" key="ProjectExplorer.RunStepList.StepsCount">1</value>
<value type="int" key="ProjectExplorer.RunStepList.StepsCount">2</value>
</valuemap>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">true</value>
@@ -571,7 +584,99 @@
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">false</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">3</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.3">
<value type="QString" key="Analyzer.Perf.CallgraphMode">dwarf</value>
<valuelist type="QVariantList" key="Analyzer.Perf.Events">
<value type="QString">cpu-cycles</value>
</valuelist>
<valuelist type="QVariantList" key="Analyzer.Perf.ExtraArguments"/>
<value type="int" key="Analyzer.Perf.Frequency">250</value>
<value type="QString" key="Analyzer.Perf.SampleMode">-F</value>
<value type="bool" key="Analyzer.Perf.Settings.UseGlobalSettings">true</value>
<value type="int" key="Analyzer.Perf.StackSize">4096</value>
<value type="bool" key="Analyzer.QmlProfiler.AggregateTraces">false</value>
<value type="bool" key="Analyzer.QmlProfiler.FlushEnabled">false</value>
<value type="uint" key="Analyzer.QmlProfiler.FlushInterval">1000</value>
<value type="QString" key="Analyzer.QmlProfiler.LastTraceFile"></value>
<value type="bool" key="Analyzer.QmlProfiler.Settings.UseGlobalSettings">true</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
<value type="QString" key="Analyzer.Valgrind.KCachegrindExecutable">kcachegrind</value>
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
<value type="int">0</value>
<value type="int">1</value>
<value type="int">2</value>
<value type="int">3</value>
<value type="int">4</value>
<value type="int">5</value>
<value type="int">6</value>
<value type="int">7</value>
<value type="int">8</value>
<value type="int">9</value>
<value type="int">10</value>
<value type="int">11</value>
<value type="int">12</value>
<value type="int">13</value>
<value type="int">14</value>
</valuelist>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">ROS Run Configuration</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">RoboGlueRUN_test</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSRunConfigurationThis is a test</value>
<valuemap type="QVariantMap" key="ROSProjectManager.RunStepList">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Run</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.RunStepList</value>
<valuemap type="QVariantMap" key="ProjectExplorer.RunStepList.Step.0">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSAttachToNode</value>
<value type="bool" key="ProjectExplorer.RunStep.Enabled">true</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Arguments"></value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Command">debug</value>
<value type="bool" key="ROSProjectManager.ROSGenericStep.DebugContinueOnAttach">false</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Package">roboglue_ros</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.PackagePath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Target">roboglue_ros_test</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.TargetPath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/devel/lib/roboglue_ros/roboglue_ros_test</value>
</valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.RunStepList.Step.1">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ROSProjectManager.ROSLaunchStep</value>
<value type="bool" key="ProjectExplorer.RunStep.Enabled">true</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Arguments"></value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Command">roslaunch</value>
<value type="bool" key="ROSProjectManager.ROSGenericStep.DebugContinueOnAttach">true</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Package">roboglue_ros</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.PackagePath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.Target">test.launch</value>
<value type="QString" key="ROSProjectManager.ROSGenericStep.TargetPath">/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros/launch/test.launch</value>
</valuemap>
<value type="int" key="ProjectExplorer.RunStepList.StepsCount">2</value>
</valuemap>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
</valuemap>
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">4</value>
</valuemap>
</data>
<data>

View File

@@ -40,7 +40,7 @@
<!-- Message Relay to/from MQTT -->
<node name="roboglue_ros_relay" pkg="roboglue_ros" type="roboglue_ros_relay" output="screen" required="true">
<param name="parameter_ns" type="string" value="/roboglue_ros_common/" />
<param name="startup_msg" type="string" value='{"STARTUP":"RELAY"}'>
<param name="startup_msg" type="string" value='{"STARTUP":"RELAY"}'/>
<param name="mqtt_host" type="string" value="tcp://localhost:1883" />
<param name="mqtt_qos" type="int" value="0" />
<param name="mqtt_INstate" type="string" value="roboglue_com/com2ros/state" />
@@ -54,14 +54,14 @@
<!-- Real Time Tracking -->
<node name="roboglue_ros_follower" pkg="roboglue_ros" type="roboglue_ros_follower" output="screen" required="true">
<param name="parameter_ns" type="string" value="roboglue_ros_common" />
<param name="startup_msg" type="string" value='{"STARTUP":"FOLLOWER"}'>
<param name="startup_msg" type="string" value='{"STARTUP":"FOLLOWER"}'/>
<param name="jog_pub_rate" type="int" value="5" />
</node>
<!-- Tracking data Recorder/Player -->
<node name="roboglue_ros_recorder" pkg="roboglue_ros" type="roboglue_ros_recorder" output="screen" required="true">
<param name="parameter_ns" type="string" value="/roboglue_ros_common/" />
<param name="startup_msg" type="string" value='{"STARTUP":"RECORDER"}'>
<param name="startup_msg" type="string" value='{"STARTUP":"RECORDER"}'/>
<param name="point_group_mode" type="string" value="dist" />
<param name="planning_mode" type="string" value="path" />
<param name="meta_dir" type="string" value="/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros/config/meta/" />

View File

@@ -40,6 +40,7 @@
<!-- Message Relay to/from MQTT -->
<node name="roboglue_ros_relay" pkg="roboglue_ros" type="roboglue_ros_relay" output="screen" required="true">
<param name="parameter_ns" type="string" value="/roboglue_ros_common/" />
<param name="startup_msg" type="string" value='{"STARTUP":"RELAY"}'/>
<param name="mqtt_host" type="string" value="tcp://localhost:1883" />
<param name="mqtt_qos" type="int" value="0" />
<param name="mqtt_INstate" type="string" value="roboglue_com/com2ros/state" />
@@ -53,12 +54,14 @@
<!-- Real Time Tracking -->
<node name="roboglue_ros_follower" pkg="roboglue_ros" type="roboglue_ros_follower" output="screen" required="true">
<param name="parameter_ns" type="string" value="roboglue_ros_common" />
<param name="startup_msg" type="string" value='{"STARTUP":"FOLLOWER"}'/>
<param name="jog_pub_rate" type="int" value="5" />
</node>
<!-- Tracking data Recorder/Player -->
<node name="roboglue_ros_recorder" pkg="roboglue_ros" type="roboglue_ros_recorder" output="screen" required="true">
<param name="parameter_ns" type="string" value="/roboglue_ros_common/" />
<param name="startup_msg" type="string" value='{"STARTUP":"RECORDER"}'/>
<param name="point_group_mode" type="string" value="dist" />
<param name="planning_mode" type="string" value="path" />
<param name="meta_dir" type="string" value="/home/emanuele/Documents/GestioneMacchine/Robot_Incollaggio/Software/roboglue_ros_ws/src/roboglue_ros/config/meta/" />

View File

@@ -178,6 +178,7 @@ int main(int argc, char **argv) {
/// node variables ///
int loopRate, msgBufferSize, jogPubRate;
std::string param_ns;
std::string startup_msg_tmp;
std_msgs::String startup_msg;
ROS_topics ros_topics;
/// internal state struct ////
@@ -192,7 +193,7 @@ int main(int argc, char **argv) {
ros::NodeHandle nh;
///read parameters from server ///
nh.getParam("/roboglue_ros_relay/parameter_ns", param_ns);
nh.getParam(param_ns+"startup_msg", startup_msg.data);
nh.getParam(param_ns+"startup_msg", startup_msg_tmp);
nh.getParam(param_ns+"loop_rate", loopRate);
nh.getParam(param_ns+"msg_buffer", msgBufferSize);
nh.getParam(param_ns+"INstate", ros_topics.stateSub);
@@ -266,7 +267,9 @@ int main(int argc, char **argv) {
while (ros::ok() && is.isRunning) {
if (startCycle){
startCycle = false;
startup_msg.data = startup_msg_tmp.c_str();
publishers[command_pub.getTopic()]->publish(startup_msg);
ros::spinOnce();
}
ROS_DEBUG_ONCE("Follower Node Looping");
ros::spinOnce();

View File

@@ -230,6 +230,7 @@ int main(int argc, char **argv) {
/// player variables ///
std_msgs::String startup_msg;
std::string startup_msg_tmp;
double dsCounter, dtCounter;
std::vector<pointRecord> tempPlayVector;
std::vector<geometry_msgs::PoseStamped> tempPlanningVector;
@@ -241,7 +242,7 @@ int main(int argc, char **argv) {
/// read parameters from server ///
//load common parameters
nh.getParam("/roboglue_ros_recorder/parameter_ns", param_ns);
nh.getParam(param_ns+"startup_msg", startup_msg.data);
nh.getParam(param_ns+"startup_msg", startup_msg_tmp);
nh.getParam(param_ns+"loop_rate", loopRate);
nh.getParam(param_ns+"msg_buffer", msgBufferSize);
nh.getParam(param_ns+"min_nonzero_move", nonzero_move);
@@ -318,7 +319,9 @@ int main(int argc, char **argv) {
rviz_data.vtools->loadRemoteControl();
rviz_data.vtools->deleteAllMarkers();
rviz_data.vtools->trigger();
startup_msg.data = startup_msg_tmp.c_str();
publishers[command_pub.getTopic()]->publish(startup_msg);
ros::spinOnce();
}
ROS_DEBUG_ONCE("Recorder Node Looping");
ros::spinOnce();

View File

@@ -84,13 +84,14 @@ int main(int argc, char **argv) {
std::string param_ns;
MQTT_topics mqtt_topics;
ROS_topics ros_topics;
std::string startup_msg_tmp;
std_msgs::String startup_msg;
/// setup node parameters ///
ros::init(argc, argv, "roboglue_relay");
ros::NodeHandle nh;
///read parameters from server ///
nh.getParam("/roboglue_ros_relay/parameter_ns", param_ns);
nh.getParam(param_ns+"startup_msg", startup_msg.data);
nh.getParam(param_ns+"startup_msg", startup_msg_tmp);
nh.getParam(param_ns+"loop_rate", loopRate);
nh.getParam(param_ns+"msg_buffer", msgBufferSize);
nh.getParam(param_ns+"INstate", ros_topics.stateSub);
@@ -154,7 +155,9 @@ int main(int argc, char **argv) {
while (ros::ok()) {
if (startCycle){
startCycle = false;
startup_msg.data = startup_msg_tmp.c_str();
publishers[command_pub.getTopic()]->publish(startup_msg);
ros::spinOnce();
}
ROS_DEBUG_ONCE("Relay Node Looping");
ros::spinOnce();

Submodule src/universal_robot updated: 8ea3f6a181...06a251a9d9

Submodule src/universal_robots_ros_driver updated: 745b2c5fb7...fd5052de36