본문 바로가기
C++ 200제/코딩 IT 정보

ROS 자료형-ROS C++ 파이썬 비교 (c++ vs python)

by vicddory 2017. 7. 25.

ROS 자료형-ROS C++ 파이썬 비교 (c++ vs python)


ROS 자료형과 소스를 보면 여러 언어로 구현 가능토록 제작사에서 배포합니다. 하나의 언어로만 구현하면 모르겠는데 왕왕 다른 언어를 사용할 일도 생겨요. 그러면 ROS 자료형에 C++ 파이썬까지 봐야 합니다.


ROS 자료형


아래 표는 ROS자료형과 ROS C++ 파이썬 자료형 비교표입니다.


ROS 자료형은 표기가 좀 다르니 유의해서 보세요.


ROS 자료형과 ROS C++ 파이썬 자료형 비교


Primitive type

Serialization

C++

Python

 bool

 unsigned 8-bit int

 uint8_t

 bool

 int8

 signed 8-bit int

 int8_t

 int

 uint8

 unsigned 8-bit int

 uint8_t

 int

 int16

 signed 16-bit int

 int16_t

 int

 uint16

 unsigned 16-bit int

 uint16_t

 int

 int32

 signed 32-bit int

 int32_t

 int

 uint32

 unsigned 32-bit int

 uint32_t

 int

 int64

 signed 64-bit int

 int64_t

 long

 uint64

 unsigned 64-bit int

 uint64_t

 long

 float32

 32-bit IEEE float

 float

 float

 float64

 64-bit IEEE float

 double

 float

 string

 ascii string

 std::string

 string

 time

 secs/nsecs signed 32-bit ints

 ros::Time

 rospy.Time

 duration

 secs/nsecs signed 32-bit ints

 ros::Duration

 rospy.Duration


ROS 자료형과 ROS C++ 파이썬 자료형 비교


ROS 자료형은 C++ 파이썬과는 조금 다르네요. 이런 표는 다른 언어를 다룰 때 꼭 필요하니 먼저 확인 후 코딩하세요.


ROS 자료형-ROS C++ 파이썬 비교 (c++ vs python)

댓글