Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix a bug that caused errors not to be published #111

Open
wants to merge 3 commits into
base: kinetic-devel(descrepted)
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions dsr_control/src/dsr_hw_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ DR_ERROR g_stDrError;

int g_nAnalogOutputModeCh1;
int g_nAnalogOutputModeCh2;
ros::Publisher PubRobotError;


#define STABLE_BAND_JNT 0.05
Expand Down Expand Up @@ -396,8 +397,7 @@ namespace dsr_control{
void DRHWInterface::OnLogAlarm(LPLOG_ALARM pLogAlarm)
{
//This function is called when an error occurs.
ros::NodeHandlePtr node=boost::make_shared<ros::NodeHandle>();
ros::Publisher PubRobotError=node->advertise<dsr_msgs::RobotError>("error",100);

dsr_msgs::RobotError msg;

switch(pLogAlarm->_iLevel)
Expand Down Expand Up @@ -882,6 +882,7 @@ namespace dsr_control{

bool DRHWInterface::init()
{
PubRobotError = private_nh_.advertise<dsr_msgs::RobotError>("error",1);
ROS_INFO("[dsr_hw_interface] init() ==> setup callback fucntion");
int nServerPort = 12345;
ROS_INFO("INIT@@@@@@@@@@@@@@@@@@@@@@@@@");
Expand Down
10 changes: 6 additions & 4 deletions dsr_description/launch/m1013.launch
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
<arg name="remap" default="False"/>
<arg name="color" default="white"/>
<arg name="gripper" default="none"/>
<arg name="rviz" default="True"/>


<param name="robot_description" command="$(find xacro)/xacro '$(find dsr_description)/xacro/$(arg model).urdf.xacro' '--inorder' 'namespace:=$(arg ns)' color:=$(arg color) gripper:=$(arg gripper)"/>
.
Expand All @@ -17,9 +19,9 @@
</node>

<!-- Send joint values -->
<node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<param name="/use_gui" value="true"/>
</node>
<!--node name="joint_state_publisher" pkg="joint_state_publisher" type="joint_state_publisher">
<param name="/use_gui" value="$(arg gui)"/>
</node-->
</group>

<group if="$(eval arg('remap') == True)">
Expand All @@ -29,5 +31,5 @@
</group>

<!-- Show in Rviz -->
<node name="rviz" pkg="rviz" type="rviz" args="-d $(find dsr_description)/rviz/default.rviz"/>
<node if="$(arg rviz)" name="rviz" pkg="rviz" type="rviz" args="-d $(find dsr_description)/rviz/default.rviz"/>
</launch>