Starting a node twice, with differend parameters
Hallo ,
I want to start my node twice, but it shoud have differend parameter for my COM-Path. Here is my code:
ros::init(argc, argv, "dc2412_upsd");
ros::NodeHandle nh1;
ros::param::get("/read_attempt",loop);
ros::param::get("/com_path", string_var);
DC2412 communication(string_var); //create a objekt
pcommunication=&communication;
ros::ServiceServer service1 = nh1.advertiseService("input_voltage", InputVoltage);
ros::ServiceServer service2 = nh1.advertiseService("output_voltage", OutputVoltage);
ros::ServiceServer service3 = nh1.advertiseService("vcap_voltage", VcapVoltage);
ros::ServiceServer service4 = nh1.advertiseService("set_time_to_shutdown", SetTimeToShutdown);
ros::ServiceServer service5 = nh1.advertiseService("cap_esr_measurment",CapEsrMeasurment);
ros::ServiceServer service6 = nh1.advertiseService("cap_esr",CapEsr);
ros::ServiceServer service7 = nh1.advertiseService("input_current",InputCurrent);
ros::ServiceServer service8 = nh1.advertiseService("charge_current",ChargeCurrent);
ros::Publisher pub1 = nh1.advertise<std_msgs::Int64>("monitorregister",1);
ros::Publisher pub2 = nh1.advertise<std_msgs::Int64>("chargeregister",1);
my launch file:
<launch>
<rosparam command="load" file="$(find ros_dc2412_upsd)config/config.yaml" />
<!--<node pkg="turtlesim" name="sim1" type="turtlesim_node"/>-->
<group ns="dc1">
<node pkg="ros_dc2412_upsd" name="sim" type="dc2412_node"/>
</group>
<group ns="dc2">
<node pkg="ros_dc2412_upsd" name="sim" type="dc2412_node"/>
</group>
</launch>
my parameter file:
com_path : '/dev/ttyS5'
read_attempt : 10
So is it somehow possible? Maybe with the NodeHandle?
Thanks for your help
An observation:
are these services used to configure the node (ie: set parameters / settings after starting it)?
If they are, perhaps using dynamic_reconfigure would be more idiomatic.