Skip to content

Commit

Permalink
Merge pull request #51 from lge-ros2/main
Browse files Browse the repository at this point in the history
Merge 'main' branch into 'foxy'
  • Loading branch information
hyunseok-yang authored Jan 10, 2022
2 parents d751c29 + eb883b6 commit b9c292b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions cloisim_ros_base/src/base.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,7 @@ bool Base::GetBufferFromSimulator(zmq::Bridge* const bridge_ptr, void** ppBbuffe
const auto succeeded = bridge_ptr->Receive(ppBbuffer, bufferLength, isNonBlockingMode);
if (!succeeded || bufferLength < 0)
{
DBG_SIM_ERR("Bridge Ptr: %p", bridge_ptr);
return false;
}

Expand Down
18 changes: 9 additions & 9 deletions cloisim_ros_bridge_zmq/src/bridge.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,11 +158,11 @@ bool Bridge::SetupSubscriber()
return false;
}

if (zmq_setsockopt(pSub_, ZMQ_RCVTIMEO, &recv_timeout, sizeof(recv_timeout)))
{
lastErrMsg = "SetSock Err:" + string(zmq_strerror(zmq_errno()));
return false;
}
// if (zmq_setsockopt(pSub_, ZMQ_RCVTIMEO, &recv_timeout, sizeof(recv_timeout)))
// {
// lastErrMsg = "SetSock Err:" + string(zmq_strerror(zmq_errno()));
// return false;
// }

if (zmq_msg_init(&m_msgRx) < 0)
{
Expand Down Expand Up @@ -328,7 +328,7 @@ bool Bridge::ConnectSubscriber(const uint16_t port, const string hashKey)
}

const string bridgeAddress = GetAddress(port);
DBG_SIM_MSG("address(%s) hash(%lX)", bridgeAddress.c_str(), nHashTag);
DBG_SIM_MSG("ptr(%p) address(%s) hash(%lX)", this, bridgeAddress.c_str(), nHashTag);

if (zmq_connect(pSub_, bridgeAddress.c_str()) < 0)
{
Expand All @@ -344,7 +344,7 @@ bool Bridge::ConnectPublisher(const uint16_t port, const string hashKey)
m_nHashTagTx = GetHashCode(hashKey);

const string bridgeAddress = GetAddress(port);
DBG_SIM_MSG("address(%s) hash(%lX)", bridgeAddress.c_str(), m_nHashTagTx);
DBG_SIM_MSG("ptr(%p) address(%s) hash(%lX)", this, bridgeAddress.c_str(), m_nHashTagTx);

if (zmq_connect(pPub_, bridgeAddress.c_str()) < 0)
{
Expand All @@ -360,7 +360,7 @@ bool Bridge::ConnectService(const uint16_t port, const string hashKey)
m_nHashTagTx = GetHashCode(hashKey);

const string bridgeAddress = GetAddress(port);
DBG_SIM_MSG("address(%s) hash(%lX)", bridgeAddress.c_str(), m_nHashTagTx);
DBG_SIM_MSG("ptr(%p) address(%s) hash(%lX)", this, bridgeAddress.c_str(), m_nHashTagTx);

if (zmq_connect(pRep_, bridgeAddress.c_str()) < 0)
{
Expand All @@ -376,7 +376,7 @@ bool Bridge::ConnectClient(const uint16_t port, const string hashKey)
m_nHashTagTx = GetHashCode(hashKey);

const string bridgeAddress = GetAddress(port);
DBG_SIM_MSG("address(%s) hash(%lX)", bridgeAddress.c_str(), m_nHashTagTx);
DBG_SIM_MSG("ptr(%p) address(%s) hash(%lX)", this, bridgeAddress.c_str(), m_nHashTagTx);
if (zmq_connect(pReq_, bridgeAddress.c_str()) < 0)
{
lastErrMsg = "ConnectClient Err:" + string(zmq_strerror(zmq_errno()));
Expand Down

0 comments on commit b9c292b

Please sign in to comment.