ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

MohsenTamiz's profile - activity

2021-11-19 13:22:37 -0500 received badge  Nice Question (source)
2019-05-20 01:36:25 -0500 marked best answer Log rotation in ros

I am looking for a clean and standard way to have a log rotation in my program. Through this answer I found this PR that mentioned this feature but currently has not merged and does not seem have a plan to merge in the near future. Also by looking at the answer I tried to work with logrotate and with some script like this I wrote a script to rotate my logs (I had to use copytruncate) but there is a annoying problem with this approach.

As this answer mentions there is a conflict between logrotate and log4j, log4j track the position of file and when we truncate it for being compatible unix system adds some null characters before the current position of log and finally we get the same file size and rotation does not mean anything.

I think log rotation is an important feature for a program in a medium scale and above, and I wonder how some big real robot softwares implement this feature and is it possible to run a big project without this feature, I have a limited resource but I hope to able to keep all information that I log during runtime.

Can someone suggest me a solution to this and explain why does not this feature exist in ros log (am I wrong about importance of this feature or not)?

2019-04-08 01:12:00 -0500 marked best answer Using multiple library versions in catkin

For some test purposes I had to define some pre-processors that create different classes for test or non-test modes. For using in a single package this approach is sufficient and we could define pre-processors definitions in CMakeLists for test or regular executable.

But If I export a library from a catkin package, I confused how could I have different libraries export form a single catkin package to able to use the test version of the library.

For example assume I have a package A:

project(A)
catkin_package(
  LIBRARIES A
)    
add_library(A src/foo.cpp src/A.cpp)    
if (CATKIN_ENABLE_TESTING)
  catkin_add_gtest(test_A test/test_A.cpp src/foo.cpp src/A.cpp)          
  target_compile_definitions(test_A PRIVATE some_macro=true)
endif()

And another B package:

project(B)    
find_package(catkin REQUIRED COMPONENTS
                    A)
catkin_package(
)    
add_executable(B src/bar.cpp src/B.cpp)
target_link_libraries(B ${catkin_LIBRARIES})    
if (CATKIN_ENABLE_TESTING)
  catkin_add_gtest(test_B test/test_B.cpp src/bar.cpp src/B.cpp)          
  target_compile_definitions(test_B PRIVATE some_macro=true)
  target_link_libraries(test_B ${catkin_LIBRARIES})
endif()

The problem arises when we want to build test_B target, we must have a test version of library A but we could not able to export another test library using catkin, in fact, we could but all of them exported at once we could not define which one must use in which case.

Is there anyway to define some customized behavior for catkin package or do you have other suggestions for have a test version of a library?

2019-04-08 01:11:16 -0500 received badge  Famous Question (source)
2019-01-06 22:32:21 -0500 received badge  Famous Question (source)
2018-01-02 20:22:17 -0500 received badge  Notable Question (source)
2018-01-02 13:24:58 -0500 received badge  Popular Question (source)
2017-12-09 06:56:22 -0500 edited question Using multiple library versions in catkin

Using multiple library version in catkin For some test purposes I had to define some pre-processors that create differen

2017-12-09 06:54:11 -0500 asked a question Using multiple library versions in catkin

Using multiple library version in catkin For some test purposes I had to define some pre-processors that create differen

2017-12-09 06:18:10 -0500 commented question Log rotation in ros

No I`m still looking for a proper solution of it, currently we just try to log as much as we hope not floating.

2017-11-27 13:03:40 -0500 received badge  Famous Question (source)
2017-11-20 06:23:36 -0500 received badge  Notable Question (source)
2017-11-14 10:09:26 -0500 received badge  Notable Question (source)
2017-09-13 11:35:22 -0500 received badge  Popular Question (source)
2017-08-04 07:39:10 -0500 received badge  Student (source)
2017-08-04 07:38:48 -0500 received badge  Popular Question (source)
2017-07-29 08:42:45 -0500 commented question Log rotation in ros

Could anyone suggest me a starting point for solving this problem?

2017-07-29 08:42:31 -0500 commented question Log rotation in ros

Could anyone suggest me a starting point for this problem?

2017-07-27 01:07:52 -0500 asked a question Log rotation in ros

Log rotation in ros I am looking for a clean and standard way to have a log rotation in my program. Through this answer

2017-07-13 02:36:19 -0500 received badge  Enthusiast
2016-10-18 11:44:05 -0500 asked a question Using rostest with simulation time

I have two problems in using rostest. it may be that it is not a specific question but both of them together could solve my problem:

  1. How could I assure that nodes already have run when a certain test is running? For example I want to test my_node using file test_my_node. I write a .test file that run my_node and test test_my_node. But test file can run nodes in any order so it could be sometime that my_node currently does not start but the test runs and it fails.
  2. When I set the use_sim_time true, anything does not work, no publisher subscriber runs and nothing happens. But when I start publishing on clock topic after some time other nodes run and start to publish and subscribe, this behavior is very odd to me.

In my real scenario I have a node and a nodelet which must run all together and after that a test_node must run to check something of them. I am using ros kinetic on ubuntu 16.04.

2016-10-18 10:45:21 -0500 received badge  Editor (source)
2014-09-29 08:58:38 -0500 received badge  Notable Question (source)
2014-09-29 08:58:38 -0500 received badge  Famous Question (source)
2014-05-12 21:11:58 -0500 commented answer serialize deserialize message in intraprocess publishing

As ROS class reference publisher said,"This version of publish will allow fast intra-process message-passing in the future", the shared_ptr transmision will be added in future. this feature is very important in my project, and i want to be sure about this capability. Is there any way to check this?

2014-05-12 08:25:46 -0500 received badge  Popular Question (source)
2014-05-11 19:55:52 -0500 commented answer serialize deserialize message in intraprocess publishing

Thanks for your reply. Is it mean subscriber determines if a message should serialize or not? In class reference of Publish of ROS documentation message I found three methods that always do serialize for example this method: void ros::Publisher::publish( const boost::shared_ptr< M > & message)

2014-05-10 22:58:26 -0500 asked a question serialize deserialize message in intraprocess publishing

Hi, everyone. i have one publisher that publishes data on a topic, and one subscriber that receives message from that topic. both publisher and subscriber are on the same node. ros intraprocess publishing indicates that if used shared_ptr serialization/deserialization will be ignored, for testing, i use other PC and connect to running roscore on robot and with rostopic echo, i can see publishing data. therefore i think serialization and deserialization happens. furthermore rostopic in the same PC shows publishing data. i think when i publish with shared_ptr, other nodes can't see the data, if they can, serialization/deserialization is being happend. please explain if i'm wrong?